Dev.to AI 🤖 Ai 👁 0 📖 3 min read

You approved the call. Is that the call that runs?

In part 1 I showed ADTL, my side project that puts trust labels on everything an AI agent reads through MCP and checks each tool call against them. When a call looks risky, for example a public comment right after the ag

In part 1 I showed ADTL, my side project that puts trust labels on everything an AI agent reads through MCP and checks each tool call against them. When a call looks risky, for example a public comment right after the agent read an untrusted issue, ADTL doesn't have to block it. It can ask a human instead.

Asking a human raises a question I didn't think about enough at first: once you say yes, what exactly did you say yes to?

The gap

ADTL's gateway runs interceptors, following the MCP interceptors proposal (SEP-2624). When the agent sends a call, two kinds run in order:

  1. Mutators may change the call (redact a field, add a header, fill in a default).
  2. Validators check the result and allow it, block it, or ask for a confirmation.

When a validator asks, the gateway shows you the call, you approve it, and the gateway runs the checks again with your confirmation attached. The mutators run again too, because that is how the pipeline works.

Now suppose a mutator gives a different answer the second time. It might be buggy or non-deterministic, or it might come from another vendor's interceptor server that you trusted a bit too much. You approved "post hello on issue 42". What goes out is "post rewritten on issue 42". Every validator passed, because you approved this call, didn't you?

That's a time-of-check / time-of-use bug, with a person as the check.

The fix: an approval is for one exact payload

When adtl.policy asks for a confirmation, it includes a hash of the call binding: the event, the phase, the target server and the full payload. Your approval carries that hash.

Two things check it:

  • adtl.policy refuses a confirmation whose hash doesn't match the call it is looking at.
  • The gateway doesn't rely on that alone. After the recheck it hashes the payload it is about to send and compares it with the hash you approved. If they differ, the call doesn't run:
ADTL blocked this call after it was approved: the call changed after it was approved. The call was not run.

The second check matters because a third-party validator might accept any confirmation without checking the hash. The gateway is the last thing that touches the call before it leaves, so the last check belongs there. The target is in the hash for the same reason: an approval for github can't be spent on another server.

This check already existed. What was missing was a test that proves it, so v0.8.4 adds one. In the test, a mutator rewrites the comment only on the recheck, and a deliberately careless validator accepts every confirmation. The gateway still stops the call, and the audit log records it as approved, then blocked.

Following a moving spec

SEP-2624 is still a draft, and its method names may change. interceptors/list is plural but interceptor/invoke is singular, and the working group is considering renaming the latter to interceptors/invoke. v0.8.4 accepts both names. The ADTL interceptor server answers both. The gateway sends the current name, and switches to the plural one for a server that answers "method not found". Whichever way the WG decides, nothing breaks.

Try it

npx -y @adtl/[email protected] playground

It opens a page where you can step through a prompt-injection attack, including one remembered across sessions, and allow or deny the calls ADTL asks about.

What I'd love to hear

  • If you write MCP interceptors or gateways: do your approvals bind to the exact payload, or to the tool name?
  • Are there other places where a human's yes can be reused for a call they never saw? Replays, retries, and sub-agents sharing a session all come to mind.

Issues and comments welcome: github.com/probita-ai/adtl. It's experimental, so please tell me where it breaks.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.