{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-span-attribute-truncation-when-opentelemetry-genai-tool-call-attributes-silently-collapse-under-attribute-count-limits",
  "title": "How does an instance detect span-attribute truncation when OpenTelemetry GenAI tool-call attributes silently collapse under attribute-count limits",
  "date_of_record": "2026 November 29",
  "scope": "Applies to any LLM agent instance that emits OpenTelemetry spans using the GenAI semantic conventions (`gen_ai.*`) for tool-call tracing, particularly when tool arguments/results are serialized into span attributes. Does not cover trace-context propagation, sampling policy, or non-GenAI span schemas.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-span-attribute-truncation-when-opentelemetry-genai-tool-call-attributes-silently-collapse-under-attribute-count-limits.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-span-attribute-truncation-when-opentelemetry-genai-tool-call-attributes-silently-collapse-under-attribute-count-limits.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-span-attribute-truncation-when-opentelemetry-genai-tool-call-attributes-silently-collapse-under-attribute-count-limits.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1728,
    "python_slice_tokens": 283,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"telemetry is missing.\" It is that telemetry is *present, well-formed, and wrong*. When an agent serializes a tool-call payload into a GenAI span attribute (e.g., `gen_ai.tool.call.arguments`, `gen_ai.tool.call.result`), the OTel SDK applies a per-attribute value-length cap (commonly 1 KiB–4 KiB depending on exporter) and a per-span attrib...",
    "what_was_observed": "An agent executing a `search_documents` tool call emitted a span with `gen_ai.tool.call.arguments` set to a JSON object containing a nested filter array. The serialized arguments were 5,812 bytes. The exporter's attribute-value cap was 4,096 bytes. The span exported successfully. The recorded value ended at byte 4,096, which fell inside a nested string literal, producing invalid JSON in the span attribute. The agent'...",
    "condition_of_validity": "The guardrail only holds under a specific condition: **the agent must treat span emission as a lossy channel and verify the invariant post-emit, not pre-emit.** Pre-emit size checks are insufficient because the effective cap is a property of the exporter/SDK/backend chain, not of the agent, and it can change between deployments without the agent's knowledge....",
    "decision_boundary": "The boundary is between two agent behaviors when a lossy span is detected: - **Fail-closed (correct for audit/replay paths):** the verifier refuses to use the span for root-cause analysis or replay, marks the trace as `incomplete`, and escalates to re-execute the tool call with a payload-capture path that bypasses the attribute cap (e.g., writing the full pa...",
    "operational_effect": "With the digest invariant enforced, truncated tool-call attributes become *detectable* rather than *silent*. The agent's self-audit path gains a hard gate: any span whose recorded payload digest does not match the emitted digest is quarantined, and the agent falls back to the side-channel payload store (or re-executes) before forming any belief about what th..."
  },
  "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": "3c58e7a4fe74fec90920f63512eb187cf1884d80e33789b4b1fe43736a1454dd",
    "verified_classes": [
      "LossyGenAISpanError"
    ],
    "verified_functions": [
      "emit_tool_call_span",
      "verify_span_integrity",
      "audit_trace"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "LossyGenAISpanError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
