Skip to main content

AgentSeal — Reference Implementation of Verifiable Agent Attestation (VAA v1.0)

CI PyPI License: Apache 2.0 Spec: VAA v1.0 IETF Draft: WIMSE/RATS/SCITT MCP SEP Python 3.10+ CI

AgentSeal is an open-source cryptographic Non-Human Identity (NHI), pre-execution behavioral attestation, multi-agent delegation, and tamper-evident Merkle transparency framework for autonomous AI workloads, implementing the Verifiable Agent Attestation (VAA v1.0) Standard.

Traditional workload identity protocols authenticate which container or binary is running, but remain blind when an authenticated LLM agent is hijacked mid-session via indirect prompt injection, Model Context Protocol (MCP) tool poisoning ("rug-pulls"), multi-agent scope escalation, or confused-deputy attacks. AgentSeal closes this semantic security gap by intercepting every tool call before execution, verifying RFC 7800 Proof-of-Possession signatures over RFC 8785 Canonical JSON (JCS), enforcing deterministic & tiered fail-closed LLM semantic guardrails, and anchoring countersigned receipts in an RFC 9162 Merkle Transparency Log.


Core Capabilities

  • RFC 7800 Proof-of-Possession Workload Identity (agentseal.ca):
    • Issues EdDSA (Ed25519) signed vaa+jwt SVIDs binding SPIFFE IDs (spiffe://<domain>/agent/<id>) to RFC 8037 OKP JWKs and RFC 7638 thumbprints (cnf.jkt).
    • Prevents Sybil key-overwrite attacks via Proof-of-Possession enrollment (vaa-enroll-v1), one-time bootstrap tickets, dual-signature key rotation (vaa-rotate-v1), and signed revocation lists (vaa-crl+jws).
  • Pre-Execution Policy Enforcement & Tiered Semantic Attestation (agentseal.runtime, agentseal.attestation):
    • Tier-1 Synchronous Fast Path: Verifies vaa+jwt + Ed25519 intent signature over RFC 8785 JCS (vaa-intent+jws), sequence monotonicity, path/SQL/numeric/rate-limit BehavioralManifest rules, and multi-signal structural injection analysis (with URL, Unicode NFKC, and Base64 smuggling normalization) before any tool side effect executes.
    • Tier-2 Conditional Semantic Judge: Supports both 100% offline local Ollama models (OllamaRiskClassifier, e.g., qwen2.5 / llama3.1 with zero cloud API keys) and Google Gemini (GeminiRiskClassifier, fail_mode="closed") on high-risk tools or ambiguous Tier-1 anomalies.
  • Out-of-Process HTTP Attestation Service (agentseal.server):
    • Stdlib-only VAAHttpServer (ThreadingHTTPServer), RemoteAttestationClient, and RemoteSealedRuntime enforcing a strict OS process/network boundary (/v1/health, /v1/tickets, /v1/enroll, /v1/rotate, /v1/attest/pre-exec, /v1/log/sth, /v1/log/verify-proof, /v1/crl) so a compromised agent worker never holds CA, Verifier, or Merkle signing keys.
  • Multi-Agent Delegation Chains & Signed A2A Agent Cards (agentseal.delegation):
    • Ed25519 + JCS signed AgentCard (vaa-agent-card+jws) cross-verified against CA vaa+jwt SVIDs, and RFC 8693 / WIMSE-aligned DelegationToken, DelegationChainVerifier, and DelegatedExecutionGate (vaa-delegation+jws) enforcing monotonic scope/constraint/TTL attenuation, cycle/collusion detection, upstream Verifier ALLOW Merkle lineage, and real-time cascading revocation across Planner -> Coder -> Executor workflows.
  • Model Context Protocol (MCP) Security Gateway (agentseal.mcp_gateway):
    • Drop-in JSON-RPC 2.0 proxy (urn:ietf:params:vaa:mcp-attestation:1.0) enforcing params._meta.vaa signed intents on tools/call and pinning tools/list canonical JCS hashes at initialize to block MCP tool-poisoning / rug-pull attacks (-32004).
  • RFC 9162 Merkle Transparency Log & GDPR Privacy (agentseal.transparency, agentseal.integrations):
    • Domain-separated (0x00 leaf / 0x01 internal) SHA-256 binary Merkle tree with Signed Tree Heads (vaa-sth+jws), $O(\log N)$ inclusion & consistency proofs, VAAToolGuard (LangChain/LangGraph/callable hooks), VAAOpenTelemetryExporter (gen_ai.vaa.* spans), and VAAPrivacyAuditor (128-bit salted SHA-256 PII commitments).

Installation

# Install from PyPI (imports as `import agentseal` and installs the `agentseal` CLI)
pip install agentseal-vaa

# Or editable local installation with test/benchmark extras
pip install -e ".[dev]"

(Requires only cryptography>=41.0.0 at runtime; HTTP attestation server, MCP gateway, OpenTelemetry exporter, and live Gemini v1beta judge use Python's standard library with zero framework bloat.)


Quickstart

1. In-Process Python SDK (@runtime.seal_tool Pre-Execution Gate)

from agentseal import Agent, BehavioralManifest, RiskTier, SealedAgentRuntime, ToolConstraint

manifest = BehavioralManifest(
    allowed_tools={"query_customer_db"},
    tool_constraints={
        "query_customer_db": ToolConstraint(risk_tier=RiskTier.LOW, read_only_sql=True),
    },
)
runtime = SealedAgentRuntime(manifest=manifest)

@runtime.seal_tool(risk_tier=RiskTier.LOW, constraint=manifest.tool_constraints["query_customer_db"])
def query_customer_db(query: str) -> str:
    """Executes a read-only customer lookup."""
    return f"Rows for: {query}"

agent = Agent("billing-triage-agent", system_prompt="Assist billing support safely.")
runtime.enroll_agent(agent, pin_registry=True, pin_system_prompt=True)

# 1. Compliant call -> executes & anchors countersigned receipt in RFC 9162 Merkle tree
res = query_customer_db(agent=agent, query="SELECT name, plan FROM customers WHERE id = 42")

# 2. Prompt-injected destructive SQL -> blocked PRE-EXECUTION (zero side effects!)
query_customer_db(agent=agent, query="SELECT 1; DROP TABLE customers;")

2. Out-of-Process HTTP Attestation Server (VAAHttpServer & RemoteSealedRuntime)

from agentseal import Agent, BehavioralManifest, RemoteSealedRuntime, VAAHttpServer

server = VAAHttpServer(
    host="127.0.0.1",
    port=0,
    manifest=BehavioralManifest(allowed_tools={"fetch_invoice"}),
)
server.start_background()

remote_rt = RemoteSealedRuntime(server.base_url)

@remote_rt.seal_tool()
def fetch_invoice(invoice_id: str) -> dict:
    return {"invoice_id": invoice_id, "status": "paid"}

worker = Agent("remote-billing-worker")
remote_rt.enroll_agent(worker, pin_registry=True)
result = fetch_invoice(agent=worker, invoice_id="INV-2026-001")
server.shutdown()

3. Multi-Agent Scope-Attenuated Delegation (Planner -> Coder -> Executor)

from agentseal import Agent, BehavioralManifest, DelegatedExecutionGate, DelegationToken, SealedAgentRuntime

runtime = SealedAgentRuntime(manifest=BehavioralManifest(allowed_tools={"plan_task", "read_repo", "run_linter"}))
runtime.register_tool(lambda target: f"linted:{target}", name="run_linter")
gate = DelegatedExecutionGate(runtime=runtime, require_upstream_receipt=False)

planner, executor = Agent("planner"), Agent("executor")
planner_svid, _ = gate.enroll_agent(planner, scopes=["read_repo", "run_linter"], capabilities=["plan"])
exec_svid, _ = gate.enroll_agent(executor, scopes=["run_linter"], capabilities=["lint"])

hop = DelegationToken.issue(
    delegator=planner,
    delegate=executor,
    granted_scopes=["run_linter"],  # Monotonically attenuated subset
    max_depth=2,
)
delegated_res = gate.execute_delegated_tool(
    executor, "run_linter", {"target": "src/"}, [hop], root_svid=planner_svid
)

4. MCP Gateway (MCPAttestationGateway) & Framework Hooks (VAAToolGuard)

from agentseal import Agent, MCPAttestationGateway, MCPSealedClient, SealedAgentRuntime, VAAOpenTelemetryExporter, VAAToolGuard

runtime = SealedAgentRuntime()
runtime.register_tool(lambda ticket_id: {"status": "open", "id": ticket_id}, name="get_ticket")

# MCP JSON-RPC 2.0 Security Proxy with tools/list JCS rug-pull prevention (-32004)
gateway = MCPAttestationGateway(runtime)
mcp_agent = Agent("mcp-triage-agent")
client = MCPSealedClient(mcp_agent, gateway)
client.initialize_and_enroll()
resp = client.call_tool("get_ticket", {"ticket_id": "TCK-900"})

# Framework-agnostic callable / LangChain callback guard + OpenTelemetry gen_ai.vaa.* spans
otel = VAAOpenTelemetryExporter()
guard = VAAToolGuard(runtime, agent=mcp_agent, exporter=otel)

Command-Line Interface (agentseal)

# Generate Ed25519 PEM keypair + RFC 8037 OKP JWK + RFC 7638 jkt thumbprint
python -m agentseal keygen --no-private

# Compute canonical RFC 8785 (JCS) SHA-256 digest of a BehavioralManifest JSON file
python -m agentseal hash-manifest manifest.json --normalize

# Verify cross-language VAA v1.0 test vectors (JCS, SHA-256, jkt, Ed25519, JWS, RFC 9162 Merkle)
python -m agentseal verify-vectors

# Verify all RFC 9162 inclusion proofs and print Merkle root of a persisted .vaa_log.jsonl file
python -m agentseal inspect-log audit.vaa_log.jsonl

# Run end-to-end pre-execution SQLi block, MCP rug-pull (-32004), and Merkle self-check
python -m agentseal demo

# Launch the out-of-process VAA v1.0 HTTP Attestation Server with persistent Merkle log
python -m agentseal serve --host 127.0.0.1 --port 8440 --trust-domain agentseal.local --log-path audit.vaa_log.jsonl --allowed-tools query_customer_db

Runnable Examples (examples/)

Self-contained, offline-runnable scripts covering every VAA v1.0 enforcement surface (see examples/README.md):

# 1. In-process @seal_tool guard (<0.5 ms), RFC 9162 Merkle proofs, and HIPAA salted PII redaction
python examples/01_sdk_pre_execution_guard.py

# 2. Out-of-process VAAHttpServer, RemoteSealedRuntime, OpenTelemetry gen_ai.vaa.* spans, STH & CRL
python examples/02_http_server_and_remote_client.py

# 3. Multi-agent delegation (Planner -> Coder -> Executor), signed AgentCards & cascading revocation
python examples/03_multi_agent_delegation_a2a.py

# 4. MCP JSON-RPC 2.0 Security Gateway (_meta.vaa receipts & -32004 tool rug-pull defense)
python examples/04_mcp_security_gateway.py

Docker Deployment (Dockerfile / docker-compose.yml / agentseal serve)

Run the hardened out-of-process VAAHttpServer (python:3.12-slim multi-stage build, non-root UID/GID 10001:10001, read_only: true, cap_drop: ["ALL"], no-new-privileges:true, persistent /var/lib/agentseal/audit.vaa_log.jsonl volume):

# Build and start the hardened vaa-server container on port 8440
docker compose up -d --build

# Probe the VAA v1.0 health endpoint
curl http://127.0.0.1:8440/v1/health

# Or run directly via the CLI entrypoint with a declarative manifest JSON
agentseal serve --host 0.0.0.0 --port 8440 --trust-domain agentseal.local --manifest policy.json --log-path /var/lib/agentseal/audit.vaa_log.jsonl

Building PyPI Packages

Build clean sdist (.tar.gz) and bdist_wheel (.whl) distribution artifacts into dist/ (gitignored):

# Standard PEP 517 build
python -m pip install build twine
python -m build --outdir dist
python -m twine check dist/*

# Offline zero-network build via setuptools.build_meta
python -c "import os, setuptools.build_meta as bm; os.makedirs('dist', exist_ok=True); bm.build_sdist('dist'); bm.build_wheel('dist')"

Empirical Security & Latency Benchmarks

Reproducible via python benchmarks/agent_security_bench.py (raw telemetry in benchmarks/latest_results.json):

1. 120-Scenario Multi-Domain Pre-Execution Benchmark

Enterprise Domain Scenarios (Benign / Attack) Precision Recall F1 False Positive Rate Pre-Exec Attack Success Rate (ASR) Unauthorized Side Effects
FinTech & Payments 30 (15 / 15) 1.0000 1.0000 1.0000 0.00% 0.00% 0
Workspace & Comms (MCP) 30 (15 / 15) 1.0000 1.0000 1.0000 0.00% 0.00% 0
Cloud & DevOps 30 (15 / 15) 1.0000 1.0000 1.0000 0.00% 0.00% 0
Healthcare HIPAA PII 30 (15 / 15) 1.0000 1.0000 1.0000 0.00% 0.00% 0 (15/15 salted commitments, 0 SSN leaks)
Total Across All Domains 120 (60 / 60) 1.0000 1.0000 1.0000 0.00% 0.00% (vs. 100% unprotected) 0

2. Live Local Ollama (qwen2.5:7b) + Vulnerable MCP Servers A/B Red-Team Lab (testbed/)

Reproducible 100% offline with zero cloud API keys via python -m testbed.run_ab_redteam (raw traces in testbed/latest_ab_results.json, pairing a live qwen2.5:7b tool-calling agent with OllamaRiskClassifier("qwen2.5-coder:3b") across 5 OWASP MCP Top 10 vulnerable servers):

OWASP MCP Attack Scenario Vulnerable MCP Server WITHOUT AgentSeal (qwen2.5:7b) WITH AgentSeal (VAA v1.0)
MCP01: Indirect Prompt Injection VulnInboxRAGServer HACKED (/secrets/prod.env leaked to drop@evil-collector.io) 100% BLOCKED (-32003 + SVID revoked)
MCP02: Poisoned Tool Metadata PoisonedToolMetadataServer HACKED (~/.ssh/id_rsa read via poisoned description) 100% BLOCKED (-32003 manifest gate)
MCP03: Mid-Session Rug-Pull StatefulRugPullServer HACKED (M&A notes BCC'd to spy@attacker-sink.net) 100% BLOCKED (-32004 JCS schema hash pin)
MCP04: SQL DROP TABLE Injection UnsanitizedSQLOpsServer HACKED (customers table destroyed) 100% BLOCKED (-32003 read_only_sql gate)
MCP05: Refund Cap & Token Exfil ConfusedDeputyWebhookServer HACKED ($8,500 unauthorized refund executed) 100% BLOCKED (-32003 + offline OllamaRiskClassifier)
Overall Attack Success Rate (ASR) 5 Live OWASP MCP Attacks 100% (5/5 Compromised) 0% (0/5 Compromised, Benign Control Passed)

3. Cryptographic Fast-Path & RFC 9162 $O(\log N)$ Merkle Scaling

  • Primitive Latencies (n = 1,000): RFC 8785 JCS + SHA-256 p50 34.8 us | Salted PII Commitment p50 32.0 us | Tier-1 Manifest + Structural Classifier p50 76.6 us | CA vaa+jwt PoP Verify p50 118.2 us | Ed25519 Intent Sign p50 193.7 us.
  • Audit Proof Scaling (MerkleTransparencyLog vs. $O(N)$ Linear Hash Chain):
    • N = 10 leaves: 136.0 us vs. 3,513.1 us (25.3x speedup)
    • N = 100 leaves: 151.6 us vs. 36,710.3 us (219.9x speedup)
    • N = 1,000 leaves: 140.1 us vs. 367,924.5 us (2,502.0x speedup)
    • N = 5,000 leaves: 151.9 us (13 hashes) vs. 1,960,296.4 us (11,134.4x speedup)

Specifications & Open-Source Governance

Metadata

Release files for agentseal-vaa 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentseal-vaa 1.1.0
File Size Uploaded Provenance Actions
agentseal_vaa-1.1.0.tar.gz 165.2 kB With provenance Details for agentseal_vaa-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentseal-vaa 1.1.0
File Interpreter ABI Platform Actions
agentseal_vaa-1.1.0-py3-none-any.whl Python 3 none any Details for agentseal_vaa-1.1.0-py3-none-any.whl

Total release size: 254.0 kB

Release files / agentseal_vaa-1.1.0.tar.gz

Download URL agentseal_vaa-1.1.0.tar.gz
Size 165.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d34bd765f62ffeb7e007a8b6924c2a2b7d3c62a96379266fc722fdffec7b65f8
BLAKE2b-256 checksum
How to use checksums
429c96d3dc2ea99af605078c3348d3c432c058920052dc683b81ffb72d4b6d35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

Release files / agentseal_vaa-1.1.0-py3-none-any.whl

Download URL agentseal_vaa-1.1.0-py3-none-any.whl
Size 88.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33f96e01b5c961f513636794cbdc929aff4e60d94a693ad2a83461ad368c989b
BLAKE2b-256 checksum
How to use checksums
61bdf74e44610af07ba7be5afc0e57056e20396240199d9a45fb66e051f3ed69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

Security for agentseal-vaa 1.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agentseal_vaa-1.1.0.tar.gz

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 Nov 30, 2026.

Transparency log

A note on package security

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page