Open-source adaptive control plane for production AI agents
Project description
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.
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 agentspine-0.1.7.tar.gz.
File metadata
- Download URL: agentspine-0.1.7.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59a33a3d09fdde5890438710697ad0087b5f5d4b449ba63c5aeb16862e06c656
|
|
| MD5 |
078e59829dc065bcddae155f03481e83
|
|
| BLAKE2b-256 |
74915c14319ec18929e28f84eb41d2a6ef28f0eb0f4e2aa7ba7568b52f6f26b9
|
Provenance
The following attestation bundles were made for agentspine-0.1.7.tar.gz:
Publisher:
publish.yml on Hrushi11/AgentSpine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentspine-0.1.7.tar.gz -
Subject digest:
59a33a3d09fdde5890438710697ad0087b5f5d4b449ba63c5aeb16862e06c656 - Sigstore transparency entry: 1429223178
- Sigstore integration time:
-
Permalink:
Hrushi11/AgentSpine@68986f8fa931fa79eea963cc8956ee05a12bb5b8 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/Hrushi11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@68986f8fa931fa79eea963cc8956ee05a12bb5b8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agentspine-0.1.7-py3-none-any.whl.
File metadata
- Download URL: agentspine-0.1.7-py3-none-any.whl
- Upload date:
- Size: 50.7 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 |
cf403e16ad503efdf73793f7c1dd02cce39955a8df7c7672adb5adc03dfd39a4
|
|
| MD5 |
49dfd57366dc70d09dea1fb490da5cc5
|
|
| BLAKE2b-256 |
772735a600edd1bb26d2df3c1f66c50c3ca77c226da4aec9e9e212ce3797b3fc
|
Provenance
The following attestation bundles were made for agentspine-0.1.7-py3-none-any.whl:
Publisher:
publish.yml on Hrushi11/AgentSpine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentspine-0.1.7-py3-none-any.whl -
Subject digest:
cf403e16ad503efdf73793f7c1dd02cce39955a8df7c7672adb5adc03dfd39a4 - Sigstore transparency entry: 1429223268
- Sigstore integration time:
-
Permalink:
Hrushi11/AgentSpine@68986f8fa931fa79eea963cc8956ee05a12bb5b8 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/Hrushi11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@68986f8fa931fa79eea963cc8956ee05a12bb5b8 -
Trigger Event:
push
-
Statement type: