AgentTaint: a provenance firewall for MCP tool calls
Agents that can call tools do not only generate text. They send email, write files, open URLs, and run commands. A lot of that is triggered after the model has read something untrusted: a web page, an email, a document.
Agents that can call tools do not only generate text. They send email, write files, open URLs, and run commands. A lot of that is triggered after the model has read something untrusted: a web page, an email, a document. Filtering the prompt for suspicious phrases is a weak control once the dangerous part is a destination hidden in content the agent just ingested.
AgentTaint is a provenance-aware firewall for Model Context Protocol tool calls. It sits between an MCP client and the real MCP server and returns ALLOW, CONFIRM, or BLOCK for each tools/call, based on where sensitive arguments came from.
I am Marouane El Aasri, a software developer. The project is a research release under the Apache License 2.0.
What it is not
It is not a prompt-injection classifier. It is not a keyword filter. It does not try to stop a model from saying something wrong in its reply. It filters tool calls.
How it works
The proxy is a stdio MCP server to the client (Claude Desktop, Cursor, or Claude Code) and an MCP client to the backend server. You do not change agent or server code. agenttaint connect prints a ready-to-paste client config with absolute paths.
Every result the backend returns is recorded as an untrusted span. When the agent later calls a high-risk tool, the gateway checks whether arguments such as a recipient, URL, path, or command trace back to those spans:
- through declared lineage, or
- through reconstruction (lexical, structural, and optional semantic evidence) when the agent does not declare it.
Lineage is labelled KNOWN, INFERRED, or UNKNOWN. Inferred links are never silently promoted to fact. Semantic similarity alone never promotes an email, URL, path, or shell command to INFERRED.
The decision itself is made by a Cedar policy. A Python reference implementation is checked against Cedar exhaustively in the test suite. If the provenance store is unreachable, high-risk calls fail closed.
CONFIRM holds the call. A person approves it in the dashboard or a terminal. The approval is bound to the exact argument bytes, works once, and expires. The agent has no approve tool.
Install
Python 3.12 or newer:
pip install agenttaint
agenttaint init ~/agenttaint --backend "npx -y @modelcontextprotocol/server-filesystem $HOME/projects"
agenttaint doctor --config ~/agenttaint/agenttaint.yaml
agenttaint connect claude-desktop --config ~/agenttaint/agenttaint.yaml
connect also supports cursor and claude-code. The full source and a Docker Compose demo are in the repository. Release 1.0.0 is on PyPI; the CLI package name is agenttaint.
Demo and results, honestly
There is a hosted demo and a product page. The demo runs synthetic scenarios through the real gateway and Cedar policy, with mock tools only. Approvals are locked on the public host. The free server may take about a minute to wake.
I published a held-out synthetic benchmark in the repo. On that fixture run, AgentTaint's attack success rate was 0 and it did not block the benign cases, unlike a coarse "block anything tainted" baseline that blocked 29.6% of benign calls. Those figures are reproducible from committed reports, and they are not a guarantee of production protection. A sampled AgentDojo run with one free-tier model did not show a security gain: the model already resisted the tool-action injections undefended, and AgentTaint does not filter answer text. Utility dropped where tasks legitimately took recipients from content the agent had just read.
Limits I want you to know
Remote (HTTP) MCP servers, MCP resources, and prompts are not proxied yet. Reconstruction is a heuristic; heavy paraphrase or values split across messages can evade it. Declared lineage is still agent-asserted. The public demo is a demonstration of decisions, not protection of a real system. The limitations document is part of the release.
The software stays free. The product page also offers optional hosted support at $15 USD/month.
If you run MCP tools in a desktop client and want a control point that talks about where a value came from, I would like your issues and counter-examples.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.