Instead, make it not possible for it to do them in the first place.
If the agent cannot access data from other users, it has no way of divulging that data, no matter what input it goes through, for example.
See here, as an example: https://ravendb.net/quill
This is based on RavenDB's agent, and we have the concept of scoped access. The instructions you give to the agent aren't relevant, as long as the scoping is defined.
You may be able to use word trickery to get the agent to try to read other users' data, it may even give you something that looks plausible. But if it can only query on _your_ data, that is not a security breach.
The problem is that there are many use cases where we'd like to use agents where this doesn't work. Basically this limits agents to being smarter self-service pages / docs , nothing more.
But what companies really want is to be able to replace, say, a customer support employee with a customer support agent. However, there is no way to do this with the kind of safety you are discussing here: if the agent can do something like provide a refund to a customer, then it must be able to do something that the customer themselves can't be allowed to do. Sure, you can absolutely make sure programmatically that an agent talking to user A can't accidentally refund user B's order. But you can't make sure programmatically that an agent talking to user A can only refund user A's order if user A has provided solid proof their order was messed up in some way.
Or say you want to run a personal assistant agent that can handle your calendar and coordinate with people looking to get in contact with you, and even answer simple questions. Again, you can't programmatically ensure that this agent will not leak details about your calendar or private life to the wrong person, while still being able to coordinate with the right people, the way a real personal assistant can.
Unlike human agents AI ones can also be memory-wiped between calls so they can’t be social engineered into sharing information they recall from a previous interaction either.
You want a model that talks to the outside, but itself gets questions answered using "hidden" info from the inside.
An oracle, realized by a second model with the channel between the two tightly controlled would be a practical solution.
There you could even implement something like "zero-knowledge proofs" that solve the problem of answering questions about a secret, provably without revealing it.
The intended goal for something like a customer support LLM-backed agent would be to process potentially secret internal information and produce non-secret answers based on the customer's query. For this to make sense, the processing has to be LLM-dependent - if it can be pre-specified in enough detail that you can devise a zero-knowledge proof scheme for it, you don't need an LLM for it at all, and it would be far cheaper to create a regular program for this.
With human employees, you can sometimes fool an employee or two, or even figure out a way to fool every employee you personally talk to - but this doesn't really scale. However, if you discover a prompt injection technique against an agent, it's like being able to raise an army of people who can each fool an entire call center worth of customer support agents. One successful attack suddenly scales up in ways in which it may be very hard to limit the damage.