{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-silent-truncation-of-genai-agent-spans-when-tool-call-attributes-exceed-semantic-convention-limits",
  "title": "How does an instance detect silent truncation of GenAI agent spans when tool-call attributes exceed semantic-convention limits",
  "date_of_record": "2026 November 14",
  "scope": "Applies to OpenTelemetry-instrumented agents emitting spans under the GenAI semantic conventions (`gen_ai.*`) where tool-call arguments, tool results, or prompt/response payloads are attached as span attributes. Does not apply to pure span-event or log-based GenAI telemetry, nor to backends that perform server-side attribute rewriting before storage.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-truncation-of-genai-agent-spans-when-tool-call-attributes-exceed-semantic-convention-limits.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-truncation-of-genai-agent-spans-when-tool-call-attributes-exceed-semantic-convention-limits.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-truncation-of-genai-agent-spans-when-tool-call-attributes-exceed-semantic-convention-limits.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1455,
    "python_slice_tokens": 317,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions define attribute *names* and *types* (e.g., `gen_ai.tool.name`, `gen_ai.tool.call.id`, `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`) but they do not, and cannot, enforce a *cardinality or byte-size invariant* on the values. The OpenTelemetry SDK, however, applies its own `SpanLimits.AttributeValueLengthLimit` (defa...",
    "what_was_observed": "In a production agent fleet emitting `execute_tool` child spans under `gen_ai.operation.name = \"execute_tool\"`, the following was observed across a 6-hour window: - A subset of tool spans (roughly 3.1%) exported with `gen_ai.tool.call.arguments` values ending mid-token, where the original argument was a JSON object containing a nested `payload` field exceeding 4 KB. - The `gen_ai.tool.call.id` attribute was present a...",
    "condition_of_validity": "The detection procedure below is valid only when: 1. The SDK is configured with a finite `AttributeValueLengthLimit` (or a backend enforces one). With the default of 0 (unlimited), truncation does not occur at the SDK, though a collector or backend may still truncate — in which case the check must run *after* the truncating hop. 2. The tool-call arguments ar...",
    "decision_boundary": "The operational decision is: **when a `gen_ai.tool.call.arguments` attribute fails to parse as JSON, or parses but is missing fields required by the tool's declared schema, treat the span as cost-attribution-unsafe and route it to a quarantine path rather than the billing join.** The boundary condition is *not* \"attribute length > threshold.\" A long but well...",
    "operational_effect": "Applying this boundary converts a silent 3.1% cost-attribution loss into an explicit, countable quarantine rate. In the observed fleet, quarantine routing surfaced the truncation within one billing cycle instead of the ~11 days it previously took to detect via aggregate cost drift. The downstream effect is that per-tool cost dashboards must be annotated with..."
  },
  "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": "29bda3bc8669207f1c9827c5a6324378f3cfec8e51dcd77e561d2e8ecf678856",
    "verified_classes": [
      "GenAISpanAttributeTruncationError"
    ],
    "verified_functions": [
      "assert_tool_call_arguments_intact"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "GenAISpanAttributeTruncationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
