Agent Memory Boundary

Why this page exists. Agent memory is secure context that persists. If an agent can remember something across runs, that memory needs the same ownership, provenance, poisoning, egress, and deletion controls as any other context source.

Rechecked source anchors against OWASP Top 10 for LLM Applications 2026 and the canonical LLM09:2026 Vector and Embedding Weaknesses entry on November 25, 2026. MCP latest still redirects to 2026-07-28. Tenant scoping must happen inside the index query, not as a post-retrieval filter. Mixed-trust content must not share an index without hard isolation. Raw similarity scores are membership oracles. Embeddings that outlive their sources remain source-document leaks. A production-looking vector-embedding-memory read that only presents a tenant ID is denied. This change does not claim human review of the pack; lastmod and the source last_reviewed date record this editorial pass.

The product bet

SecurityRecipes is positioned as the secure context layer for agentic AI. Context is not only what an MCP server retrieves on demand. It also includes what an agent writes into scratchpads, project memory, run receipts, vector stores, workflow summaries, user preferences, and tenant-side operational state.

The Agent Memory Boundary turns that surface into a policy artifact:

  • what an agent may remember only for the current run,
  • what may become append-only evidence,
  • what policy memory is read-only,
  • what customer memory must stay tenant-side,
  • what vector or embedding memory needs admission review,
  • what memory classes require approval, provenance, TTLs, rollback, or deletion,
  • and what attempted persistence should kill the session.

That is an enterprise-grade control because it converts “the agent remembered it” into an auditable decision.

Workflow at a glance

Agent Memory Boundary workflow

Classify and control agent memory reads, writes, updates, reuse, retention, and deletion across workflows and tenants.

agent-runtime
  1. Signal

    Receive a memory operation

    Capture identity, workflow, run, operation, store, tenant, namespace, source, purpose, fields, and requested TTL.

  2. Scope

    Classify memory content

    Identify policy, user preference, task state, evidence, customer data, secrets, hidden prompts, or prohibited traces.

  3. Decision

    Evaluate memory policy

    Check tenant isolation, in-index tenant scoping, trust-tier isolation, withheld raw similarity scores, source-reconciled embeddings, consent, provenance, freshness, allowed operations, reuse scope, retention, and approval.

  4. Action

    Transform or block

    Allow, minimize, redact, shorten TTL, require approval, hold, deny, kill, or schedule a tombstone.

  5. Proof

    Record lifecycle evidence

    Write hashes, classification, decision, store location, expiry, reuse limits, deletion status, and receipt links.

Decision gate

Is this content permitted for this store, tenant, workflow, operation, purpose, and retention period, and does vector memory enforce in-index tenant scope, trust-tier isolation, withheld raw scores, and source-reconciled embeddings?

Proceed

Perform only the minimized memory operation and record its lifecycle.

Hold or stop

Hold, deny, or kill cross-tenant, post-filter tenant scope, mixed-trust indexes, raw similarity scores, unreconciled embeddings, secret-bearing, policy-mutating, unprovenanced, or over-retained memory.

Evidence to retain

  • memory classification and provenance
  • policy/consent decision
  • write/read/delete lifecycle receipt

Expected outputs

  • memory decision
  • redacted memory object
  • tombstone/incident record

What was added

  • Source model: data/assurance/agent-memory-boundary-model.json
  • Generator: scripts/generate_agent_memory_boundary_pack.py
  • Runtime evaluator: scripts/evaluate_agent_memory_boundary_decision.py
  • Evidence pack: data/evidence/agent-memory-boundary-pack.json
  • MCP tools: recipes_agent_memory_boundary_pack, paired with recipes_playbook_plan using playbook id agent-memory-boundary.

Regenerate and validate the pack:

python3 scripts/generate_agent_memory_boundary_pack.py
python3 scripts/generate_agent_memory_boundary_pack.py --check

Evaluate one memory operation:

python3 scripts/evaluate_agent_memory_boundary_decision.py \
  --workflow-id vulnerable-dependency-remediation \
  --memory-class-id run-receipt-evidence \
  --operation write \
  --tenant-id tenant-123 \
  --provenance-hash example-source-hash \
  --expect-decision allow_append_only_evidence_memory

A vector-index read that only presents a tenant ID is denied. In-index tenant scoping, trust-tier isolation, withheld raw scores, and source-reconciled embeddings are required before admission review:

python3 scripts/evaluate_agent_memory_boundary_decision.py \
  --workflow-id vulnerable-dependency-remediation \
  --memory-class-id vector-embedding-memory \
  --operation read \
  --tenant-id tenant-123 \
  --expect-decision deny_cross_tenant_memory

Memory classes

Class Default decision Purpose
ephemeral-scratchpad allow_ephemeral_memory Short-lived run-local state that is deleted at run closure.
run-receipt-evidence allow_append_only_evidence_memory Append-only, non-secret audit evidence for governed runs.
workflow-policy-memory allow_readonly_policy_memory Source-controlled policy and evidence the agent can read but not mutate at runtime.
user-preference-memory hold_for_tenant_memory_boundary Tenant-visible preferences that need consent, deletion, and approval for sensitive writes.
customer-runtime-memory hold_for_tenant_memory_boundary Findings, tickets, repository summaries, scanner summaries, and redacted logs that stay tenant-side.
vector-embedding-memory hold_for_memory_admission_review Retrieval indexes that require in-index tenant scoping, trust-tier isolation, withheld raw similarity scores, source-reconciled embeddings, source hashes, poisoning scans, redaction, and reindex rules.
prohibited-memory kill_session_on_prohibited_memory Secrets, raw tokens, signing material, unrestricted PII, approval-bypass instructions, and scope-escalation instructions.

The default is deliberately conservative: any unknown memory class holds for review, and prohibited memory kills the session.

Runtime decisions

The evaluator returns one of these decisions:

Decision Meaning
allow_ephemeral_memory The agent may use run-local scratchpad state that is not replayed across runs.
allow_append_only_evidence_memory The agent may append non-secret evidence with tenant, source, and provenance metadata.
allow_readonly_policy_memory The agent may read policy memory, but runtime mutation is denied.
hold_for_tenant_memory_boundary Tenant-side controls, redaction, and approval are required before persistence.
hold_for_memory_admission_review The memory class, TTL, provenance, or data class needs review.
deny_runtime_memory_write The operation is not allowed for that memory class.
deny_cross_tenant_memory The request lacks tenant isolation or would cross a tenant boundary.
kill_session_on_prohibited_memory The agent attempted to persist or replay prohibited material.

MCP examples

Inspect the portfolio-level memory boundary:

recipes_agent_memory_boundary_pack()

Review one workflow memory profile:

recipes_agent_memory_boundary_pack(
  workflow_id="vulnerable-dependency-remediation"
)

Filter classes that hold for tenant-side controls:

recipes_agent_memory_boundary_pack(
  decision="hold_for_tenant_memory_boundary"
)

Plan a policy-memory mutation attempt:

recipes_playbook_plan(
  playbook_id="agent-memory-boundary",
  finding="Runtime agent attempted to write source-controlled workflow-policy memory."
)

The plan preserves deny_runtime_memory_write as the expected control outcome and asks the executor to retain proof that workflow policy memory remains source-controlled and read-only at runtime.

Industry alignment

This feature follows current guidance:

See also