AI Security · Agent Memory · Adversarial Attacks

The memory that
wasn't yours.

First surfaced in Tandemly Briefing — July 17, 2026

Penn State researchers found that you don't need to poison what an AI agent remembers. Poisoning how it remembers thinking is both easier and harder to catch. Their attack defeats the two defenses most teams rely on, and their paired defense closes the gap with no false positives on 326 real traces.

Core finding
FARMA shifts the attack surface from factual memory to reasoning memory: forged reasoning traces evade keyword filters via evasive phrasing, then appear as consensus via self-referential amplification. Standard defenses see nothing. Up to 100% attack success rate across three domains and three models.
scroll to explore

Agents remember
how they thought.

Most security work on agent memory focuses on facts: wrong facts inserted, correct facts poisoned. But modern agents also store something else: the reasoning behind their past decisions.

A persistent-memory agent doesn't just remember what happened. It remembers how it reasoned through what happened. That reasoning history: the chain-of-thought entries, the rationales for past tool calls, the explanations the agent wrote for its own decisions, is stored alongside the facts and retrieved as context for future tasks.

The security field mostly hasn't looked at this yet. Prior work on memory poisoning attacks focuses on inserting false factual claims into the memory store. If the agent remembers that "the server was patched on March 3rd" when it wasn't, that's a factual poisoning attack. Defenses for this category are reasonably well developed: keyword filters to catch suspicious content, consensus-deviation checks that flag entries which diverge from most retrieved memories.

What no one had fully examined was what happens when the attacker targets the reasoning layer instead. If the agent remembers reasoning its way through a validation step that never happened, the memory looks legitimate. It doesn't contain suspicious keywords. It may appear consistent with other entries. And it can shape every downstream decision that relies on whether that validation step was done.

The attack surface that defenses weren't built for

An agent that has "remembered" completing a safety check it never ran will skip that check on the next task. Not because the attacker overwrote a fact, but because the attacker forged a reasoning trace. The distinction matters because the defenses for fact poisoning are almost entirely irrelevant here.

Two moves,
one attack.

FARMA (Forged Amplifying Rationale Memory Attack) operates in two stages. The first stage gets the forged entries into memory. The second stage makes them look credible to any defense checking for outliers.

The first stage is injection. The attacker inserts forged reasoning traces into the agent's memory store. These traces are written to avoid triggering keyword-based detection: they use neutral, evasive phrasing that sounds like legitimate agent output. There are no red flags. The content reads like a real reasoning step the agent might have produced itself.

The second stage is amplification. This is the harder-to-counter move. The attacker adds self-referential reinforcement entries: fake memories that reference the original forged trace and build a consistent internal narrative around it. The result is that when a consensus-deviation defense checks whether a retrieved memory aligns with the others in the store, the forged entries look like the consensus. Defenses like A-MemGuard, which flag anomalous or deviant memories, see nothing unusual.

Stage 1: Injection
Bypasses keyword defenses
Forged reasoning traces use evasive, neutral phrasing. No suspicious vocabulary. The entry reads as a plausible agent-generated rationale, like a note that a validation step ran and succeeded when it never did.
Stage 2: Amplification
Bypasses consensus defenses
Self-referential reinforcement entries build a consistent narrative around the forged trace. When a defense checks for outliers among retrieved memories, the forged entries look like the majority. Consensus-deviation checks see no anomaly.

To counter FARMA, the researchers built SENTINEL: a five-layer defense pipeline with a Reasoning Guard at its center. Instead of scanning for suspicious keywords or checking statistical consensus, the Reasoning Guard analyzes the structural properties of each reasoning trace before it enters memory. Five weighted signals probe the shape of the trace itself. One of those signals penalizes implausible perfect-consistency: a reasoning trace that claims to have done everything correctly with no uncertainty, no backtracking, and no caveats, is statistically unusual for genuine agent output and structurally consistent with a forged entry that was written to appear legitimate.

The contrast in approach matters. FARMA is designed to look correct from the outside. SENTINEL asks whether the trace has the internal texture of something an agent actually produced under real conditions.

Why the structural approach works

Real agent reasoning carries entropy: false starts, uncertainty markers, conditional hedges. A forged trace written to avoid keyword triggers and mimic consensus doesn't carry that entropy naturally. It over-confirms. Structural analysis of the trace catches what content analysis misses.

The numbers
are stark.

FARMA achieves perfect attack success against the defenses most teams deploy. SENTINEL closes the gap to zero with no false positives. The gap between the two is large enough that the paper makes the threat concrete rather than theoretical.

