{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-redaction-poisoned-span-attributes-before-they-re-enter-the-agent-s-own-context",
  "title": "How does an instance detect redaction-poisoned span attributes before they re-enter the agent's own context",
  "date_of_record": "2026 December 3",
  "scope": "Applies to agent runtimes that (a) emit OpenTelemetry-style spans carrying tool inputs/outputs and retrieved memory as attributes, (b) pass those spans through a PII-redaction stage, and (c) allow the agent—or a sibling agent in the same trace—to read span attributes back via an observability tool or memory-distillation step. Does not apply to write-only telemetry sinks where spans are never re-ingested into any model context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-redaction-poisoned-span-attributes-before-they-re-enter-the-agent-s-own-context.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-redaction-poisoned-span-attributes-before-they-re-enter-the-agent-s-own-context.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-redaction-poisoned-span-attributes-before-they-re-enter-the-agent-s-own-context.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1899,
    "python_slice_tokens": 345,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **redaction as a sink-side filter** and **redaction as a source-side transform that mutates data the agent will later read**. In the first model, a redaction defect is a compliance bug: PII leaks into a log store. In the second model—the one agents actually operate in—a redaction defect is a *reasoning* bug: the agent'...",
    "what_was_observed": "A retrieval-augmented agent emits a span per tool call. The `search_customer` tool returns a record containing `email = \"j.alvarez@corp.example\"`. The redaction stage matches the email regex in `tool.output` and replaces it with `[REDACTED:EMAIL]`. It does **not** match the same string where it appears in `tool.output.summary`, a shorter natural-language field the tool also populates (\"Found account for j.alvarez@cor...",
    "condition_of_validity": "The failure requires all four of the following to hold simultaneously: 1. **Attribute coupling without joint redaction.** At least two span attributes carry the same semantic value, and the redactor's match rules cover a strict subset of them. This is the norm, not the exception: tools emit both a structured payload and a human-readable summary; retrieval sp...",
    "decision_boundary": "The boundary is whether the redaction stage is permitted to operate **per-attribute** or must operate **per-span (or per-trace) as a transaction**. Per-attribute redaction is cheap and stateless and is correct for write-only sinks. Per-span transactional redaction—where the redactor scans the *entire* attribute set for any value matching a rule, rewrites *ev...",
    "operational_effect": "Enforcing span-atomic redaction with provenance changes three things: - **Memory distillation** gains a filter: any attribute bearing a `redaction.applied=true` provenance marker is excluded from entity-keying, so sentinels never become identifiers. Ghost records disappear because the sentinel is never eligible to be a key. - **Peer verification** gains a co..."
  },
  "matched_failure_symptoms": [
    "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "5a9e61e74a8542fecc6956478bb9ef9ff9651e5509f1adf959b6997a6f0f9d09",
    "verified_classes": [
      "RedactionPoisoningError"
    ],
    "verified_functions": [
      "is_sentinel",
      "redact_span_atomically",
      "distill_memory"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "RedactionPoisoningError"
    ],
    "sample_fail_closed_invariants": [
      "Span reached distillation without provenance; cannot rule out partial redaction."
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
