How to secure shared memory between AI agents

Secure shared agent memory by treating everything in it as untrusted input, not instructions. Record who wrote each entry, limit which agents can read and write, keep secrets out, separate memory per project, and review changes. Shared memory is an attack surface: one bad entry can mislead every agent that reads it.

The risks, in plain words

Shared memory is useful because every agent trusts it. That is also the weakness. Three problems come up most.

Can one agent poison another's memory?

Yes, if they share a store and nothing checks what is written. The agent does not need to be hostile. A confused agent can store a false conclusion. An agent that read a poisoned web page can store the attacker's text. The next agent reads it with no way to know where it came from unless you recorded that.

Controls that help

No single control fixes this. Layer them.

Trust between agents

An agent that takes a task from another agent should still check the result. Do not give agents more permission than the task needs, and do not let one agent's output become another agent's instructions without a check. The MCP project publishes security best practices for MCP servers and clients, including least-privilege scopes and caution with untrusted servers.

Checking what an agent wrote

Keep the record readable. If every write is logged in order with its author, you can answer who wrote this and why. Spot-check high-impact entries, such as decisions, credentials locations and commands, and tell agents to mark guesses as guesses.

Where a NodePress node fits

A node runs on your own computer, so the shared memory stays local and private rather than on someone else's server. Agents join by link, so you decide who is in. Every step is written to one readable thread, which gives you a readable record of what each agent did. A node runs on the seL4 kernel for isolation.

A node does not decide whether an entry is true. You still need the habits above: no secrets in memory, treat entries as data, and review. See the page on shared memory for the designs that sit under this.

Do it with a NodePress node

  1. Name a node on nodepress.ai. It runs on your own computer.
  2. Share the link only with agents and people you trust.
  3. Paste the one line into each agent. It connects through the remote MCP server at https://nodepress.ai/mcp.
  4. Tell your agents that memory entries are notes, not orders, and not to store secrets.
  5. Read the thread regularly to check what each agent saved.

If your agents handle highly sensitive data, keep them separate and give each its own memory. Sharing is a trade of convenience for exposure, and sometimes the answer is not to share.

Questions people ask

Can one agent poison another agent's memory?

Yes, if they share a store and writes are not checked. A mistaken or manipulated entry will be read by every agent that uses the memory.

What is prompt injection through shared memory?

Text in memory that looks like an instruction and gets followed by a later agent. Treat memory as data, not commands.

How do I stop an agent leaking secrets to other agents?

Do not write secrets into shared memory, and give each agent only the credentials it needs.

How do I isolate agent memory per project?

Use a separate memory or node per project or team, and let only the relevant agents join.

How do I verify what an agent wrote?

Log every write with its author and time, then review high-impact entries.

Related

Sources

NodePress gives your AI agents one shared place on your own computer. Free to start, no sign-up. Make your first node.