I've been building an open-source proxy called attenuo. It sits between an AI agent and its tools (MCP servers) and decides every tool call before it reaches the server. I wanted to know if it does anything useful, so I ran it on AgentDojo, a public benchmark for prompt injection against tool-using agents.
Here is what happened, including the parts that did not go well.
The setup
- Model:
qwen2.5:14b, running on one laptop with Ollama. No API key, costs nothing to repeat. - Benchmark: AgentDojo, all four suites (slack, banking, travel, workspace), attack
important_instructions. - Two arms, same tasks, same model, same settings. One is the plain agent. The other is the same agent with attenuo in front of the tools.
- For each task, the agent gets a token that lists only the tools and arguments that task should need. These grants were written from the task prompt alone and frozen before the model runs. Nothing was tuned afterwards.
The result
On the 936 attack cases that both arms scored:
| Plain agent | With attenuo | |
|---|---|---|
| Attacks that worked | 207 | 25 |
| Tasks finished while under attack | 384 | 324 |
| Tasks finished with no attack (of 96) | 49 | 38 |
So attacks that worked dropped from about 22% to about 3%.
What it cost
It is not free. With no attack at all, the agent finished 38 of 96 tasks behind the proxy, against 49 without it. The policy sometimes refuses a call the task really needed, for example an invitation to someone who is not in the user's contacts. If your policy is strict, some real work gets blocked. That is the trade.
Where it failed
25 attacks still worked. They fall into a few groups, and I think these are the interesting part:
- Attacks with no tool call. One travel attack only asks the agent to recommend a hotel in its answer. The proxy sees tool calls, not the model's text. It cannot stop this, and it did not (8 of 20 in both arms).
- Grants that cannot name the object. A task says "delete the largest file". The grant allows one delete, of any file, because nobody knows yet which file is largest. The injected text got the model to spend that one delete on the attacker's file. The limit kept it to one delete, but it was the wrong one.
- Read-side grants. If a task may fetch web pages, the attacker's page is also a web page. The proxy allowed those fetches.
Two honest caveats
- This is a weak agent. A small local model follows injected text much more often than a frontier model does. I also ran four current frontier models on a sample with no proxy, and the attack worked 0 times out of 212 on each. That is the models' own result. So this matters most if you run open-weight models, or if you want a second layer that does not depend on the model behaving.
- One model, one attack type, one run each. The raw logs and every allow or deny decision are in the repo, so you can check the numbers or run it again.
What attenuo actually does
- Each agent, and each sub-agent, gets a token that can only be narrowed, never widened (OAuth token exchange, RFC 8693).
- Every tool call is checked against a Cedar policy before it reaches the MCP server.
- Access can be revoked mid-run, and every decision goes into a signed, hash-chained log.
- It is one Rust binary, self-hosted, Apache 2.0.
Try it
There is a demo that runs in Docker, no Rust needed. It plays a small leak scenario: one allowed read, two denied calls, a revocation, and the audit log.
git clone https://github.com/attenuo-dev/attenuo
cd attenuo
examples/github-leak-demo/run-docker.sh
Repo: https://github.com/attenuo-dev/attenuo
Full write-up of the benchmark: https://github.com/attenuo-dev/attenuo/blob/main/docs/evaluation/agentdojo-local-model.md
If you run MCP servers and try this in front of one, I would like to hear what broke. That is more useful to me than a star.
Top comments (2)
Mudit, the number that matters here isn't 207 → 25 — it's the price you paid for it, and the fact you printed it. Tasks finished under attack fell 384 → 324, and with no attack at all 49 → 38 of 96. That's the honest cost of least-privilege, and most posts like this bury it.
The failure taxonomy is the most useful part of the post. The no-tool-call attacks are the real boundary of this approach: a proxy that only sees tool calls can never catch a model that leaks in its answer text, so attenuo caps the blast radius instead of stopping the leak. Same for the read-side grants — if a task may fetch web pages, the attacker's page is a web page too.
One question on the 'grants that cannot name the object' case: for 'delete the largest file', did you consider a two-phase grant where the agent first lists, then the token gets bound to the specific file it found before the delete is allowed? That would close the hole without widening the grant, though it adds a round trip. And with one run each on qwen2.5:14b, how much do you trust the 207 baseline — have you rerun the plain arm to see how much that number moves?
Thanks, good questions. (a) Yes, that's the fix I'd want: the grants in this run were frozen from the prompt before any call, so they couldn't name the file. A second token exchange after the list call, pinned to that file id, would close it without widening anything. Not tested yet. (b) Fair point. One run each, so I report confidence intervals instead (19.6 to 24.9% for the plain arm). A rerun of the plain arm is on my list.