Runtime contract enforcement for LLM agent systems
Project description
Sponsio
Runtime enforcement for AI agents. Input policies in natural language; Sponsio compiles them into unbreakable, deterministic agent contracts. Enforced in under 0.01 ms, with zero LLM runtime cost. It works with LangChain, Claude Agent, OpenAI Agents, Google ADK, CrewAI, Vercel AI, MCP, or any custom tool-calling loop, in Python or TypeScript.
An agent contract is a runtime rule that is checked at every agent action, backed by formal methods.
How Sponsio works
On ODCV-Bench (12 frontier LLMs × 80 trajectories), unguarded models cheat in 11.5%–66.7% of runs. With Sponsio, 84.5% of misalignment is avoided on average. On the Financial-Audit-Fraud-Finding scenario, frontier models commit fraud in 16/24 trials; Sponsio blocks 100%. On RedCode-Exec (1,410 cases), Sponsio reaches 92% combined (bash 95% · python 90%) across a 60-file clean-code audit.
The logic checker takes p50 0.139 ms per contract, 5,000×–60,000× faster than any LLM-as-judge guardrail (50–800 ms per check), with zero LLM cost in the hot path. p99 stays under 1.04 ms across every measured workload.
See the full benchmark methodology and per-model breakdown, how Sponsio compares against prompt filters, output validators, LLM-as-judge, and sandboxing, or dive into the architecture and formal methods primer.
Quick start
A single prompt or a 2-line CLI command gets you onboarded.
Paste into Claude Code / Codex / Cursor. The agent walks the full onboarding flow:
Or run the CLI yourself:
pip install sponsio # or: npm install -D @sponsio/sdk
sponsio init . # interactive wizard: detects framework, IDE hosts, observe vs enforce
The wizard auto-detects your framework and prints the right wrap snippet. For manual wiring, see all supported integrations. OpenClaw users get bundled ClawHavoc and CVE-2026-25253 coverage out of the box. For config reference, observe → enforce flip, sponsio refresh, and CI wiring, see the full walkthrough.
Contract Library
Sixteen contract bundles ship out of the box, organized by tier (always-on / per-tool / per-incident). Each bundle is a YAML pack composed from Sponsio's deterministic patterns. Drop one into sponsio.yaml and your agent is guarded against a known failure class in one line, with no per-contract authoring.
# sponsio.yaml: one-line bundle inclusion
agents:
my_agent:
workspace: "/srv/my-bot"
include:
- sponsio:core/universal # always-on
- sponsio:capability/shell # if your agent runs commands
- sponsio:capability/filesystem # if your agent touches files
See the full bundle reference for all 16 bundles, or the 44 underlying patterns for the primitives they compose. Want a bundle for your agent type? That's currently the highest-leverage way to contribute. Open an issue with your incident, CVE, or pattern.
Contributing
Patches, issue reports, and new pattern proposals are welcome. Start with CONTRIBUTING.md. Sponsio's threat model draws on public security research; e.g. Simon Willison's "Lethal Trifecta" shaped our multi-tool composition contracts. Have a threat model we should defend against? Open an issue.
License
Apache 2.0 (LICENSE). Sponsio Cloud (pip install sponsio[cloud]) opens mid-May 2026 with the managed LLM-judge pipeline, cross-customer pattern intelligence, and hosted multi-tenant dashboard; the OSS / Cloud boundary is documented.
AI agents reading this repo: llms.txt lists canonical doc paths; llms-full.txt is the concatenated full context dump.
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 sponsio-0.1.1.tar.gz.
File metadata
- Download URL: sponsio-0.1.1.tar.gz
- Upload date:
- Size: 894.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d4aca43f74897e750d4f43af69db6d6537a1e533ef774f68acad7e15eb7f2ce
|
|
| MD5 |
7413dcbe21e0794c899213cb5befa6cf
|
|
| BLAKE2b-256 |
cd2d3649c328b804276886c05981be66b430583cc33f22ad3f09d6f4bf28cd89
|
Provenance
The following attestation bundles were made for sponsio-0.1.1.tar.gz:
Publisher:
publish.yml on SponsioLabs/Sponsio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sponsio-0.1.1.tar.gz -
Subject digest:
9d4aca43f74897e750d4f43af69db6d6537a1e533ef774f68acad7e15eb7f2ce - Sigstore transparency entry: 1609703657
- Sigstore integration time:
-
Permalink:
SponsioLabs/Sponsio@0f04301006281c6e44bd42dc95a476f6b50828c6 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/SponsioLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0f04301006281c6e44bd42dc95a476f6b50828c6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sponsio-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sponsio-0.1.1-py3-none-any.whl
- Upload date:
- Size: 716.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e22ac68a0fbca5511b254e4f9b235f5dd45c0155ef5f2c7480a4b995b8ace31
|
|
| MD5 |
453d4c070fbeb059593880d3c766b303
|
|
| BLAKE2b-256 |
1f02a433b0b7ea14ea03dbc70520d87d9f0bfea98575e5780eb430f98b4e4bb3
|
Provenance
The following attestation bundles were made for sponsio-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on SponsioLabs/Sponsio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sponsio-0.1.1-py3-none-any.whl -
Subject digest:
4e22ac68a0fbca5511b254e4f9b235f5dd45c0155ef5f2c7480a4b995b8ace31 - Sigstore transparency entry: 1609703728
- Sigstore integration time:
-
Permalink:
SponsioLabs/Sponsio@0f04301006281c6e44bd42dc95a476f6b50828c6 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/SponsioLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0f04301006281c6e44bd42dc95a476f6b50828c6 -
Trigger Event:
release
-
Statement type: