Per-user memory access should be governed with user-scoped authorisation, tenant or subject IDs, and per-request policy checks at the shared backend. The agent should never rely on a single shared service account to read or write all memories. Separate encryption keys, audit logs, and revocation paths help contain one user’s data to that user’s identity and session.
How should teams design the backend boundary for per-user memory?
Shared backends can store many users’ memories, but the trust boundary should still be per user, not per agent instance. That means the backend must identify the caller’s subject, bind every memory object to that subject, and evaluate access on each request. The shared service is an implementation detail; the authorisation decision is what keeps one user from inheriting another user’s state.
A good design treats read and write as separate decisions. A caller that may append to its own memory does not automatically get to enumerate, search, or overwrite other users’ memory records. The safest pattern is to make the backend enforce subject-scoped retrieval and mutation rules, rather than trusting the agent to filter what it asks for.
When teams centralise storage, they should also centralise policy, not privilege. The backend should reject any request that cannot prove which user it belongs to, and it should not accept a shared service credential as a substitute for user context. That preserves the backend as the enforcement point for identity, scope, and tenancy.
Why shared service accounts create cross-user leakage risk
Shared service accounts collapse distinct users into one powerful backend identity, which makes cross-user leakage much easier to cause and much harder to detect. If the agent can read and write all memories through one credential, then a bug, prompt injection, misroute, or logging error can expose one user’s records to another user’s session.
Using shared privilege also weakens incident containment. Once the same credential can reach every memory record, it becomes difficult to prove which user actually accessed which data, and revocation becomes blunt instead of surgical. Separate per-user authorisation and scoped backend checks reduce that blast radius, because compromise of one session or token should not imply access to the full memory corpus.
Memory systems also tend to accumulate sensitive context over time, so access mistakes compound. A system that seems harmless at first can become a retention and replay problem once the backend stores preferences, identifiers, conversation history, or task state that should remain subject-bound.
What controls make per-user memory access enforceable in practice?
The core control is per-request authorisation at the backend, backed by a stable user or tenant identifier in the request path or token claims. The backend should use that identifier to locate only the memory objects that belong to that subject, and it should verify that the requestor is allowed to act on that subject before returning or updating anything.
Operationally, this works best when teams pair access checks with isolation mechanisms. Separate encryption keys can limit the damage if storage is exposed, while distinct audit trails make it possible to trace who accessed what and when. Revocation paths matter too, because a user leaving the system should lose access to their memory state without depending on a full backend reconfiguration.
For AI agent teams, this is also where architecture discipline matters. If the agent needs to operate on behalf of many users, the backend must distinguish user context from agent capability, and it should treat the agent as a requester with delegated scope, not as the owner of every stored memory.
Risk and Threat Considerations
Per-user memory access fails when teams let convenience drive the design, because a shared backend can turn a single authorisation mistake into broad data exposure. The main risk is not just accidental leakage, but also stale access, confused-deputy behaviour, and poor revocation when the same backend identity can act for everyone.
Failure mechanism: A shared service account, missing subject binding, or weak request-level policy check allows one session to read or overwrite another user’s memory, and the backend can no longer distinguish legitimate subject-scoped access from cross-user access.
Impact: The result can be privacy loss, corrupted memory state, broken user isolation, and weaker forensic traceability. At scale, one design flaw can affect many users at once, which makes the memory layer an attractive target for abuse and difficult to unwind after compromise.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10 and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST SP 800-53 Rev 5 sets the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | ASI03 — Identity & Privilege Abuse | Per-user memory access depends on subject-scoped authority for agent actions. |
| Recommendation — Enforce per-request identity and privilege checks before any agent memory read or write. | ||
| OWASP Non-Human Identity Top 10 | NHI-05 — Overprivileged NHI | A shared backend service account can overreach across all user memories. |
| Recommendation — Replace shared backend privilege with user-scoped access and least privilege. | ||
| NIST SP 800-53 Rev 5 | AC-6 — Least Privilege | The backend should restrict memory access to the minimum scope needed for each subject. |
| AU-2 — Event Logging | Audit logs are needed to attribute memory reads and writes to a specific user and session. | |
| IA-5 — Authenticator Management | Separate revocation and secret handling matter when backend credentials or tokens grant memory access. | |
| Recommendation — Limit each request to the smallest memory scope required for that user. Log each memory access with subject, session, action, and outcome. Rotate and revoke the credentials or tokens that can reach memory storage. | ||
Practitioner Guidance
What to verify: Confirm that every memory operation carries an explicit user or tenant claim and that the backend enforces that claim at enforcement time, not just at the agent layer. If the backend cannot independently prove subject scope, the design is not safe enough for shared storage.
Decision rule: If a single credential can reach more than one user’s memory, treat that as an exception that needs redesign, not as a normal operating mode. Separate the data path, the audit trail, and the revocation path so that one user’s access can be removed without disturbing everyone else.
Practitioner takeaway: The control point belongs in the backend, and the key question is whether each request is provably tied to one subject. If that link is weak, the memory system will eventually behave like a shared mailbox instead of a per-user store.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on December 3, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org