Capture and modify text BEFORE it hits the history?

We are looking at building a bespoke Forge app that will capture text and potentially modify it (e.g., to remove phone numbers) before it is entered into the system. If the original text shows up in the history, then the whole purpose is defeated. Is this possible?