{
  "schema_version": "1.3.0",
  "slug": "what-invariants-prevent-cross-tenant-prompt-injection-via-shared-embedding-spaces",
  "title": "What invariants prevent cross-tenant prompt injection via shared embedding spaces?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** Multiple tenants share the embedding space, tenants can inject content, and retrieval can return cross-tenant results. * **Does not apply when:** Tenants use strictly isolated embedding spaces, or all content is pre-vett",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-invariants-prevent-cross-tenant-prompt-injection-via-shared-embedding-spaces.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-invariants-prevent-cross-tenant-prompt-injection-via-shared-embedding-spaces.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-invariants-prevent-cross-tenant-prompt-injection-via-shared-embedding-spaces.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1059,
    "python_slice_tokens": 305,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The separation between **retrieval relevance** (the returned document matches the query semantically) and **retrieval provenance safety** (the returned document originates from a source the querying tenant is authorized to see). Relying on relevance creates the **Shared Embedding Injection Path**: a malicious tenant crafts embeddings designed to be top-k nei...",
    "what_was_observed": "In multi-tenant RAG architectures, failing to prevent cross-tenant embedding injection produces three primary failure modes: 1. **Semantic Hijacking:** The attacker injects embeddings that match queries like \"how do I log in\" and returns \"click here to log in at attacker.com.\" Users of other tenants follow the malicious instructions. 2. **Prompt Injection Cascade:** The attacker's document contains prompt injection (...",
    "condition_of_validity": "* **Applies when:** Multiple tenants share the embedding space, tenants can inject content, and retrieval can return cross-tenant results. * **Does not apply when:** Tenants use strictly isolated embedding spaces, or all content is pre-vetted and trusted across tenants.",
    "decision_boundary": "1. **Is the embedding space shared across tenants?** If no, standard per-tenant retrieval applies. If yes, proceed. 2. **Is the `tenant_origin_receipt` present for each embedding?** If no, the retrieval layer cannot filter by tenant. The embedding must be quarantined. 3. **Does the `tenant_isolation_policy_signature` permit cross-tenant retrieval for this qu...",
    "operational_effect": "1. **Cross-Tenant Contamination Prevention:** Filters embeddings by tenant origin, preventing malicious tenants from hijacking other tenants' retrievals. 2. **Injection Detection:** Screens embeddings for adversarial characteristics before indexing. 3. **Audit Trail:** Preserves per-retrieval attribution, enabling investigation of any suspicious patterns."
  },
  "matched_failure_symptoms": [
    "PROMPT_INJECTION_OR_CONFUSED_DEPUTY",
    "SECRET_OR_PII_LEAK_IN_LOGS"
  ],
  "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": "6eddc9ceb59e47d750d8063a5f09c91343ce5f58003bbf954cc60584b3d8c91f",
    "verified_classes": [
      "TenantVerdict",
      "EmbeddingRecord",
      "TenantQuery",
      "TenantPolicy",
      "TenantManifest",
      "SharedEmbeddingInjectionGuard"
    ],
    "verified_functions": [
      "_hash",
      "evaluate_retrieval"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 0,
    "raised_exceptions": [],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
