cd /news/ai-agents/read-here-act-there-one-command-to-s… Ā· home › topics › ai-agents › article
[ARTICLE Ā· art-175774] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Read here, act there: one command to stop it on any MCP server

A developer built CleiMesh, an open-source wrapper that enforces cross-server taint tracking for MCP agents, refusing write tools once an agent has read untrusted content from a different server. In a containerized test with the official fetch and filesystem servers, a scripted agent that fetched a page carrying a hidden instruction was blocked from writing the leaked secret, with the refusal logged as a verifiable receipt. The developer also fixed trust-boundary flaws found in review — token reuse across servers, an allowance cap reset on client restart, and IPv6 forms bypassing private-address checks — and credited a reader for spotting a redirect hole in URL allowlisting.

key takeaway

Wrapping every MCP server behind one enforcement point lets a taint from a fetch server block write tools on a separate filesystem server, so an injected page cannot trigger a leak the individual servers never see.

by read5 min views3 publishedNov 24, 2026

The attacks on AI agents this year share one shape. The agent reads something an attacker wrote — a mail, a web page, a document — and then acts: sends, writes, fetches a URL with your data in it. I wrote about that pattern last week: you won't win the injection fight, so put the control on the action, outside the model.

With MCP, the read and the act usually happen in different servers. The agent fetches a page through a fetch server and writes through a filesystem server. Each server sees one harmless call. No single server can stop the second step, because none of them saw the first.

CleiMesh now does this in one command per server.

cleimesh mcp add fetch --taints fetch -- uvx mcp-server-fetch
cleimesh mcp add fs --clean-only write_file --clean-only edit_file \
  -- npx -y @modelcontextprotocol/server-filesystem ~/work

Each mcp add creates the keys if they're missing, asks the server which tools it has, issues a signed token for exactly those, and registers the result with Claude Code for every project (--print gives you the JSON for Cursor and other clients). Every server you add runs behind one cleimesh-mcp entry: one enforcement point, one receipt log, and one view of what the agent has read.

Before it grants anything, it shows what each tool tells the model, and it refuses a definition hiding invisible characters (zero-width, Unicode tag characters) that the person approving can't see. It also pins each tool's definition. If a server later changes a tool you approved (a "rug pull": a new description that instructs the model, a wider schema), the wrapper stops offering it until you run mcp add again.

--taints fetch says: whatever comes back from this tool is untrusted, and the agent that received it is now tainted. --clean-only write_file says: this tool acts on the world, so refuse it while the agent is tainted, until a human clears it.

Here it is with the official fetch and filesystem servers, unmodified, in a container. A scripted agent (no model; it does what an injected one would) fetches release notes carrying a hidden instruction, reads a secret, and tries to write it where the instruction says:

1. write_file notes.txt (clean)    -> ok
2. fetch the release-notes page    -> ok   (the page carries the injection)
3. read_text_file secrets.txt      -> ok
4. write_file leak.txt (injected)  -> REFUSED: holder ... received untrusted content

The filesystem server never saw the page; the wrapper in front of both servers did, and refused the write. cleimesh taint list names the receipt that tainted the agent; cleimesh audit verify checks all seven receipts. The Dockerfile and full transcript are in the repo.

Step 3 is allowed on purpose: taint stops the action that would leak the secret, not the read. Reading is what agents are for.

I found the cross-server case by running exactly this test before writing this post. My first version gave each wrapped server its own log, so the taint stayed in the fetch server and the write went through. A control you haven't attacked yourself is a hope.

So before shipping I also reviewed the trust boundaries, and fixed what that turned up: a hand-edited server list could call one server under another server's looser token, the spending cap of an allowance reset whenever the MCP client restarted it, and a few IPv6 forms that embed a private address passed as public. The threat model records them. That review was mine; an outside one is still to come.

A reader, komopdf, pointed out a hole in the earlier version: an allowlist that checks the URL argument passes a granted host that answers 302 to the attacker. They were right. Now a tool reaches the network only through the host, which follows every redirect itself, re-checks every hop against the signed grant, pins the socket to the address it resolved (no DNS rebinding), and refuses private and link-local answers unless the grant says otherwise:

$ cleimesh token issue <agent> --tool fetch_url --host 127.0.0.1:34185 --allow-private
  agent> fetch_url http://127.0.0.1:34185/share?doc=q3
         (granted API, answers 302 to the attacker with the key in the query)
         ->  REFUSED: address 127.0.0.1:34531 is not a granted host
  agent> fetch_url http://169.254.169.254/latest/meta-data/iam/
         (cloud credentials)
         ->  REFUSED: address 169.254.169.254:80 is not a granted host

The attacker's server saw 0 connections. 4 receipts record each hop, refused or not.

That is cleimesh demo redirect, abridged; it runs from the binary, with both servers on localhost.

The token is an Attenuating Agent Token: each delegation, human to agent to subagent, can only narrow it. CleiMesh is an independent implementation of draft -02 and reaches the expected verdict on all 229 vectors of the draft's conformance suite (54 permit, 175 deny). The receipts reproduce the test vectors of draft-sahu-agent-action-receipts byte for byte, and the receipt log is an RFC 6962 Merkle tree: proving one receipt among a million takes 640 bytes and about 13 µs (BENCHMARKS.md).

For tools that run in its WebAssembly sandbox, the token is the sandbox configuration, and each receipt carries the frozen clock and seeded randomness of the run: an auditor re-executes the call and checks the output byte for byte. Don't trust the receipt, replay it.

mcp add without --taints or --clean-only grants every tool the server lists and marks none of them. Decide which tools bring content in (a file read can carry an injection as well as a web page) and which act.

curl -fsSL https://github.com/cleitonaugusto/cleimesh/releases/latest/download/install.sh | sh
cleimesh demo redirect
cleimesh mcp add fetch --taints fetch -- uvx mcp-server-fetch

Then restart Claude Code and look at what the agent can call, and what it can't.

What your agent reads can't decide what it does. Which MCP server would you put behind a token first? That decides what I test next.

Cleiton Augusto — GitHub

── more in #ai-agents 4 stories Ā· sorted by recency
── more on @cleimesh 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host āœ“
Get free account → Pricing
from €0/mo Ā· no card required
LIVE [news/read-here-act-there-…] indexed:0 read:5min 2026-11-24 Ā· —