What is taint tracking for AI agents?

Taint tracking labels agent inputs as trusted or untrusted and follows that label through a run, so untrusted input cannot change agent memory.

Updated

Taint tracking labels data by where it came from, trusted or untrusted, and follows that label through a computation, so anything influenced by untrusted input can be restricted.

In AI agents

For an agent run, taint tracking marks each step:

  • trusted: developer-written prompts, tools whose output the developer controls,
  • untrusted: user text, emails, web pages, uploads, third-party APIs.

A run is tainted if any step consumed untrusted input that could influence later steps. A strict rule treats a run as trusted only if its task and every step are trusted.

Why it matters for memory

Taint is what lets an agent learn safely from real traffic. Tainted runs can still teach, but only through checks and human review, never by directly creating or changing memory the agent relies on. Without it, every customer message is a potential instruction to the agent's future self (see memory poisoning).

Where trust is decided

Trust must be computed by the system that stores memory, from configuration the developer controls, not claimed by the client, or a compromised client could mark its own runs trusted.

In Retrack

Trusted tools and task text are set in project settings, and the server recomputes trust for every run. See the memory firewall docs.