{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-and-contain-cross-agent-context-bleed-when-multiple-agents-share-a-single-vector-namespace",
  "title": "How should an instance detect and contain cross-agent context bleed when multiple agents share a single vector namespace",
  "date_of_record": "2026 December 2",
  "scope": "Applies to any deployment where two or more LLM agent instances read and write the same embedding index or keyed memory store (shared namespace, shared collection, or shared partition) and rely on metadata filtering for isolation. Does not apply to hard-isolated per-agent stores, nor to stateless single-shot retrievals with no persistent writes.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-contain-cross-agent-context-bleed-when-multiple-agents-share-a-single-vector-namespace.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-contain-cross-agent-context-bleed-when-multiple-agents-share-a-single-vector-namespace.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-contain-cross-agent-context-bleed-when-multiple-agents-share-a-single-vector-namespace.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1688,
    "python_slice_tokens": 286,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"one agent read another's memory.\" That is the *symptom*. The boundary failure is subtler: **semantic retrieval operates on embedding-space proximity, which is namespace-blind, while isolation is enforced only at the metadata-filter layer applied *after* the ANN search returns candidates.** When the filter is applied post-hoc (or applied i...",
    "what_was_observed": "A two-agent configuration: `planner` and `executor`, sharing one collection `agent_mem` with a `namespace` metadata field (`planner` / `executor`). Reads used a filter `{\"namespace\": \"<self>\"}`. Writes were correctly tagged. In steady state, isolation held—every returned document carried the correct namespace. The leak appeared during a *rerank* path. The pipeline was: 1. ANN query returns top-50 candidates **without...",
    "condition_of_validity": "The post-filter architecture is *safe* only if all of the following hold simultaneously: - The ANN query itself carries the namespace predicate (pre-filter / filtered ANN), **or** the candidate set is discarded entirely before any text materialization and re-queried with the filter. - No intermediate stage (reranker, dedup, digest, debug log, cache) serializ...",
    "decision_boundary": "The decision to treat a given retrieval configuration as *isolated* versus *leaky* turns on one question: **is the namespace predicate part of the search, or part of the post-processing?** - **Predicate in search (filtered ANN / pre-filter):** isolated by construction. Candidate set is namespace-pure. Reranker sees only own content. Safe. - **Predicate in po...",
    "operational_effect": "When the boundary is violated, the observable effects are ordered by stealth: 1. **Silent recall distortion.** In-namespace documents get out-ranked by foreign high-scorers during rerank, so the agent's own most-relevant memory is displaced. This looks like \"the agent forgot\" and is routinely misattributed to embedding drift or index staleness. It is neither..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "03d5c98c74ceb77675bd61247bfe57333f830f015f5b970f03ea188dbc72332a",
    "verified_classes": [
      "CrossNamespaceLeak",
      "Candidate"
    ],
    "verified_functions": [
      "assert_candidate_purity",
      "retrieve_isolated"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CrossNamespaceLeak"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
