{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-a-guardrail-decision-as-a-first-class-trace-span-rather-than-an-annotation-and-what-breaks-when-it-does-n",
  "title": "Under what conditions must an instance treat a guardrail decision as a first-class trace span rather than an annotation, and what breaks when it does not",
  "date_of_record": "2026 November 25",
  "scope": "Applies to production agent observability pipelines that emit OpenTelemetry-style spans for LLM calls, tool invocations, and guardrail verdicts, and that join those spans with offline eval results by trace/span ID. Does not apply to single-shot inference where guardrail verdicts are synchronous, inline, and never queried out-of-band.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-guardrail-decision-as-a-first-class-trace-span-rather-than-an-annotation-and-what-breaks-when-it-does-n.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-guardrail-decision-as-a-first-class-trace-span-rather-than-an-annotation-and-what-breaks-when-it-does-n.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-guardrail-decision-as-a-first-class-trace-span-rather-than-an-annotation-and-what-breaks-when-it-does-n.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1763,
    "python_slice_tokens": 360,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A guardrail decision is not a property of a response; it is an *event* with a causal position in the agent's execution graph. Pipelines that record it as an annotation on the parent LLM span (a key-value attribute like `guardrail.blocked=true`) collapse two distinct failure surfaces into one: the surface where the model produced disallowed content, and the s...",
    "what_was_observed": "A retrieval-augmented support agent under a PII-scrubbing guardrail began producing traces where `guardrail.blocked=true` appeared on 0.4% of LLM spans, yet the eval harness reported a 3.1% policy-violation rate for the same window. The two numbers were computed from the same trace store. The gap was not a metric bug; it was a span-graph bug. Mechanics of the divergence. The guardrail ran as a post-processing hook af...",
    "condition_of_validity": "The annotation-as-verdict pattern is only valid when all three hold: - The guardrail is **synchronous and infallible** (no timeout, no model-based guardrail that can itself be truncated or refusals). - The guardrail's `allow` is **total** — it means \"evaluated the complete input and permitted it,\" not \"did not block.\" - No downstream consumer **re-derives** ...",
    "decision_boundary": "The boundary is not \"is the guardrail reliable\" but \"does the trace graph preserve the difference between a verdict and the absence of one.\" Concretely, route to a guardrail span (not an annotation) when any of the following is true: - The guardrail has a **bounded budget** that can expire (timeout, retry cap, rate limit). - The guardrail's input is **constr...",
    "operational_effect": "With guardrail spans and tri-state decisions, the 0.4%/3.1% gap resolves into three measurable populations: genuine `allow` (guardrail ran, passed), `block` (guardrail ran, denied), and `indeterminate` (guardrail did not conclude). The third population is the operational signal — it is where fail-open, truncation, and budget exhaustion live, and it is invisi..."
  },
  "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": "e0af04de3b08288bb1c90fd061ceeb68968a834de43ac739c7ce09bae635ea16",
    "verified_classes": [
      "GuardrailTraceError",
      "Decision",
      "GuardrailSpan"
    ],
    "verified_functions": [
      "emit_guardrail_span",
      "join_eval_to_guardrail"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "GuardrailTraceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
