Staso Docs
Reference

Every STASO_* environment variable read by the SDK, CLI, and integrations.

Kwargs passed directly to st.init(...) always override environment variables. The SDK reads env vars at init time — changing them after init has no effect.

All variables

NameDefaultUsed byPurpose
STASO_API_KEY— (required)st.init, st.guard, all integrationsWorkspace or org API key. Sent as the X-API-Key header.
STASO_AGENT_NAME— (required)st.init, st.guardLogical agent name. Shown in the dashboard and used to derive agent_id.
STASO_BASE_URLhttps://api.staso.aist.init, st.guardStaso backend URL. Override for self-hosted installs.
STASO_ENVIRONMENTdefaultst.init, st.guardLogical environment tag — e.g. prod, staging, dev.
STASO_WORKSPACE_SLUGdefaultst.init, st.guardWorkspace slug. Required when the API key is workspace-scoped.
STASO_DEBUGfalsest.initSet to 1 or true for verbose SDK logging.
STASO_GUARD_ENABLEDtrueIntegrations, hook subprocessesSet to false to short-circuit every guard check to allow inside patch_openai / patch_anthropic and the Claude Code / Codex hooks.
STASO_GUARD_FAIL_CLOSEDfalsest.guardWhen true, transport failures return action="block" instead of "allow". Use this only after you trust your network and backend reachability.
STASO_GUARD_TIMEOUT10.0st.guard, hook subprocessesHTTP timeout in seconds for each guard evaluation call.
STASO_AUTO_SYNCunsetstaso sync, CLI hook installersSet to 1 to auto-run config sync on SessionStart hooks for Claude Code and Codex.
STASO_VCS_COMMIT_SHAauto-detectedst.init (git capture)Override the captured commit SHA. Use this in CI where .git may be shallow or absent.
STASO_VCS_BRANCHauto-detectedst.init (git capture)Override the captured branch name.
STASO_VCS_REPO_URLauto-detectedst.init (git capture)Override the captured repository URL.

Usage with .env

# .env
STASO_API_KEY=ak_live_...
STASO_AGENT_NAME=support-bot
STASO_ENVIRONMENT=prod
STASO_WORKSPACE_SLUG=default
import os
import staso as st
from dotenv import load_dotenv

load_dotenv()
st.init()  # picks up STASO_API_KEY and STASO_AGENT_NAME

Usage in CI

GitHub Actions example — inject VCS metadata at deploy time so runtime doesn't need a git checkout:

- name: Deploy
  env:
    STASO_API_KEY: ${{ secrets.STASO_API_KEY }}
    STASO_AGENT_NAME: support-bot
    STASO_ENVIRONMENT: prod
    STASO_VCS_COMMIT_SHA: ${{ github.sha }}
    STASO_VCS_BRANCH: ${{ github.ref_name }}
    STASO_VCS_REPO_URL: ${{ github.server_url }}/${{ github.repository }}
  run: python -m my_agent