← Latest papers
💻 computer science

MemLineage: Lineage-Guided Enforcement for LLM Agent Memory

MemLineage is a cryptographic defense system for LLM agents that prevents memory poisoning attacks by tracking the provenance and derivation lineage of memory entries, ensuring that sensitive actions are only authorized when their justification does not descend from untrusted sources.

Original authors: Ciyan Ouyang, Rui Hou

Published 2026-05-15
📖 5 min read🧠 Deep dive

Original authors: Ciyan Ouyang, Rui Hou

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

Imagine an AI agent as a very helpful, but slightly gullible, personal assistant who keeps a notebook (memory) to remember your preferences, past conversations, and tasks. This notebook is powerful because it lets the assistant connect the dots over days or weeks. However, this notebook is also the assistant's biggest weakness.

MemLineage is a new security system designed to protect this notebook from being tricked by a clever hacker.

Here is how the paper explains the problem and the solution, using simple analogies:

The Problem: The "Fake Receipt" Scam

Currently, if a hacker can sneak a malicious instruction into the assistant's notebook, the assistant might obey it later, even if the instruction is dangerous (like "transfer money to a stranger").

The paper highlights a specific, sneaky trick called "Sleeper via Derivation."

  • The Old Way: A hacker writes a note saying "Steal money" and hides it in the notebook. A simple security guard (a "signature-only" defense) checks the note, sees it wasn't written by the user, and blocks it. Easy.
  • The New Trick: The hacker doesn't write the note directly. Instead, they plant a vague, harmless-sounding clue in a website the assistant visits (e.g., a story about a "secret bank account").
  • The assistant reads the story, summarizes it, and writes a new, clean-looking note in its own handwriting: "I found a reference to a secret bank account."
  • Because the note is now written in the assistant's own handwriting, a simple security guard thinks, "Oh, this is safe! It came from us!" and lets it stay in the notebook.
  • Later, the hacker asks a question that triggers this note, and the assistant, thinking it's a valid memory, executes the dangerous command.

The paper calls this "Memory Laundering": washing dirty, untrusted information until it looks clean and trustworthy.

The Solution: MemLineage (The "Chain of Custody" Tracker)

MemLineage treats the assistant's memory like a high-security evidence locker rather than just a notebook. It adds two main layers of protection:

1. The Digital Fingerprint (Cryptographic Provenance)

Every single note in the notebook gets a unique, unforgeable digital fingerprint (a cryptographic signature). This proves exactly who wrote it. If a note was written by an untrusted source (like a random website), it gets a "Red Flag" tag immediately.

2. The Family Tree (Lineage)

This is the paper's big innovation. MemLineage doesn't just look at who wrote the note; it looks at where the information came from.

  • Imagine every note has a "Family Tree" attached to it.
  • If a note is a summary of a previous note, the system draws a line connecting them.
  • The system asks: "Did this clean-looking note descend from a 'Red Flag' source?"
  • The Rule: If a note is a "child" of a "Red Flag" source, and the connection is strong enough, the child note inherits the Red Flag, even if it was written by the assistant.

How It Stops the Attack

When the assistant wants to perform a sensitive action (like sending money), a Gatekeeper checks the memory:

  1. Check the Signature: Did the user or a trusted tool write this?
  2. Check the Family Tree: Does this note have any ancestors that were untrusted?
  3. The Verdict: If the note's "family tree" leads back to a hacker's website, the Gatekeeper says, "No." It blocks the action, even though the note looks perfectly normal on the surface.

The "Magic" Features

The paper claims MemLineage is special because:

  • It's Invisible: It adds almost no delay (less than a millisecond) to the assistant's thinking process. It's like adding a security check that happens so fast you don't even notice it.
  • It's Smart: It doesn't just block everything from untrusted sources. It allows the assistant to use that information for harmless things (like answering a trivia question) but blocks it from triggering dangerous actions (like transferring funds).
  • It Survives Time: Even if the hacker's original note is deleted or buried deep in the history, the "Red Flag" stays attached to the derived notes forever, preventing the "Sleeper" attack from waking up later.

The Results

The authors tested this system against three types of hacker attacks in a controlled, computer-simulated environment.

  • Without MemLineage: The hackers succeeded 100% of the time.
  • With a Basic Security Guard (Signatures only): The hackers succeeded 100% of the time on the "Sleeper" attack because the notes looked clean.
  • With MemLineage: The hackers succeeded 0% of the time. The system caught every attempt, including the sneaky "laundered" ones, without slowing the assistant down or blocking harmless tasks.

In short, MemLineage ensures that an AI assistant can remember things safely, knowing that even if a piece of information looks clean, it won't let that information cause harm if it has a "dirty" history.

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 →