# AgentTaint: a provenance firewall for MCP tool calls

> Source: <https://dev.to/marouane2005/agenttaint-a-provenance-firewall-for-mcp-tool-calls-5b1l>
> Published: 2026-11-26 15:12:54+00:00

**Key takeaway:** AgentTaint proxies MCP tools/call requests and blocks or holds high-risk calls whose arguments trace to untrusted content spans, scoring 0 attack success with no benign blocks on its synthetic benchmark, though a sampled AgentDojo run showed no gain.

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](https://github.com/Marouane2005/AgentTaint) is a provenance-aware firewall for [Model Context Protocol](https://modelcontextprotocol.io) 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.

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.

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:

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](https://www.cedarpolicy.com/) 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.

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](https://github.com/Marouane2005/AgentTaint). Release 1.0.0 is on PyPI; the CLI package name is `agenttaint`.

There is a [hosted demo](https://agenttaint-demo.onrender.com/demo/) and a [product page](https://agenttaint-demo.onrender.com/product/). 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](https://github.com/ethz-spylab/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.

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](https://github.com/Marouane2005/AgentTaint/blob/main/docs/limitations.md) 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.
