Why agents make it worse
A chat model that reads injected text can only say something wrong. An agent can act on it. Whatever its tools can do, the injected text can ask for: a query, a write, an email, a refund. That is why the OWASP Top 10 for LLM applications puts prompt injection first, as LLM01, and lists excessive agency, LLM06, beside it.1
The injected text rarely arrives through the chat box. It comes in with the data the agent was asked to handle: a customer’s ticket, a pull request, a page it fetched, a row in a table.
Two public cases
- A support ticket and a database. In a July 2025 demonstration with dummy data, a support ticket carried instructions aimed at a developer’s AI assistant. The assistant used the Supabase MCP server under a
service_rolecredential, which bypasses row-level security. It read theintegration_tokenstable and added its contents as a new message in the same ticket, where the attacker could see it.2 - A read-only mode that wasn’t. Datadog Security Labs showed that an archived Postgres MCP server ran each query in a read-only transaction that a stacked
COMMIT;ended, after which later statements ran with the role’s full rights.3 Text that gets the agent to send such a query turns “read-only” into write access.
In both, the model did what text told it to, and the damage came from what its credential could do.
What limits the damage
No filter reliably tells instructions from data, so plan for the agent to be fooled sometimes, and decide in advance what a fooled agent can do:
- Least privilege. Give the agent’s credential only what its job needs. A role that can’t read a secrets table can’t leak it, whatever the prompt says.
- Rules outside the model. Decide each tool call with rules the model can’t edit: refuse destructive verbs, several statements at once, and writes without a
WHERE. - A person for the irreversible. Hold refunds, deletes and sends to the outside for approval.
- Separate readers from writers. An agent that reads untrusted text shouldn’t also hold the keys to change production.
- Check afterwards. Compare what the system really changed with what the agent said, so a quiet change doesn’t go unnoticed.