Secure Digital Agent Protocol — HTTPS for AI agent communication. Cryptographic identity, mutual authentication, encrypted payloads, trust delegation, and audit trails for multi-provider agent ecosystems. Works with A2A, MCP, and any agent-to-agent protocol.
SDAP is an early-stage Python project in the AI payments / x402 ecosystem, focused on a2a-protocol, aes-256-gcm, agent-to-agent, ai-agents. It currently has 2 GitHub stars and 0 forks, and sits alongside related tools like peac, blocklace-a2a, agentanycast, summoner-agents, a2a-demos, a2a-secure.
HTTPS for AI agent-to-agent communication.
A cryptographic trust layer for multi-provider AI agent ecosystems. Identity verification, mutual authentication, end-to-end encryption, scoped delegation, and tamper-evident audit trails — for agents built on Google A2A, Anthropic MCP, or any agent-to-agent transport.
AI agents are fragmenting across providers — Anthropic, Google, OpenAI, startups. Google's A2A protocol handles agent discovery and task delegation. Anthropic's MCP handles tool and data access. But neither provides a standard for:
SDAP fills this gap. It's a security and trust protocol that sits on top of A2A (or any agent transport), the same way HTTPS sits on top of HTTP.
Positioning: MCP (tools/data) + A2A (discovery/delegation) + SDAP (trust/security)
Layer 5: AUDIT TRAIL Merkle-chained cryptographic event log
Layer 4: TRUST DELEGATION Delegation tokens, scope constraints, chain validation
Layer 3: PAYLOAD SECURITY AES-256-GCM encryption, forward secrecy, replay protection
Layer 2: SESSION (Handshake) Mutual authentication, X25519 key exchange, capability negotiation
Layer 1: IDENTITY did:sdap DIDs, Ed25519 keys, provider attestations
─────────────────────────────────────────────────────────
Transport: A2A JSON-RPC over HTTPS, or any agent protocol
Start with Layer 1 (identity) and add layers as needed. A low-sensitivity agent interaction might use Layers 1-2. Moving PHI across healthcare providers? All five layers.
did:sdap)Agents are identified by DIDs: did:sdap:<provider-domain>:<agent-id>. DID Documents are resolved via https://<provider>/.well-known/sdap/did/<agent-id> — no central registry, DNS-anchored trust. Supports Ed25519 authentication keys and X25519 key agreement keys.
Mutual authentication with ephemeral X25519 ECDH key exchange providing forward secrecy. Session keys derived via HKDF-SHA256. Nonce-based replay protection. 60-second clock skew tolerance.
AES-256-GCM encryption via JWE with authenticated additional data (AAD) binding ciphertext to session metadata. Monotonic sequence numbers prevent replay and reordering. Data classification tags (public, internal, confidential, PHI, PII, restricted).
Signed JWT delegation tokens with scope attenuation — permissions can only narrow down the chain, never expand. Constraint inheritance enforces that child tokens can tighten but never loosen parent constraints. SHA-256 hash-linked chains detect tampering. Supports: maxSubDelegations, allowedProviders, requiredSecurityLevel, requiredComplianceTags (HIPAA, SOC2, etc.), geofence, dataClassification.
Every protocol event (session lifecycle, task operations, payload events, delegation usage, key rotation, policy violations) produces a signed audit entry. Entries form a Merkle-like hash chain — modifying any past entry invalidates all subsequent entries. Lightweight audit commitments propagate chain integrity proofs up the delegation hierarchy.
Backward-compatible Agent Card sdap extension. A2A message extension parameters (sdap:sessionId, sdap:sequenceNumber, sdap:delegationChain, sdap:auditEntryHash). Drop-in middleware for wrapping/unwrapping A2A messages with SDAP security envelopes.
cd sdap-python
pip install -e .
from sdap.identity import generate_ed25519_keypair, generate_x25519_keypair, create_did
from sdap.handshake import create_handshake_init, process_handshake_init
from sdap.delegation import create_delegation_token, DelegationConstraints
from sdap.a2a import wrap_a2a_message, unwrap_a2a_message
# Create agent identity
auth_kp = generate_ed25519_keypair("auth-key-1")
agree_kp = generate_x25519_keypair("agree-key-1")
did_doc = create_did("acme-health.com", "records-agent",
auth_kp.public_key, agree_kp.public_key)
# Perform handshake → encrypted session → send secure messages
# See examples/ for complete flows
cd sdap-typescript
npm install && npm run build
import { generateEd25519Keypair, generateX25519Keypair, createDid } from './src/identity/index.js';
import { createHandshakeInit } from './src/handshake/index.js';
const authKp = generateEd25519Keypair("auth-key-1");
const agreeKp = generateX25519Keypair("agree-key-1");
const didDoc = createDid({ providerDomain: "acme-health.com", agentId: "records-agent",
authPublicKey: authKp.publicKey, agreementPublicKey: agreeKp.publicKey });
# Python (186 tests)
cd sdap-python && pip install -e ".[dev]" && pytest tests/ -v
# TypeScript (107 tests)
cd sdap-typescript && npm install && npm test
# Cross-language interop
cd sdap-python && PYTHONPATH=src python3 ../tests/interop/generate_vectors_python.py
cd sdap-typescript && npx vite-node ../tests/interop/generate_vectors_typescript.ts
cd sdap-typescript && npx vitest run ../tests/interop/verify_python_vectors.test.ts
cd sdap-python && PYTHONPATH=src pytest ../tests/interop/test_verify_ts_vectors.py
| Example | Scenario | What It Demonstrates |
|---|---|---|
cross-provider-handoff/ |
Two agents, two providers | Full handshake, encrypted query/response, provider attestations |
delegation-chain/ |
Three-agent A→B→C | Scoped delegation, constraint narrowing, chain validation |
medical-records/ |
Healthcare PHI transfer | HIPAA compliance tags, high-security sessions, PHI classification, audit trail verification, tamper detection |
cd sdap-python
PYTHONPATH=src python3 ../examples/cross-provider-handoff/example.py
PYTHONPATH=src python3 ../examples/delegation-chain/example.py
PYTHONPATH=src python3 ../examples/medical-records/example.py
| Purpose | Algorithm | Standard | Format |
|---|---|---|---|
| Agent authentication / signing | Ed25519 | RFC 8032, NIST SP 800-186 | JWS compact (EdDSA) |
| Session key agreement | X25519 ECDH | RFC 7748 | JWK |
| Key derivation | HKDF-SHA256 | RFC 5869 | — |
| Payload encryption | AES-256-GCM | NIST SP 800-38D | JWE compact |
| Hashing / integrity | SHA-256 | FIPS 180-4 | Hex-encoded |
| Canonicalization | JCS | RFC 8785 | UTF-8 JSON |
| Identity tokens | JWT | RFC 7519 | JWS compact |
| Key encoding | JWK | RFC 7517 | JSON |
All algorithms are quantum-migration-ready — the protocol is algorithm-agnostic by design, with a documented migration path to ML-DSA / ML-KEM (NIST PQC standards).
| Document | Description |
|---|---|
| Whitepaper | Non-technical concept document — the problem, the approach, real-world scenarios, open problems |
| Protocol Specification | RFC-style formal spec — all 5 layers, message formats, validation rules, crypto requirements |
| DID Method Specification | did:sdap method — syntax, resolution, CRUD operations, security considerations |
| OpenAPI Specification | REST API for DID resolution, handshake, revocation, audit retrieval |
| JSON Schemas | JSON Schema (draft 2020-12) for all 8 protocol message types |
| Interop Test Vectors | Cross-language test vectors proving Python ↔ TypeScript compatibility |
sdap/
├── spec/ Protocol specs, DID method, JSON schemas, OpenAPI
│ ├── sdap-protocol-v1.md Full RFC-style protocol specification
│ ├── did-method-sdap.md did:sdap DID method specification
│ ├── openapi.yaml OpenAPI 3.1.0 REST API definition
│ └── schemas/ JSON Schema for all message types
├── whitepaper/ Concept whitepaper
├── sdap-python/ Python reference SDK
│ ├── src/sdap/ identity/ crypto/ handshake/ delegation/ audit/ a2a/
│ └── tests/ 186 unit + integration tests
├── sdap-typescript/ TypeScript reference SDK
│ ├── src/ identity/ crypto/ handshake/ delegation/ audit/ a2a/
│ └── tests/ 107 unit + integration tests
├── tests/interop/ Cross-language interop test vectors
└── examples/ Three runnable scenario examples
These are documented in the whitepaper — areas where the protocol acknowledges uncertainty and invites community input:
Contributions welcome. Please open an issue before submitting large pull requests. All cryptographic changes require corresponding test vector updates in tests/interop/.
Apache License 2.0. See LICENSE for details.
Portable signed records for automated interactions.
Cryptographic audit layer for A2A: hash-chained, signed blocks with equivocation detection.
Connect AI agents across any network — zero config, encrypted, skill-based routing
A collection of Summoner clients and agents featuring example implementations and reusable templates
Demo agents showcasing CapiscIO Agent Guard and MCP Guard — trust badges, identity verification, and tool-level authorization for A2A and MCP protocols
End-to-end encrypted communication for AI agents. The security layer that Google A2A forgot.
A local-first AI agent with persistent memory, emotional intelligence, and a peer-to-peer skills economy.
The trust layer for agent-to-agent commerce — natural-language mandates, ERC-7710 delegated permissions, x402 payments, escrow, and dispute resolution as one open, catch-all Agent Skill / Claude Code plugin.
Agent behavior that compiles
The A2A x402 Extension brings cryptocurrency payments to the Agent-to-Agent (A2A) protocol, enabling agents to monetize their services through on-chain payments. This extension revives the spirit of HTTP 402 "Payment Required" for the decentralized agent ecosystem.
Aser is a lightweight, self-assembling AI Agent frame.
Golang SDK for A2A Protocol