{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-bound-opentelemetry-genai-span-attribute-cardinality-when-tool-call-arguments-are-attacker-influenced",
  "title": "Where must an instance bound OpenTelemetry GenAI span attribute cardinality when tool-call arguments are attacker-influenced?",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent runtime that emits `genai.*` spans per the OpenTelemetry GenAI semantic conventions (notably `genai.tool.call.arguments`, `genai.tool.call.result`, and `genai.prompt`/`genai.completion` event bodies) where argument or result payloads are derived from model output, retrieved documents, or remote tool responses. Does not apply to fixed-schema, developer-authored attribute values (model name, operation name, system fingerprint) which are cardinality-bounded by construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-opentelemetry-genai-span-attribute-cardinality-when-tool-call-arguments-are-attacker-influenced.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-opentelemetry-genai-span-attribute-cardinality-when-tool-call-arguments-are-attacker-influenced.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-opentelemetry-genai-span-attribute-cardinality-when-tool-call-arguments-are-attacker-influenced.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1935,
    "python_slice_tokens": 264,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions treat `genai.tool.call.arguments` and `genai.tool.call.result` as *content* attributes: free-form strings capturing the exact bytes the agent passed to and received from a tool. This is correct for debugging and replay. It is catastrophic as a **span-attribute** choice, because span attributes are subject to backend index cardi...",
    "what_was_observed": "Trace from a two-step tool loop, captured with the OTel Python SDK and an OTLP/HTTP exporter, backend enforcing a 2048-byte per-attribute-value cap with head-preserving truncation (the common default; some backends are tail-preserving, which is worse—see below). 1. Agent step 1 emits a span `execute_tool genai.tool.name=write_file` with `genai.tool.call.arguments` = `{\"path\": \"/sandbox/out/report.md\", \"content\": \"<14...",
    "condition_of_validity": "The \"attribute faithfully represents the call\" invariant holds **only** when all of the following are true: - The serialized arguments and result fit under the effective per-attribute cap *after* the agent's serialization, including any escaping (JSON string escaping can inflate a payload by up to ~6× for control-heavy content; a 1 KB document with many newl...",
    "decision_boundary": "The boundary is not \"payload size < cap.\" It is **whether the agent can prove the attribute it emitted is the attribute the consumer will read.** Concretely: - **Emit as span attribute** only when the serialized payload is below a *client-enforced* cap that is strictly less than the backend cap (leave headroom for escaping inflation), and the agent attaches ...",
    "operational_effect": "With the guardrail (client cap + truncation flag + content hash + stable call id), three failure classes are bounded: 1. **Silent reconstruction divergence** is converted to an explicit `truncated=true` + hash mismatch, which replay tooling can refuse to \"reproduce\" rather than falsely matching. 2. **Retry collapse** is bounded by the stable `genai.tool.call..."
  },
  "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": "81e8ff0e9f50d940f71f56403458e300a0ecbc55601678eacdd9ba10ba3c1ac3",
    "verified_classes": [
      "SpanAttributeIntegrityError",
      "ToolCallSpanPayload"
    ],
    "verified_functions": [
      "canonical_bytes",
      "build_span_attributes",
      "verify_replay_matches_span"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpanAttributeIntegrityError"
    ],
    "sample_fail_closed_invariants": [
      "truncated attribute lacks blob reference; content is unrecoverable"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
