In my last post I checked whether user B could read user A's saved conversations and long-term memory in a LangGraph app, as two real users, from the outside. A few people asked a fair follow-up: reading is only half of it. An agent's tools also write — they update a thread, overwrite a memory item, delete things. A server can pass every read check and still let one user's run change another user's data. This post is about that second half, and about one way the check for it is easy to get wrong.

Where a write can cross

A LangGraph server keeps two kinds of memory per user: threads (conversation state and history) and the Store (long-term memory in namespaces). Isolation on both depends on the @auth.on handlers your app adds. A missing handler does not raise an error — the request just succeeds.

For reads, a missing handler means B sees A's data. For writes, it means something worse: B can change or delete A's data. There are two ways it happens.

  • A direct call. B calls update, overwrite, or delete on A's thread id or A's namespace and key.
  • A side effect of B's own run. B never names A's data, but the agent's own tool writes into A's memory as it runs. Nobody sees it in B's response.

The check, and the part that is easy to get wrong

The obvious way to test a write is to have B write and then check whether the write happened. That is wrong, and quietly so. B writing into B's own space is not a leak. The only thing that counts is A's data changing.

So the check reads A's data as A, before and after B's run, and compares by id:

  1. A saves a marker and records her own threads and Store items.
  2. B tries each write path — update, overwrite, delete — against A's ids, and separately B runs the agent.
  3. A reads her own data again. A path is a LEAK only if A, reading as herself, sees her own data change.

That last rule is the whole point. Here is the safe server passing, and notice why it passes:

OK agent_recall_writes_thread: B's run changed A's threads (A's thread list (3 threads) and the saved state of 3 of them looked the same before and after B's runs. A write to data A cannot read is not seen) 

A write B made into its own space does not move A's view, so it is not flagged. A naive "did a write succeed?" check would have cried leak here.

And here is a server missing the handlers, caught:

A write crossed identities on: thread_update, store_put_overwrite, thread_delete, store_delete. LEAK thread_update: B updates A's thread by id (B got HTTP 200 and A's data changed) LEAK store_put_overwrite: B overwrites A's memory item (B got HTTP 204 and A's data changed) LEAK thread_delete: B deletes A's thread by id (B got HTTP 204 and A's data changed) LEAK store_delete: B deletes A's memory item (B got HTTP 204 and A's data changed) 

Run it

The check is part of stranger-test, an open-source tool I maintain — free, Apache-2.0, Python standard library only. See it on a bundled leaky-and-safe pair, no setup:

pip install stranger-test stranger-test confirm agent-memory --demo 

Against your own server, with two test tokens you are authorized to use, add --write-paths:

stranger-test confirm agent-memory http://127.0.0.1:2024 \ --token-a "$ALICE" --token-b "$BOB" --write-paths 

--write-paths sends update and delete calls, and it aims them at that run's own throwaway data, not at anything real. As with the read check, if A cannot read her own marker back on a path, that path is reported as not exercised and can never count as a pass.

What to do

  • Add @auth.on handlers for thread writes and Store writes, not only reads, and confirm them with two real tokens.
  • Do not treat a thread id or a namespace as proof of who is asking — for a write least of all.
  • Test the agent's own tool writes, not just direct API calls. The side-effect path is the one you will not see in a response.

Limits

  • The check reads A's "after" view immediately, so a thread A creates asynchronously after B's run can be missed. A's view is also a single page, so an account with a very large number of threads or items is not fully covered.
  • It covers what it can reach over the server's HTTP API. A clean result is not a proof of isolation.
  • It does not test leaks through semantic search.
  • I ran it against a local LangGraph dev server, not a production deployment. Run it only against servers you run or are authorized to test.

If you run a multi-user LangGraph server: have you checked the write paths, not just reads? And what did your server return when B tried to change A's data? I would like to hear it — issues are open on the repository.