Staso Docs
Reference

Environment variables

Core

VariableMaps toDefault
STASO_API_KEYst.init(api_key=...)Required
STASO_AGENT_NAMEst.init(agent_name=...)Required
STASO_BASE_URLst.init(base_url=...)https://api.staso.ai
STASO_ENVIRONMENTst.init(environment=...)default
STASO_WORKSPACE_SLUGst.init(workspace_slug=...)default
STASO_SESSION_IDProcess-default trace grouping identifier.Generated during st.init()
STASO_DEBUGEnables SDK debug logging when truthy.Unset
STASO_AUTO_PATCHSet to false to stop auto-patching installed OpenAI and Anthropic SDKs.true

STASO_AUTO_PATCH affects only the two native launch providers. Explicit @st.agent and @st.tool instrumentation is still required for the supported root and tool shape.

Launch quickstart

Use this minimum environment for the pinned OpenAI sample:

VariablePurpose
STASO_API_KEYStaso key with traces:write; add guard:evaluate when Guard is configured.
OPENAI_API_KEYProvider key used by the sample OpenAI client.
STASO_AGENT_NAMEProcess-level agent name, for example launch-quickstart-agent.
STASO_ENVIRONMENTEnvironment label shown with the trace, for example production.
STASO_WORKSPACE_SLUGDashboard workspace that should receive the trace, for example default.
STASO_SESSION_IDStable grouping identifier, set to launch-quickstart-first-trace for this sample.

Provider patch status is observed only after the backend stores a provider LLM span such as provider=openai or provider=anthropic. Install success, dashboard clicks, and local initialization are not enough evidence by themselves.

Capture policy

VariableCategoryDefault
STASO_CAPTURE_REQUESTrequesttrue
STASO_CAPTURE_SYSTEM_PROMPTsystem_prompttrue
STASO_CAPTURE_TOOL_SCHEMAtool_schematrue
STASO_CAPTURE_TOOL_ARGUMENTStool_argumentstrue
STASO_CAPTURE_OUTPUToutputtrue
STASO_CAPTURE_MESSAGESDeprecated fallback for request and system_prompt only.Unset

Values are case-insensitive and must be one of 1/0, true/false, yes/no, or on/off. Invalid configured values fail initialization instead of silently enabling capture.

The categories govern request content, standalone system prompts, tool/structured-response schemas, tool arguments, and assistant/tool/decorator output respectively.

Precedence for each category is the explicit st.init(capture_<category>=...) argument, the matching category variable, the deprecated messages control for request and system_prompt only, then true. See SDK setup for field classification and overlap rules.

Guard

VariableDescriptionDefault
STASO_GUARD_ENABLEDSet to false to disable Guard checks in patched native provider integrations.true
STASO_GUARD_FAIL_CLOSEDSet to 1 or true to return block when no policy decision is available.Unset, so checks fail open
STASO_GUARD_TIMEOUTTimeout for st.guard(...) HTTP requests, in seconds.10.0
STASO_GUARD_BATCH_TIMEOUTAbsolute deadline for one provider-response proposal batch, in seconds.10.0
STASO_GUARD_MAX_CONCURRENCYMaximum concurrent checks in one provider-response proposal batch, capped at 8.4

CLI-agent hooks

staso setup persists the five non-secret capture variables for an explicit selection. It stores the API key separately in Staso's user-only credential file and writes only STASO_CREDENTIAL_ID into hook configuration. An injected STASO_API_KEY remains available for CI and containers.