{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-span-level-pii-redaction-as-non-composable-across-a-nested-trace-tree",
  "title": "Under what conditions must an instance treat span-level PII redaction as non-composable across a nested trace tree",
  "date_of_record": "2026 November 24",
  "scope": "Applies to LLM agent runtimes that emit OpenTelemetry-style span trees where child spans (tool calls, retrieval, sub-agent handoffs) carry payload text that is redacted independently of the parent span. Does not apply to single-span traces or to redaction performed once at the trace root before fan-out.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-span-level-pii-redaction-as-non-composable-across-a-nested-trace-tree.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-span-level-pii-redaction-as-non-composable-across-a-nested-trace-tree.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-span-level-pii-redaction-as-non-composable-across-a-nested-trace-tree.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1640,
    "python_slice_tokens": 278,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct guarantees an agent observability pipeline can offer, and they are routinely conflated: 1. **Per-span redaction correctness** — each span's exported attributes contain no PII, verified against the span's own payload. 2. **Trace-level non-reconstructability** — the *union* of all exported spans in a trace, when correlated by `trace_id` ...",
    "what_was_observed": "A retrieval-backed agent answered a support query. The tool-call span (`tool.retrieve`) returned a document chunk containing `alice@example.com`. The span-level redactor, configured with an email regex, replaced it with `[REDACTED_EMAIL]` in the exported `tool.result` attribute. **Span 1: clean.** The agent then wrote a reasoning step into a `gen_ai.completion` span: *\"The user's contact is alice at example dot com, ...",
    "condition_of_validity": "Per-span redaction is a valid guarantee *only* under all of the following: - **No derivation across spans.** No span's payload is a function of another span's payload within the same trace. In practice this almost never holds for agents: reasoning spans summarize tool results, handoff spans compress context, error spans echo inputs. - **The sensitive-token g...",
    "decision_boundary": "The boundary is whether the sensitive value is allowed to enter the model's context at all. - **If the value never enters context** (redacted at tool boundary, model reasons over `[REDACTED_EMAIL]`), span-local redaction is sound because no derivation edge can carry the original. This is the preferred architecture. - **If the value must enter context** (the ...",
    "operational_effect": "Without the taint closure, the pipeline produces a trace that passes every per-span assertion and still fails a cross-span reconstruction audit — the worst failure shape, because it is silent and the dashboards are green. The remediation is architectural, not a better regex: redact-at-ingestion where possible, and where the value must transit context, gate e..."
  },
  "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"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "4ded522f64eeeb02336dbe9f46820e872e5d4f48910f32943133e42686383279",
    "verified_classes": [
      "TaintCompositionError",
      "Span"
    ],
    "verified_functions": [
      "transitive_taint",
      "assert_exportable",
      "export_trace"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintCompositionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
