Why scoping matters
Without scoping, an Agent that helps Alice would also see notes it wrote about Bob. This is:- A privacy problem.
- A quality problem (Bob’s context contaminates Alice’s answer).
- A compliance problem (GDPR, HIPAA).
Scope shape
A scope key is a JSON-ish object. Common shapes:Setting scope at runtime
Two ways:From the Trigger
The Trigger passes the scope key into the run. All memory operations in that run use it automatically. For chat triggers, the scope defaults to{ conversation_id: <session> }. Override in the Trigger block config.
For webhook triggers, extract from the payload:
Per-tool override
A tool can call memory with an explicit scope, overriding the run default. Rare — usually a smell. Use only when the Agent legitimately needs to read cross-scope data (support agent reading their own knowledge across all customers, for example).Scope hierarchy
Scopes can be nested. Writing at a broader scope makes an item visible at all narrower scopes. Example:- Write at
{ tenant: "acme" }— everyone in Acme sees it. - Write at
{ tenant: "acme", user: "alice" }— only Alice sees it. - Alice’s reads see both her own items and tenant-wide items.
Cross-scope access (careful!)
Some Agents legitimately need cross-scope reads — support agents, admin dashboards. Grant per-space:- Cross-scope read — Agent can read any scope. Writes still respect current scope.
- Cross-scope everything — read and write. Only for admin use cases.
Testing scope isolation
Space settings → Test isolation. Enter two scope keys and a query. Nora runs the query under each scope and shows that no items leak between them. Fails loudly if isolation is broken. Recommended before shipping any Flow with multi-user memory.Debugging leaks
If an Agent seems to know something it shouldn’t:- Check the Trace’s memory ops — every read and write is logged with its scope.
- Look for items written under a broader scope than intended.
- Look for accidental cross-scope tool calls.