Open-source adaptive control plane for production AI agents.
AgentSpine is an embedded Python SDK that sits between your AI agents and the tools they use — enforcing policies, preventing duplicates, managing locks, scoring risk, and logging every action for full observability.
Features
- Policy Engine — Declarative rules that deny, allow, or require approval for agent actions
- Semantic Deduplication — Prevent agents from repeating the same action using embedding similarity
- Distributed Locks — Prevent two agents from modifying the same resource simultaneously
- Risk Scoring — Score every action on a 0–1 scale and route to fast-path, judiciary, or human approval
- Knowledge Graph — Track relationships between agents, actions, tools, and resources
- Credential Vault — Encrypted at-rest storage for API keys and OAuth tokens
- Event Timeline — Append-only audit log of every action and decision
- Rate Limiting & Circuit Breakers — Per-agent, per-tool, per-workflow limits
- Feature Flags — Enable only the subsystems you need; disable the rest for zero overhead
Quickstart
# Start infrastructure
docker compose up -d
# Install SDK
pip install agentspine[all]
import asyncio
from agentspine import AgentSpine
async def main():
spine = AgentSpine(workflow="demo")
async def local_echo(payload, context):
return {"echo": payload}
spine.register_tool("demo.echo", local_echo)
result = await spine.request_action(
agent="demo_agent",
action_type="demo.echo",
payload={"text": "Hello from AgentSpine!"},
idempotency_key="demo_001",
)
print(f"Status: {result.status}")
await spine.close()
asyncio.run(main())
If no local tool is registered for an action type, AgentSpine emits a normalized execution signal so an external worker or service can perform the real side effect and report the result back later.
Feature Flags
from agentspine import AgentSpine
from agentspine.features import FeatureFlags
# Full mode (default) — all features on
spine = AgentSpine(workflow="my_workflow")
# Standard — no KG or judiciary
spine = AgentSpine(workflow="my_workflow", features=FeatureFlags.standard())
# Minimal — policy + events only
spine = AgentSpine(workflow="my_workflow", features=FeatureFlags.minimal())
Architecture
Agent → AgentSpine SDK → Pipeline → Tool
│
├── Policy Engine (allow/deny/approve)
├── Semantic Dedupe (pgvector)
├── Risk Scorer (0-1 score)
├── Knowledge Graph (Postgres)
├── Distributed Locks (Redis)
└── Event Timeline (append-only)
Requirements
- Python 3.11+
- PostgreSQL 16+ (with pgvector extension)
- Redis 7+ (optional, for locks/rate-limiting/circuit-breakers)
Documentation
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
Apache 2.0 — See LICENSE.
Release files for agentspine 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentspine-0.1.7.tar.gz | 2.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentspine-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.5 MB
Release files / agentspine-0.1.7.tar.gz
| Download URL | agentspine-0.1.7.tar.gz |
|---|---|
| Size | 2.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59a33a3d09fdde5890438710697ad0087b5f5d4b449ba63c5aeb16862e06c656
|
|
BLAKE2b-256 checksum How to use checksums |
74915c14319ec18929e28f84eb41d2a6ef28f0eb0f4e2aa7ba7568b52f6f26b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 2, 2026.
Transparency logRelease files / agentspine-0.1.7-py3-none-any.whl
| Download URL | agentspine-0.1.7-py3-none-any.whl |
|---|---|
| Size | 50.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf403e16ad503efdf73793f7c1dd02cce39955a8df7c7672adb5adc03dfd39a4
|
|
BLAKE2b-256 checksum How to use checksums |
772735a600edd1bb26d2df3c1f66c50c3ca77c226da4aec9e9e212ce3797b3fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 2, 2026.
Transparency log