The safety layer for the AGI era. Runtime guardrails for autonomous AI agents. Loop detection, cost limits, and telemetry.
pip install steerplane==1.1.0 Copy PIP instructions
Cost limits · Loop detection · Policy engine · Human approval callbacks · SSE streaming gateway · CLI · Docker · 4 framework integrations
pip install steerplane # Core SDK pip install steerplane[cli] # + CLI tool pip install steerplane[all] # + CLI + YAML config + LangChain Quick Start Option 1: Gateway Mode (Zero Code Changes) Point your existing OpenAI client to SteerPlane. Every LLM call is automatically monitored, rate-limited, and cost-tracked — including SSE streaming with mid-stream cost enforcement.
import openai client = openai.OpenAI( base_url="http://localhost:8000/gateway/v1", api_key="sk_sp_...", # SteerPlane API key default_headers={"X-LLM-API-Key": "sk-..."} ) # All calls — including stream=True — are now guarded. response = client.chat.completions.create( model="gpt-4o-mini", messages=[{"role": "user", "content": "Hello"}], stream=True # SSE streaming with real-time cost tracking ) Option 2: Decorator Mode from steerplane import guard @guard( agent_name="support_bot", max_cost_usd=10.00, max_steps=50, denied_actions=["DROP TABLE*", "rm -rf *"], rate_limits=[{"pattern": "send_email", "max_count": 5, "window_seconds": 60}], require_approval=["execute_trade*"] ) def run_agent(): agent.run() Option 3: Context Manager from steerplane import SteerPlane sp = SteerPlane(agent_id="my_bot") with sp.run(max_cost_usd=10.0, max_steps=50) as run: run.log_step("query_db", tokens=380, cost=0.002, latency_ms=45) run.log_step("generate_response", tokens=1240, cost=0.008, latency_ms=320) What's New in v1.1.0 detect_loops now works. The docs have shown @guard(detect_loops=True) for a long time, but the parameter did not exist. It is accepted by @guard, SteerPlane.run(), RunManager and all four framework integrations, and in .steerplane.yml. Set it to False to stop loop detection from ending a run; cost, step, runtime and policy limits still apply. Self-hosting for several teams: see docs/hosted-deployment.md in the repository. What's New in v0.4.0 🌊 SSE Streaming Gateway The AI Gateway now supports Server-Sent Events (SSE) streaming. It accumulates token costs per chunk in real time and can terminate a stream mid-response by injecting a steerplane_enforcement event when the cost ceiling is breached — without corrupting the SSE protocol.
steerplane status # Check API health steerplane runs list # List recent runs steerplane runs inspect # Inspect a run steerplane runs kill # Mark a run as terminated steerplane keys list # List API keys steerplane keys create # Create new gateway key steerplane logs --tail # Live log stream 🐳 Docker Compose Full 3-service stack in one command (for one server shared by several teams, use docker-compose.hosted.yml):
docker compose up -d # API (8000) + Dashboard (3000) + PostgreSQL (5432) 📄 Config File (.steerplane.yml) Project-level defaults auto-discovered from your working directory:
api_url: http://localhost:8000 agent_name: my_bot defaults: max_cost_usd: 10.0 max_steps: 100 detect_loops: true 🔌 Framework Integrations Native support for 4 frameworks — all use lazy imports, so framework dependencies are only required when used:
from steerplane.integrations import SteerPlaneLangChainHandler handler = SteerPlaneLangChainHandler(agent_name="lc_bot", max_cost_usd=5.0) llm = ChatOpenAI(model="gpt-4o-mini", callbacks=[handler]) OpenAI Agents SDK:
ai agents guard safety monitoring telemetry llm steerplane
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.




