为大模型代理记忆设计防篡改机制,确保记忆来源可信且不可被恶意利用。
MemLineage: Lineage-Guided Enforcement for LLM Agent Memory

- 给每条记忆附加密码学溯源和推导路径,构建可追踪的内存链
- 在三个攻击场景下将错误响应率降至零,单次操作开销低于1毫秒
- 适合需要高安全性的金融、医疗等敏感任务代理系统
我们提出MemLineage,一种针对大模型代理记忆的防御机制,为每条记忆条目附加加密溯源信息和由大模型生成的推导谱系。近期研究发现,不受信任的内容可被写入持久化代理状态,并在后续会话中作为指令重新引入;现有系统难以在保留有用记忆召回的同时防止此类状态引发敏感操作。MemLineage将问题视为保管链问题而非过滤问题。其核心是一个基于RFC-6962 Merkle日志的六模块设计,每个条目由主体制作的Ed25519签名,通过加权推导有向图记录哪些检索条目影响了新记忆的生成,并采用最大强边传播规则,确保任何归属边权重高于阈值的链均满足不可篡改性。敏感操作门控拒绝那些活跃理由源自外部祖先的操作,但仍允许良性记忆召回。我们在确定性机制隔离测试环境中对三种防御配置评估了三类内存污染负载;仅有MemLineage将所有三项指标的错误响应率(ASR)降为零,单操作延迟低于1毫秒,远低于任意LLM调用的噪声水平。通过基于Codex的AgentDojo桥梁进一步验证:在故意脆弱的工具输出配置下,无防御与仅签名基线在全部六个银行任务对中失败,而所有MemLineage配置均使严格AgentDojo ASR归零。核心确定性产物经字节级一致的CI验证;托管模型AgentDojo与实时模型扫描结果以可审计日志形式留存,而非固定字节产物。
原文摘要 · Abstract (English)
We introduce MemLineage, a defense for LLM agent memory that attaches both cryptographic provenance and LLM-mediated derivation lineage to every entry. Recent and concurrent work shows that untrusted content can be written into persistent agent state and re-enter later sessions as an instruction; the remaining systems question is how to preserve useful memory recall while preventing such state from justifying sensitive actions. MemLineage treats this as a chain-of-custody problem rather than a filtering problem. It is a six-module design around an RFC-6962 Merkle log over per-principal Ed25519-signed entries: a weighted derivation DAG records which retrieved entries influenced each new memory, and a max-of-strong-edges propagation rule makes Untrusted-Path Persistence hold for any chain whose attribution edges remain above threshold. The sensitive-action gate then refuses dispatches whose active justification descends from an external ancestor, while still allowing benign recall. We evaluate three defense cells against three memory-poisoning workloads on a deterministic mechanism-isolation harness; MemLineage is the only configuration in that harness that drives all three columns to zero ASR, while sub-millisecond per-operation overhead keeps it well below the noise floor of any LLM call. A Codex-backed AgentDojo bridge further separates strong-model behavior from defense-layer behavior: under an intentionally vulnerable tool-output profile, no-defense and signature-only baselines fail on all six banking pairs, while all MemLineage rows reduce strict AgentDojo ASR to zero. The core deterministic artifacts are byte-equal CI-verified; hosted-model AgentDojo and live-model sweeps are recorded as auditable logs rather than byte-pinned artifacts.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。