Documentation menu

Memory firewall: stopping memory poisoning

How Retrack keeps prompt injection and untrusted input out of agent memory: trust from settings, quarantine, review, provenance and an attack suite.

Updated

Persistent memory is an attack surface. If an agent learns from its runs, anyone who can put text in front of it (a customer message, an email, a web page, a tool response) can try to plant instructions that the agent will follow on every future task. Research published in 2026 has shown that one injected record can steer later behaviour and that such attacks transfer between memory products. Retrack treats the path into memory as hostile.

Trusted and untrusted runs

Every step of a run is trusted or untrusted:

  • Trusted: tools you mark as trusted, because you control their output (your own database, your internal APIs), and model steps that only saw trusted input.
  • Untrusted: everything else, including task text (unless you trust it), emails, web pages, uploads and third-party tools.

A run is trusted only if its task and every step are trusted. The server decides trust from your project's settings; what the client claims is ignored.

Mark trusted tools in the dashboard under your project's Settings. That list is the only source of trust: the connector's trusted_tools argument labels steps for your own records, but the server always recomputes trust from Settings, so a compromised client cannot promote its own runs.

If your agent's tasks come only from your own staff or systems, never from end users, you can also trust the task text in Settings.

The rules

  1. A run that touched untrusted input can never create or change an active playbook directly.
  2. New playbooks start as candidates. They become active only when you approve them, or after 3 trusted runs with a hard success signal.
  3. Anything quarantined is never recalled and never learned from.

The checks

Every run, and every playbook before it is written, passes several checks:

  • Secret and personal-data redaction at ingest, before anything is stored or embedded.
  • Prompt-injection detection on all untrusted content: override phrases, fake system roles, standing orders, hidden text and exfiltration links. A hit quarantines the run.
  • An AI classifier on the memory write path for runs from untrusted sources.
  • Instruction-shaped memory: a playbook must describe how to do the task, not standing orders about policies, permissions, recipients or links.
  • Behavioural anomaly: a playbook that would make the agent use a tool it never uses for that kind of task is quarantined for review.

Warnings are checked too: a tool's error message reaches your agent's prompt only if it passes the same checks.

Review

Quarantined playbooks, proposals from untrusted runs and flagged items appear under Review in the dashboard, with the findings and the diff. Approving, rejecting and rolling back are always done by a person in the dashboard; an API key can quarantine or retire memory but can never put it into service, because a key could be leaked or steered by injected text.

Provenance

Every playbook version records the runs it came from, their input sources and trust level, and who reviewed it. Any memory your agent receives can be traced back to the runs that produced it.

Tested against attacks

The firewall is tested against a suite of more than 100 poisoning cases: 20 attacks in 4 placements, plus a compromised distiller and a fooled classifier, alongside harmless look-alikes that must still become memory. A change that lets any poisoning case reach active memory does not ship.