Staso – Agent Reliability on Autopilot | Python SDK
Project description
Staso Python SDK
Observe, guard, and control your AI agents. Every tool call, LLM interaction, token count, latency, and error -- on your Staso dashboard. Guard agent actions before they execute -- block dangerous operations, modify risky inputs, escalate to humans.
pip install staso
import staso as st
from staso import guard
st.init(api_key="ak_...", agent_name="my-agent")
@st.agent(name="support-agent")
def handle_request(message: str) -> str:
context = search_kb(message)
return call_llm(context, message)
@st.tool(name="search_kb")
def search_kb(query: str) -> str:
return db.search(query)
@st.tool(name="process_refund")
def process_refund(customer_id: str, amount: float) -> str:
result = guard(tool_name="process_refund", tool_input={"amount": amount})
if result.action == "block":
return f"Blocked: {result.reason}"
return do_refund(customer_id, amount)
with st.conversation("conversation-123"):
handle_request("How do I reset my password?")
st.shutdown()
Open your dashboard. Full execution tree -- agents, tools, LLM calls, tokens, timing, errors. Guard evaluations on every tool call.
Auto-Instrument LLM Calls
pip install "staso[anthropic]" # or "staso[openai]" or "staso[all]"
st.integrations.patch_anthropic()
# every Anthropic SDK call is now traced automatically -- tokens, model, latency, errors
st.integrations.patch_openai()
# every OpenAI SDK call is now traced automatically
Both sync and async clients. Streaming fully supported.
Guard Agent Actions
Evaluate tool calls before they execute. Four actions: allow, block, modify, escalate.
from staso import guard
result = guard(tool_name="delete_records", tool_input={"table": "users"})
if result.action == "block":
raise PermissionError(result.reason)
Guards run automatically in Claude Code and Codex sessions -- blocking dangerous tools and modifying risky inputs in real-time. For LLM SDK integrations (Anthropic, OpenAI), guard evaluations are recorded on span metadata.
CLI Agent Integrations
Trace Claude Code (39 tool types) and Codex (32 tool types) sessions automatically. Every tool call renders as a human-readable card on your dashboard -- diffs, terminal output, agent trees, plan steps. Not raw JSON. Guards evaluate each tool before execution.
Run the interactive wizard:
staso setup
Or pass flags directly:
staso setup --target claude-code --api-key ak_... --workspace my-workspace
staso setup --target codex --api-key ak_... --workspace my-workspace
CLI Commands
staso setup # interactive setup wizard
staso setup --target claude-code --api-key ak_... # scripted setup
staso status # show what's configured
staso sync # sync hooks after upgrade
staso update # upgrade package + sync
staso uninstall --target codex # remove hooks, clean up
staso version # show version info
Docs
- Quickstart -- 5 minutes to first trace
- Guards -- evaluate, block, modify, and escalate tool calls
- Tracing --
@agent,@tool,@trace,st.span() - Conversations -- group traces by conversation
- Integrations -- Anthropic, OpenAI, Claude Code, Codex
- Configuration -- all options and env vars
- Troubleshooting -- common issues
Python 3.11+ · Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file staso-0.1.41.tar.gz.
File metadata
- Download URL: staso-0.1.41.tar.gz
- Upload date:
- Size: 369.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
189cce5b6abf1dd11a240b1e8518dcb2579a4204792191bfe3c46b40d7d82626
|
|
| MD5 |
129f2f8795ef384370b2ee7c6434cebf
|
|
| BLAKE2b-256 |
b1ae3cc305ce0cf4ec5ed719fb31b5c15ba56992dd9d069a88cf477ce56a665e
|
Provenance
The following attestation bundles were made for staso-0.1.41.tar.gz:
Publisher:
build_deploy_pip_registry.yml on StasoAI/sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
staso-0.1.41.tar.gz -
Subject digest:
189cce5b6abf1dd11a240b1e8518dcb2579a4204792191bfe3c46b40d7d82626 - Sigstore transparency entry: 1410984612
- Sigstore integration time:
-
Permalink:
StasoAI/sdk-python@1a9ec64156d5c3c4c4fe6beff313d67f8c168bce -
Branch / Tag:
refs/tags/v0.1.41 - Owner: https://github.com/StasoAI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_deploy_pip_registry.yml@1a9ec64156d5c3c4c4fe6beff313d67f8c168bce -
Trigger Event:
push
-
Statement type:
File details
Details for the file staso-0.1.41-py3-none-any.whl.
File metadata
- Download URL: staso-0.1.41-py3-none-any.whl
- Upload date:
- Size: 118.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5c8a3acbbcfd5e3040316a894252480a92c939778c09061cd64e505efe404f6
|
|
| MD5 |
730a20bd2c450c8795cb60d185e34c1f
|
|
| BLAKE2b-256 |
490d595eedc94f3582a7a616f29fde9d2359d0204f5b91e6c56e231c11a1adc4
|
Provenance
The following attestation bundles were made for staso-0.1.41-py3-none-any.whl:
Publisher:
build_deploy_pip_registry.yml on StasoAI/sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
staso-0.1.41-py3-none-any.whl -
Subject digest:
f5c8a3acbbcfd5e3040316a894252480a92c939778c09061cd64e505efe404f6 - Sigstore transparency entry: 1410984710
- Sigstore integration time:
-
Permalink:
StasoAI/sdk-python@1a9ec64156d5c3c4c4fe6beff313d67f8c168bce -
Branch / Tag:
refs/tags/v0.1.41 - Owner: https://github.com/StasoAI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_deploy_pip_registry.yml@1a9ec64156d5c3c4c4fe6beff313d67f8c168bce -
Trigger Event:
push
-
Statement type: