← Latest papers
🤖 AI

SMSR: Certified Defence Against Runtime Memory Poisoning in Persistent LLM Agent Systems

This paper introduces SMSR, the first defense mechanism that provides certified robustness against Multi-Session Memory Poisoning (MSMP) in persistent LLM agent systems by combining HMAC-based provenance verification with randomized memory ablation and verdict-based majority voting to effectively neutralize both unsigned and authenticated memory injection attacks.

Original authors: Tarun Sharma

Published 2026-06-12
📖 6 min read🧠 Deep dive

Original authors: Tarun Sharma

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Problem: The "Poisoned Diary"

Imagine a smart office assistant (an AI agent) that helps employees by remembering past conversations, company policies, and facts. It keeps a digital diary (memory) that it updates every time someone talks to it. This diary helps the AI answer future questions more accurately.

The Attack:
A bad actor (hacker) doesn't need to break into the AI's brain or rewrite its code. Instead, they just talk to the AI normally, but they slip in fake, carefully worded lies into the conversation. The AI, thinking this is a normal update, writes these lies into its diary.

Later, when a different employee asks a question, the AI reads its diary, finds the fake lie, and believes it is true. It then gives the wrong answer to the new employee. This is called "Memory Poisoning."

Existing defenses are like a security guard who only checks the content of what you say. But a smart liar can phrase their fake news so it sounds perfectly normal, fooling the guard. The paper argues that without a way to verify who wrote the entry, you can never be 100% sure the diary is safe.


The Solution: SMSR (Signed Memory with Smoothed Retrieval)

The authors propose a two-part defense system called SMSR. Think of it as a combination of a Secure Stamp and a Randomized Jury.

Part 1: The Secure Stamp (HMAC Provenance)

  • The Analogy: Imagine every page the AI writes in its diary must be stamped with a special, unforgeable wax seal (a cryptographic signature) by a trusted manager before it's saved.
  • How it works:
    • If a hacker tries to inject a fake memory by directly hacking the database (without going through the normal chat), they can't forge the seal. The system sees the missing seal and throws that memory away immediately.
    • Result: This stops 100% of "unsigned" attacks (hackers who try to sneak in data without permission).

Part 2: The Randomized Jury (Smoothed Retrieval)

  • The Problem: What if the hacker is a legitimate employee? They have a valid seal, so Part 1 lets their fake memory in.
  • The Analogy: Imagine the AI needs to answer a question. Instead of reading the entire diary (which might be full of lies), it plays a game of chance:
    1. It pulls out a huge pile of relevant pages (say, 20 pages).
    2. It randomly picks a small handful (say, 5 pages) to read.
    3. It repeats this process 5 times, creating 5 different "mini-stories."
    4. It asks a "Judge" (another AI) to check each story: "Is this story telling the truth or a lie?"
    5. It takes a majority vote. If 3 out of 5 stories say "This is a lie," the system ignores the lie.
  • Why it works: Even if the hacker planted a lie, they can't guarantee that lie will be in every random handful of pages. If the lie only appears in 1 or 2 of the 5 random samples, the honest majority wins.
  • The "Certified" Part: The authors did the math to prove exactly how likely it is for the system to fail. They can say, "We are mathematically guaranteed that the chance of the AI giving a wrong answer is less than 10.4%." This is a "security certificate."

Key Concepts Made Simple

1. The "Consistent Minority" Trap

  • The Trap: If you ask a group of people a question, and 3 people give different, slightly varied "I don't know" answers, but 2 people give the exact same fake answer, a simple vote might pick the fake answer just because it's the most common string of words.
  • The Fix: SMSR doesn't vote on the words; it votes on the verdict. The Judge AI looks at the meaning. Even if the fake answers are worded differently, the Judge sees they are all "Malicious." The honest "I don't know" answers are all "Safe." The vote counts the safety verdict, not the specific words, so the fake answer loses.

2. The Cost

  • To get this high level of security, the system has to work harder. Instead of asking the AI one question and getting one answer, it asks the AI 5 times (with different random memories) and asks a Judge 5 times to check the answers.
  • The Trade-off: It takes about 10 times more computing power (and a tiny bit more money), but it prevents the AI from being tricked by lies. The paper says this is worth it for important business decisions.

What the Paper Actually Found (The Results)

The authors tested this on 15 different business scenarios (like checking expense policies or security rules).

  1. Stopping the Hackers: When hackers tried to inject fake data without a valid seal, the system stopped them 100% of the time.
  2. Stopping the Sneaky Employees: When a legitimate user (who has a valid seal) tried to inject a lie, the system reduced the success rate of the attack from nearly 100% down to about 8% in a large, realistic test.
  3. The Math Holds Up: The actual failure rate (8%) was lower than the mathematical "worst-case" prediction (10.4%), proving the security certificate works.
  4. Real-World Test: Even when the hacker tricked the AI into writing the poison itself (by asking a tricky question that made the AI write the lie to its own diary), the defense still worked, dropping the success rate from 65% down to 5%.

Summary

The paper introduces a system that acts like a notarized diary combined with a randomized jury. It proves mathematically that you can't just filter bad words; you need to verify who wrote the memory and use randomness to dilute the bad memories. This ensures that even if a smart hacker gets inside, they can't easily trick the AI into giving dangerous advice.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →