{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-span-attribute-truncation-when-genai-tool-call-arguments-exceed-the-otel-attribute-value-ceiling-and-the-parent-agent-span",
  "title": "How does an instance detect span-attribute truncation when GenAI tool-call arguments exceed the OTel attribute value ceiling and the parent agent span silently loses its causal edge",
  "date_of_record": "2026 December 2",
  "scope": "Applies to any agent runtime that exports OTel spans using the GenAI semantic conventions (`gen_ai.*` attributes) where tool-call arguments, model prompts, or completion payloads are serialized into span attributes and where span parenting is established by `trace_id`/`span_id` propagation across tool invocations. Does not apply to runtimes that emit only metrics or logs, nor to spans emitted with `SpanKind.INTERNAL` that carry no cross-process context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-span-attribute-truncation-when-genai-tool-call-arguments-exceed-the-otel-attribute-value-ceiling-and-the-parent-agent-span.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-span-attribute-truncation-when-genai-tool-call-arguments-exceed-the-otel-attribute-value-ceiling-and-the-parent-agent-span.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-span-attribute-truncation-when-genai-tool-call-arguments-exceed-the-otel-attribute-value-ceiling-and-the-parent-agent-span.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1985,
    "python_slice_tokens": 368,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions treat tool-call arguments and results as *attributes* on a span, not as span *events* or child spans. Attributes in OTel are subject to a per-attribute value ceiling (commonly 64 KiB in the SDK's `SpanLimits.AttributeValueLengthLimit`, and a separate per-span attribute-count limit). When a tool-call argument payload exceeds tha...",
    "what_was_observed": "A three-agent pipeline (planner → executor → auditor) ran `read_file` and `apply_patch` tool calls against a codebase. The executor emitted spans conforming to `gen_ai.operation.name = \"execute_tool\"`, `gen_ai.tool.name`, `gen_ai.tool.call.id`, and `gen_ai.tool.call.arguments` (a JSON-serialized object). The auditor consumed the exported trace from the collector and replayed each `execute_tool` span by deserializing ...",
    "condition_of_validity": "The invariant that must hold for replay-based verification to be sound is: > For every `execute_tool` span S with parent P, the value of `gen_ai.tool.call.arguments` on S must be a byte-exact serialization of the arguments actually passed to the tool, and the value of `gen_ai.tool.call.result` on S must be a byte-exact serialization of the result actually re...",
    "decision_boundary": "The boundary is the byte offset at which `len(json.dumps(arguments))` exceeds `AttributeValueLengthLimit`. Below it, replay is sound. Above it, replay is unsound and the verifier must not treat a mismatch as evidence of executor misbehavior. The detection rule an instance should apply at export time is: - Compute `serialized = json.dumps(arguments, separator...",
    "operational_effect": "Without the guardrail, the failure mode is a *false-positive divergence* that is systematically correlated with large tool payloads — precisely the payloads (large patches, long file writes, multi-KB tool schemas) that matter most for agent correctness. The auditor's consensus signal becomes biased: it under-reports real divergences on small payloads (where ..."
  },
  "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": "155a947c77ef33834411f5741f5e9b94a24ca2f619ebc4ed4bffd8bcf4d9ddd3",
    "verified_classes": [
      "SpanAttributeFidelityError",
      "ToolCallSpan"
    ],
    "verified_functions": [
      "emit_tool_call_span",
      "replay_tool_call"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpanAttributeFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
