Runtime security middleware for A2A agents
Project description
CapiscIO SDK (Python)
Enforcement-First Security for A2A Agents.
CapiscIO is the "Customs Officer" for your AI Agent. It provides military-grade Identity and Integrity enforcement for the Agent-to-Agent (A2A) Protocol with zero configuration.
🚀 The 60-Second Upgrade
Turn any FastAPI application into a Verified A2A Agent in 3 lines of code.
from fastapi import FastAPI
from capiscio_sdk.simple_guard import SimpleGuard
from capiscio_sdk.integrations.fastapi import CapiscioMiddleware
# 1. Initialize Guard (Auto-generates keys in dev_mode)
guard = SimpleGuard(dev_mode=True)
app = FastAPI()
# 2. Add Enforcement Middleware
app.add_middleware(CapiscioMiddleware, guard=guard)
@app.post("/agent/task")
async def handle_task(request: Request):
# 🔒 Only reachable if Identity + Integrity are verified
caller = request.state.agent_id
return {"status": "accepted", "verified_caller": caller}
🛡️ What You Get (Out of the Box)
-
Zero-Config Identity:
- Auto-generates Ed25519 keys and
agent-card.jsonon first run. - No manual key management required for development.
- Auto-generates Ed25519 keys and
-
Payload Integrity:
- Enforces SHA-256 Body Hash (
bh) verification. - Blocks tampered payloads instantly (returns
403 Forbidden).
- Enforces SHA-256 Body Hash (
-
Replay Protection:
- Enforces strict 60-second token expiration (
exp). - Prevents replay attacks and ensures freshness.
- Enforces strict 60-second token expiration (
-
Performance Telemetry:
- Adds
<1msoverhead. - Includes
Server-Timingheaders for transparent monitoring.
- Adds
Installation
pip install capiscio-sdk
How It Works
1. The Handshake
CapiscIO enforces the A2A Trust Protocol:
- Sender: Signs the request body (JWS + Body Hash).
- Receiver: Verifies the signature and re-hashes the body to ensure integrity.
2. The "Customs Officer"
The SimpleGuard acts as a local authority. It manages your agent's "Passport" (Agent Card) and verifies the "Visas" (Tokens) of incoming requests.
3. Telemetry
Every response includes a Server-Timing header showing exactly how fast the verification was:
Server-Timing: capiscio-auth;dur=0.618;desc="CapiscIO Verification"
Documentation
License
Apache License 2.0 - see LICENSE for details.
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 capiscio_sdk-0.3.0.tar.gz.
File metadata
- Download URL: capiscio_sdk-0.3.0.tar.gz
- Upload date:
- Size: 134.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7d95eee387c4a99559870cb4fbfff678bf493377981e8e85ff5fb721e55b8bd
|
|
| MD5 |
bed8c2a0a129c46f67e96e711fb40510
|
|
| BLAKE2b-256 |
50b8ae6ccdd072e3e8db9ad18792fd89a6b1328ba499aed2e38d7a7ce6e7f38d
|
Provenance
The following attestation bundles were made for capiscio_sdk-0.3.0.tar.gz:
Publisher:
publish.yml on capiscio/capiscio-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
capiscio_sdk-0.3.0.tar.gz -
Subject digest:
a7d95eee387c4a99559870cb4fbfff678bf493377981e8e85ff5fb721e55b8bd - Sigstore transparency entry: 716730151
- Sigstore integration time:
-
Permalink:
capiscio/capiscio-sdk-python@447a8a091c06479309bcc3a4090f0b8e13c1293a -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/capiscio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@447a8a091c06479309bcc3a4090f0b8e13c1293a -
Trigger Event:
push
-
Statement type:
File details
Details for the file capiscio_sdk-0.3.0-py3-none-any.whl.
File metadata
- Download URL: capiscio_sdk-0.3.0-py3-none-any.whl
- Upload date:
- Size: 50.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0e817eb650d2fac225f1077ccc4be62b356c732343d372524d868a28869d28f
|
|
| MD5 |
fde540854f87354a5e4c9efe549e2d86
|
|
| BLAKE2b-256 |
6e1e11e5a90a02e94e947321053bcc592a0ed17e1d9fd8e0e4fb31d82acdaf86
|
Provenance
The following attestation bundles were made for capiscio_sdk-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on capiscio/capiscio-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
capiscio_sdk-0.3.0-py3-none-any.whl -
Subject digest:
a0e817eb650d2fac225f1077ccc4be62b356c732343d372524d868a28869d28f - Sigstore transparency entry: 716730176
- Sigstore integration time:
-
Permalink:
capiscio/capiscio-sdk-python@447a8a091c06479309bcc3a4090f0b8e13c1293a -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/capiscio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@447a8a091c06479309bcc3a4090f0b8e13c1293a -
Trigger Event:
push
-
Statement type: