Environment variables
Core
| Variable | Maps to | Default |
|---|---|---|
STASO_API_KEY | st.init(api_key=...) | Required |
STASO_AGENT_NAME | st.init(agent_name=...) | Required |
STASO_BASE_URL | st.init(base_url=...) | https://api.staso.ai |
STASO_ENVIRONMENT | st.init(environment=...) | default |
STASO_WORKSPACE_SLUG | st.init(workspace_slug=...) | default |
STASO_SESSION_ID | Process-default trace grouping identifier. | Generated during st.init() |
STASO_DEBUG | Enables SDK debug logging when truthy. | Unset |
STASO_AUTO_PATCH | Set 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:
| Variable | Purpose |
|---|---|
STASO_API_KEY | Staso key with traces:write; add guard:evaluate when Guard is configured. |
OPENAI_API_KEY | Provider key used by the sample OpenAI client. |
STASO_AGENT_NAME | Process-level agent name, for example launch-quickstart-agent. |
STASO_ENVIRONMENT | Environment label shown with the trace, for example production. |
STASO_WORKSPACE_SLUG | Dashboard workspace that should receive the trace, for example default. |
STASO_SESSION_ID | Stable 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
| Variable | Category | Default |
|---|---|---|
STASO_CAPTURE_REQUEST | request | true |
STASO_CAPTURE_SYSTEM_PROMPT | system_prompt | true |
STASO_CAPTURE_TOOL_SCHEMA | tool_schema | true |
STASO_CAPTURE_TOOL_ARGUMENTS | tool_arguments | true |
STASO_CAPTURE_OUTPUT | output | true |
STASO_CAPTURE_MESSAGES | Deprecated 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
| Variable | Description | Default |
|---|---|---|
STASO_GUARD_ENABLED | Set to false to disable Guard checks in patched native provider integrations. | true |
STASO_GUARD_FAIL_CLOSED | Set to 1 or true to return block when no policy decision is available. | Unset, so checks fail open |
STASO_GUARD_TIMEOUT | Timeout for st.guard(...) HTTP requests, in seconds. | 10.0 |
STASO_GUARD_BATCH_TIMEOUT | Absolute deadline for one provider-response proposal batch, in seconds. | 10.0 |
STASO_GUARD_MAX_CONCURRENCY | Maximum 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.