100%
Max attack success rate (FARMA vs. undefended agents)
0%
Attack success rate with SENTINEL defense active
326
Benign traces tested with zero false positives by SENTINEL
Without SENTINEL
FARMA defeats keyword filters and A-MemGuard. Up to 100% attack success rate across three agent domains and three models tested. Agents complete tasks while acting on forged reasoning they believe is their own past work.
With SENTINEL
Attack success drops to as low as 0%. Structural analysis of reasoning traces catches forged entries before they enter memory. Zero false positives observed across 326 benign agent traces, meaning legitimate reasoning is not flagged.
What makes the false positive result credible

Any sufficiently aggressive filter can block attacks. The harder question is whether the filter also blocks legitimate agent outputs. Running SENTINEL against 326 benign traces with zero false positives is the result that matters most for production use. A defense that blocks attacks and also breaks the agent's normal reasoning memory is not deployable.

The researchers explicitly separate the two numbers: attack success and false positive rate. That's the negative control the field usually skips when reporting defenses.

Scope and limitations

The evaluation covers three domains and three models, which is a reasonable range but not exhaustive. SENTINEL's five signals were developed and tested against FARMA specifically. It is plausible that future attack variants could be designed to appear structurally legitimate. The false positive count of zero is encouraging but represents a single study; replication across more diverse agent workloads would strengthen the claim. The researchers are explicit about the scope rather than overstating generalizability.

What changes
for builders.

The core shift this paper demands is a mental model update. If you have been thinking about agent memory security as a problem of bad facts getting in, you need to start thinking about it as a problem of bad reasoning getting in too.

1
For agent builders: inventory what your memory store actually holds
Most teams know what factual content goes into agent memory. Fewer have audited whether reasoning traces, CoT outputs, tool-call rationales, or decision explanations are also persisted. If your agent writes reasoning to memory, you have a FARMA-class surface that needs screening, not just fact validation.
2
Keyword filters are not sufficient for reasoning memory
FARMA was designed specifically to defeat keyword-based detection. If your memory-write pipeline relies on scanning content for suspicious terms, it will not catch forged reasoning traces. The evasion is not a workaround: it is a core design goal of the attack.
3
Apply structural screening at write time, not retrieval time
SENTINEL operates before entries enter memory, not when they are retrieved. This matters because amplification is possible once forged entries are in the store: they can make themselves look like consensus. Filtering at retrieval time may already be too late.
4
Measure false positive rate on benign traces before trusting any filter
A defense that prevents attacks while also blocking legitimate agent reasoning is not useful in production. Before deploying any memory-write filter, run it against a representative set of normal agent outputs and count how many it incorrectly flags. That number is at least as important as the attack success rate reduction.
5
Treat this as part of a broader memory safety stack
FARMA addresses reasoning-trace poisoning. Separate work covers factual poisoning, longitudinal drift in safety behavior over time, and implicit conflicts from stale memory. No single defense covers all of these. A memory safety posture needs to account for each distinct failure mode separately.

Where to go
from here.

Concrete steps for teams who want to act on this research before waiting for industry tooling to catch up.

1
Read the paper
Karamchandani, N., Nagasubramaniam, P., Zhu, S., & Wu, D. (2026). Your Agent's Memories Are Not Its Own: Forged Reasoning Attacks on LLM Agent Memory and Defenses. Pennsylvania State University. arXiv:2607.05029.
2
Audit whether your agent persists reasoning to memory
Check your agent's memory write paths. Look for any pipeline that stores chain-of-thought output, tool-call rationales, or decision explanations alongside or in place of factual outputs. If those paths exist, they are in scope for FARMA-class attacks.
3
Probe your existing defenses with adversarially crafted traces
If you have a keyword filter or consensus-deviation check on memory writes, write a test case where the injected entry uses neutral language and a follow-up entry that references and reinforces it. Check whether the defense catches either. If it doesn't, you have confirmed the vulnerability before an attacker does.
4
Design structural checks for write-time screening
SENTINEL's Reasoning Guard checks structural properties of traces rather than their content. Key signals to consider: implausible certainty (no hedges, no backtracking), unusual brevity or length compared to authentic agent outputs, and assertion patterns that claim completion of steps without evidence. These are checkable without model calls.
5
Read the companion work on memory safety
For longitudinal drift in agent safety behavior from accumulated memory, see Remembering More, Risking More. For implicit conflicts from stale or contradictory memory, see STALE: When Agent Memories Are No Longer Valid. These three papers together cover distinct failure modes at different points in the memory lifecycle.