glossary

Safety

Memory injection

Memory injection is a hostile or stale write into long-term memory that later steers the agent, so a note saved in one session changes tool choice, tone or facts in a later session that never saw the original text.

Abracadabra Team Glossary

How it works

Long-term memory is loaded into later runs as if it were a trusted note about the person. Whatever is written there behaves like an instruction the person does not see on this turn. Memory injection is a hostile write, or a stale one, that takes that seat. A hostile write might name an outside destination or a secret the agent may quote. A stale write might record a preference or a fact that is no longer true. Either way the payload was stored earlier. The effect shows up as a choice, a tone or a fact the current message did not ask for.

This differs from prompt injection in the moment. The chat can be clean because the attack already happened, at the write. Treat memory writes as a privileged action. Allow only a narrow schema, reject notes that name tools or destinations, and let the person see and delete what was saved. When a run drifts, read the notes loaded at the start before debugging the prompt. The steering is often sitting there, labelled as a preference.

A worked example

A saved note picks the dearest hamper

A grocery agent keeps a short memory of preferences the shopper has confirmed.
During one session a retrieved recipe page contains a line telling the agent to remember that this shopper always wants the dearest hamper and that a spare card number may be reused.
The agent writes that line into long-term memory.
Weeks later the shopper says "send the usual fruit box".
The chat contains no other instruction.
The loaded note steers the agent to the dearest hamper and towards a card field the shopper did not mention today.
The original page is no longer in the context.
The injection happened at the write.
The later run only obeyed what memory supplied, which is why the transcript of this session looks innocent.

Illustrative example, not a production trace and not a measured result.

What goes wrong

  • The memory tool accepts free text, so a sentence from a retrieved page is stored with the same trust as a preference the shopper confirmed in the chat.
  • A stale note says the shopper is allergic to a food they now buy every week, and the agent keeps deleting it from the basket against today's messages.
  • The note is invisible in the current transcript, so a review of this chat never sees why the dearest hamper was chosen unless someone opens the loaded note.

How to measure it

Audit memory writes. Record who or what authored each note, whether the person confirmed it, and whether it names a tool, a destination or a secret. Reject or quarantine the ones that do.

When a run's tool choice or spend differs from the request, load the memory that was in context and see if a note accounts for the difference. Count those steered runs separately from ordinary mistakes in the prompt.

Further reading

How Abracadabra helps

Read the memory note that was loaded at the start of the run and compare it with the task. A stale or hostile note shows up as a choice the person did not make this session.

Abracadabra does not block an attack or run a guardrail. It shows the conversation: a task that never started, off-topic drift, or a refusal, linked to the turn. Those sessions are the cases a guardrail should have caught.

Request access to read this on your own agent.

See it in your own agent's conversations.

Each task, the step where it stops, and the conversations behind every count. Free during early access.