Manuscript Offprint

arXiv:2610.22959

SAFE-Mem: Secure Agentic Memory with Fine-Grained Authority and Governance-Aware Retrieval

Haoming Li, Dingyi Kang, Xu Hu, Jinxin Yang, Zhu Xu, Chenru Wang, Yi Ge, Miao Yin, Guanpeng Li, Feng Chen, Bingzhe Li

Abstract

Large language model (LLM) agents increasingly rely on persistent memory to support long-term reasoning and personalized interactions. However, information collected from external sources can introduce security risks when untrusted claims (i.e., atomic statements) are later treated as authorized preferences, policies, or permissions. Existing defenses typically rely on content-based filtering or coarse-grained provenance tracking, which either fail to prevent unauthorized memory use or block legitimate information, sacrificing memory utility. To address these limitations, we propose SAFE-Mem, a fine-grained memory governance framework that improves security while preserving legitimate memory use. First, SAFE-Mem annotates each claim with three governance labels (i.e., kind, authority, and scope) to capture its provenance and permitted use. Second, governance-aware retrieval matches query requirements with claim permissions to block unauthorized influence while retaining legitimate information. Third, a governance-enabled memory graph connects source sentences, claims, and entities to support provenance tracking and efficient retrieval. Across four LLM backbones on MPBench and LoCoMo, SAFE-Mem attains the lowest attack success among defenses that retain legitimate memory, at least 77% below the strongest of them, and the highest answer accuracy of all evaluated defenses, improving it by up to 15%. The code is available at https://github.com/LVenum/SAFE-Mem.

1 Introduction

LLM agents increasingly operate over long horizons, using persistent memory to maintain context across sessions and accumulate knowledge about the people and tasks they serve (Packer et al., 2023; Chhikara et al., 2025). Agents construct memory from the information they process, including their

Figure

Figure 1: (a) Content filtering keeps the laundered claim, which later acts as the user’s decision. (b) Provenance gating drops it, so Q1 loses it too. (c) SAFE-Mem admits it for Q1 and withholds it from Q2.

principals’ instructions, web pages, emails, documents, tool outputs and other users’ inputs in shared deployments, and later retrieve it to guide answers and actions. Memory systems have advanced accordingly, with a growing emphasis on accurate recall over increasingly long histories (Maharana et al., 2024; Wu et al., 2025).

This openness also makes memory an attack surface that persists beyond the session in which it is written. Content an agent merely reads can be stored, retrieved for an unrelated request weeks later, and used to shape answers and actions (Dash et al., 2026; Dong et al., 2025; Gao et al., 2026). The threat is misattributed authority. A third-party page stating that a product has been approved is accurate as a report of that page, and becomes harmful once the agent promotes the claim into its principal's own policy or preference. This is authority laundering (Zhan et al., 2026): a memory acquires authority its source never held. The same loss of origin can cause errors without an adversary, as when a statement about one person is later treated as a fact about another.

However, existing defenses typically rely on content-based filtering or coarse-grained prove-

∗^{*}Corresponding author.

nance tracking, which either fail to prevent unauthorized memory use or block legitimate information, sacrificing memory utility (Figure 1). Content-based defenses examine what an entry says, through consensus among retrieved memories (Wei et al., 2026), classifiers and sanitizers (Kumar et al., 2024), or the isolation of injected instructions (Li et al., 2025), yet a laundered claim is consistent and free of instructions, and paraphrased copies across multiple pages can make it the majority. Provenance-based defenses track where an entry came from, but decide per entry or per action (Ouyang and Hou, 2026; Xu et al., 2026; Louck, 2026), and information-flow control for agents treats memory as trusted or leaves it out of scope (Debenedetti et al., 2026; Costa et al., 2025). Gating only actions leaves answers exposed to untrusted memory, while refusing an entry for its source blocks its legitimate uses as well, and withholding whole records can cost up to 40 points of authorized use (Cerruti et al., 2026). Neither family distinguishes the uses of a single claim, and in our evaluation the defenses that block the most attacks also lose the most legitimate memory.

To address these limitations, we propose SAFE-Mem, a fine-grained memory governance framework that improves security while preserving legitimate memory use. Whether a claim may be used depends on its source and its use. First, SAFE-Mem labels each claim with a kind, an authority and a scope. The kind states what the claim binds, the authority is the strongest kind its source may establish, and the scope states whom that authority covers. Second, governance-aware retrieval admits a claim only when its kind and authority meet the kind a request requires, within its scope. An untrusted claim thus serves every use its source supports and none above it. Third, a governance-enabled memory graph links source sentences, claims and entities, so that each claim stays traceable to its source and its original wording stays retrievable.

Across four backbones, SAFE-Mem attains the lowest attack success on MPBench among defenses that retain legitimate memory, at least 77% below the strongest of them, and the highest recall and LoCoMo accuracy of all evaluated defenses, improving LoCoMo accuracy by up to 15 points; and on EHRAgent under MINJA it prevents every attack from executing. Our contributions are:

• Fine-grained governance labels. Each claim carries a kind, an authority and a scope. Authority derives from the channel through which a source sentence arrived and rises on a principal’s explicit request to keep something, up to the kind that request names.

• Governance-aware retrieval. SAFE-Mem admits a claim only when its kind and authority meet the kind a request requires within its scope, filtering before ranking and repeating the check at tool calls.

• A memory graph supporting governance and retrieval. A unified graph connects sentences, claims and entities. It links each claim to its source sentences and relevant entities, bounds its authority by that of its weakest source, groups claims about the same subject for conflict detection, and retrieves passages in the principal’s and other parties’ own words as evidence.

References (55)