Staso Docs
Reference

Data model

The supported launch path produces an explicit agent root, decorated tool spans, and native provider LLM spans.

Span kinds

ValueLaunch use
agentAgent entry point created by @st.agent.
toolActual Python tool execution created by @st.tool.
llmOpenAI Chat Completions or Anthropic Messages call.

Other enum values remain available for compatibility but are outside the supported launch configuration.

Statuses

ValueMeaning
okThe observed operation completed.
errorThe observed operation raised an exception.
timeoutA timeout status reported by the observed path.

Core span fields

FieldTypeDescription
namestrSpan label.
kindSpanKindagent, tool, or llm on the launch path.
statusSpanStatusok, error, or timeout.
trace_iduuidIdentifier shared by spans in one trace.
span_iduuidIdentifier for this span.
parent_span_iduuid | nullParent identifier, or null for the root.
modelstrProvider model name when reported.
input_tokensintProvider-reported input usage when present.
output_tokensintProvider-reported output usage when present.
total_tokensintProvider-reported total usage when present.
inputdictCaptured request data for the instrumented path.
outputdictCaptured response data for the instrumented path.
metadatadictProvider and SDK metadata.
agent_namestrName set by @st.agent or st.init.
error_messagestr | nullRecorded exception message when present.
captureCaptureStateMapComplete per-span capture outcome sent by this SDK.

Capture-state map

Every span emitted by this SDK includes all five keys: request, system_prompt, tool_schema, tool_arguments, and output.

{
  "capture": {
    "request": "captured",
    "system_prompt": "suppressed",
    "tool_schema": "captured",
    "tool_arguments": "suppressed",
    "output": "captured"
  }
}

The SDK emits only captured or suppressed. Suppression means the governed value was removed before SDK payload serialization. The backend can change captured to the storage-only state redacted after sanitizing enabled content. This SDK never emits redacted.

Older clients may omit the complete map; the backend treats that legacy payload as all captured before its sanitizer. A partial map, unknown category or state, or client-supplied redacted rejects the complete ingest request.

Common provider metadata

Native integrations may record request settings such as temperature, max_tokens, and tool_choice; response values such as stop_reason, response_id, and provider; and provider-specific cache or reasoning token counts when those values are returned.

Guard metadata

KeyType
guard_actionstr, either ordinary allow or enforced block
guard_reasonstr
guard_latency_msfloat
guard_decision_idstr, the unique decision identity
guard_decision_sourcestr, the decision origin
guard_decision_availablebool, whether Guard returned a policy decision
guard_evaluation_statusevaluated, skipped, abstained, or unavailable
guard_failure_kindStable failure category or None
guard_failure_modefail_open or fail_closed
guard_retryablebool, whether a later retry can reasonably succeed

In audit mode, the top-level decision remains allow. A failed audit rule and a guard:would-block:<tool> child span record what would have been blocked. When guard_decision_available is false, the effective action follows guard_failure_mode; use guard_failure_kind instead of parsing reason prose.

Skipped and abstained checks create no violation span. Unavailable checks use guard:unavailable:<tool> and remain distinct from policy findings. Repeated observations of a genuine tool invocation reuse the decision and corresponding Guard span identity. Separate invocations with identical arguments remain separate decisions.