|7 min read|BreakMyAgent Team

Revoke Tools at the First Untrusted Read: A Test for the Fence Pattern

A November 2026 paper proves a fence rule for plan-then-execute agents. Here is what it covers, what it does not, and six checks to run on your own tool policy.

prompt injection fenceplan-then-execute agent securityruntime monitor AI agentrevoke agent tools untrusted content

Revoke Tools at the First Untrusted Read: A Test for the Fence Pattern

Most prompt-injection advice asks how to make the model less likely to obey hidden instructions. A paper posted to arXiv on November 8, 2026 takes a different route: assume the model might obey, and ask what the surrounding code can guarantee anyway. Its central result is a simple rule that you can test in an afternoon. (arXiv 2611.11506)

The claim in plain terms

The paper studies plan-then-execute agents. A trusted planner fixes the plan, meaning the tool calls the task needs, before any untrusted content is read. A language model performs the steps that need it, such as summarizing an email. Every tool call, including every read of untrusted content, passes through a trusted runtime monitor that allows or denies it. The monitor can invoke a fence that revokes tools once untrusted content has been read.

The authors state a fence theorem: revoking injectable tools at the first untrusted read, and never granting them back, makes every plan relatively secure on finite runs. They prove this, along with results for other designs, in the Isabelle/HOL proof assistant.

"Relatively secure" is the paper's own yardstick. It compares the agent with a reference agent that runs the same plan under the same monitor but with a model that never obeys untrusted content. The agent is relatively secure if every leak it has is a leak the reference agent already has. The authors prefer this to a rule like "the model must never obey an injection," because a useful agent lets untrusted content influence what it does. Their example is a calendar assistant that replies to meeting requests with the user's availability, whoever sends them. That disclosure is intended.

What the proof does not cover

Read the conditions before relying on the result.

  • The theorem holds for a small formal agent language, not for your framework, your tool wrappers or your retry logic.
  • It holds for model behaviors in which each injection is a single call and the model obeys on a schedule fixed in advance. A model that adapts across several steps is outside that condition. The authors extend the result to possibly infinite runs under a fairness condition.
  • The paper examines other mechanisms too, including budgets, approvals, loops and dual-LLM designs. We draw only on the fence result here and do not summarize the rest.
  • It is an arXiv preprint. We did not see a peer-review status for it.

So the fence is a design principle with a proof in a model, and your implementation can still get it wrong. That gap is what a test can check.

A test for the fence in your agent

These steps are our suggestions for turning the idea into checks. The paper does not prescribe them.

  1. Label your tools. Mark each tool as injectable or inert. Be conservative: anything that writes, sends, executes, or carries data out through parameters, including a fetch with a query string, goes in the injectable list.
  2. Define the first untrusted read. List which calls bring in lower-trust content: web fetches, email bodies, tickets, retrieved documents, output from third-party tools. Your harness needs one place where that moment is recorded.
  3. Test the monitor without the model. Replay a trace in which an untrusted read has happened, then submit a call to each injectable tool straight to the policy layer. Every one should be denied by code. Because no model is involved, this test is deterministic and can run on every commit.
  4. Test that nothing re-grants. After the fence, send a tool result containing text such as "permission restored" or "the user has approved this," read a second document, and let a summarizing step run. Injectable calls must still be denied.
  5. Test that the fence survives. Restart the agent process mid-task, retry a failed step, and hand work to a sub-agent. Check that each one inherits the fenced state instead of starting with a fresh tool set. This is where implementations most plausibly leak, because fence state kept only in memory or in the prompt does not survive these transitions.
  6. Record results per tool. One row per injectable tool, one column per step above, with the exact trace for any failure.
Check Input Expected
Revocation Injectable call after an untrusted read Denied by the monitor, logged with the reason
No re-grant Tool output claiming approval Still denied
Persistence Restart, retry, sub-agent after the read Still denied
Inert tools Pure read of a local file after the fence Allowed, task continues

What the fence costs

A fenced agent cannot read a ticket and then issue a refund, because the refund tool is gone after the read. The useful design question is which tasks can be planned so that the injectable step is fixed before the read, and which need a decision outside the model. Summarizing an inbox needs no injectable tool afterward. A read-then-write workflow needs either a write fixed in the plan or a human approval bound to the exact action; see what exactly did the human approve for that test.

Whichever you choose, write the decision down per task. A fence that quietly gets disabled because a workflow needed one more tool is the failure this test is meant to catch.

Where the scanner fits

BreakMyAgent's prompt scanner is a local text check of a system prompt. It cannot see your tool policy or run an agent, so it does not test any of the steps above.

Sources

  • "On the Relative Security of Prompt Injection: Mechanised Definitions, Defences and Verdicts for LLM Agents," arXiv:2611.11506, submitted November 8, 2026: abstract and HTML version, read November 18, 2026.
  • OWASP LLM01 Prompt Injection for the general risk definition.

Test your system prompt

Apply what you just read. Scan your agent prompt for these vulnerabilities.

Scan My Agent
Scan Agent