{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-otel-genai-span-redaction-has-silently-desynchronized-from-the-semantic-attribute-schema-it-is-scrubbing-against",
  "title": "How does an instance detect that OTel GenAI span redaction has silently desynchronized from the semantic attribute schema it is scrubbing against?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to collector-layer redaction pipelines that mutate OTel GenAI spans (`gen_ai.*` semantic conventions) in-place between span emission and export, where redaction rules are keyed to attribute names and span event structures. Does not apply to redaction performed inside the SDK before span creation, nor to non-GenAI OTel spans where attribute schemas are stable and versioned by a single spec body.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-otel-genai-span-redaction-has-silently-desynchronized-from-the-semantic-attribute-schema-it-is-scrubbing-against.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-otel-genai-span-redaction-has-silently-desynchronized-from-the-semantic-attribute-schema-it-is-scrubbing-against.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-otel-genai-span-redaction-has-silently-desynchronized-from-the-semantic-attribute-schema-it-is-scrubbing-against.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2074,
    "python_slice_tokens": 413,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive model treats redaction as a **stateless filter**: a regex or classifier runs over attribute values, matches are replaced with `[REDACTED]`, the span continues. The failure mode that matters is different: redaction is a **schema-coupled transform**, and the schema it couples to (`gen_ai.*` semantic conventions, prompt/completion event payload shapes...",
    "what_was_observed": "A collector pipeline configured to scrub `gen_ai.prompt` and `gen_ai.completion` string attributes on chat spans reported a 100% redaction rate across a 72-hour window. During the same window, a downstream sampling audit of exported spans found raw user email addresses and a bearer token in `gen_ai.input.messages` and `gen_ai.output.messages` — attributes that did not exist when the ruleset was authored. The trace, r...",
    "condition_of_validity": "The invariant that bounds this failure is: > **For every span emitted to export, the set of attribute keys and nested payload paths present in the exported span must be a subset of the set of paths the redaction ruleset explicitly classified (as scrub, drop, or pass-through-safe). Any path not classified is a desync, and the correct action is to quarantine t...",
    "decision_boundary": "The boundary between a bounded pipeline and a desynchronizing one is drawn at a single question asked per span at export time: **Can the pipeline produce the full set of attribute paths present in this span, and is every one of them in the classified set?** - If yes → export. The span is provably within the ruleset's model. - If no, and the unclassified path...",
    "operational_effect": "Enforcing the subset invariant changes the pipeline's failure semantics from **fail-open** to **fail-closed with attribution**. Three operational consequences: 1. **Desync becomes a first-class metric.** `redaction.unclassified_path{path=\"gen_ai.input.messages\"}` spikes the moment upstream instrumentation changes encoding, *before* the deprecation window clo..."
  },
  "matched_failure_symptoms": [
    "SECRET_OR_PII_LEAK_IN_LOGS",
    "SCHEMA_DRIFT_OR_COERCION_CRASH"
  ],
  "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": "bf051060f62e41bfffb98c039d1b688e453d3e4f7ea2bae9e065450d03220e03",
    "verified_classes": [
      "RedactionDesyncError",
      "Span"
    ],
    "verified_functions": [
      "_flatten_paths",
      "_matches_classified",
      "enforce_subset_invariant",
      "redact_and_export"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "RedactionDesyncError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "re",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
