Technical Guide

Taint tracking for AI agents and how it blocks injected tool calls

Taint tracking labels every piece of content by where it came from, carries those labels to anything derived from it, and checks them at the tool-call boundary. If a call to a privileged tool was influenced by untrusted content, policy can block it, require human approval, or restrict it to lower-privilege tools before it executes. The decision rests on provenance, not on whether the model recognized an injection.

What taint tracking means in an agent context

In an agent, content arrives from many places: the web, documents, email, and MCP tool outputs. Each source passes through a runtime layer that assigns a provenance label before the content reaches the model, so every item is tagged by origin as trusted or untrusted.

The label does not stay on the original item. It follows the content into model context, model outputs, and tool arguments, and the propagation rule also has to cover memory and agent-to-agent messages. The stages below show where taint is applied and where it is checked.

Where taint is applied and checked

  1. LabelContent entering context is tagged by origin: trusted or untrusted.
  2. PropagateLabels follow content into model context, outputs, and tool arguments.
  3. CheckThe runtime evaluates taint on each tool call before execution.
  4. DecidePolicy allows, blocks, escalates for approval, or restricts the call.

A concrete scenario: the injected email

Email is one of the sources an agent may ingest, and its content is labeled by origin like any other. If an email carries injected instructions and a later call to a privileged tool was influenced by that content, the taint label is still attached to the call when it reaches the enforcement point.

Policy then evaluates the call before it executes. Because the decision rests on provenance, it does not depend on whether the model recognized the email as an injection.

Policy decisions at the tool-call boundary

Tool calls are mediated by a single enforcement point that the model and agent code cannot bypass. At that point, policy can express its actions by tool sensitivity, agent identity, and taint state.

Policy outcomes for a tool call evaluated at the boundary
OutcomeEffect on the call
AllowThe call proceeds to execution.
BlockA privileged call influenced by untrusted content does not execute.
ApproveThe call is escalated for human approval before it executes.
RestrictThe call is limited to lower-privilege tools.

Limitations and trade-offs

Taint tracking is only as complete as its labels and its enforcement point. Where derivation cannot be determined, the propagation rule must define what happens. Declassification, which removes a taint label, must be explicit, narrowly scoped, approved by a named owner, and logged. The requirements below describe what an architecture needs in place for these controls to hold.

Architectural requirements for adoption

  • Every content source, including web, documents, email, and MCP tool outputs, passes through a runtime layer that assigns a provenance label before reaching the model.
  • Tool calls are mediated by a single enforcement point that the model and agent code cannot bypass.
  • A defined propagation rule covers model outputs, memory, and agent-to-agent messages, including what happens when derivation cannot be determined.
  • Policy can express block, approve, and restrict actions by tool sensitivity, agent identity, and taint state.
  • Declassification is explicit, narrowly scoped, approved by a named owner, and logged.
  • Each tainted-call decision is recorded with enough detail for audit and incident review.

Review where your agents' tool calls are enforced

If you are mapping provenance, permissions, and approval paths for enterprise agents, a technical conversation can help clarify the enforcement point in your stack.

Talk to an Expert