Expand description
§AAP — Agent Accountability Protocol
The accountability layer MCP and A2A don’t have.
use aap_protocol::{KeyPair, Identity, Authorization, Level, Provenance, AuditChain, AuditResult};
let supervisor = KeyPair::generate();
let agent = KeyPair::generate();
let identity = Identity::new(
"aap://acme/worker/bot@1.0.0",
vec!["write:files".into()],
&agent, &supervisor,
"did:key:z6MkSupervisor",
)?;
let auth = Authorization::new(
&identity.id,
Level::Supervised,
vec!["write:files".into()],
false, // not physical
&supervisor,
"did:key:z6MkSupervisor",
)?;
assert!(auth.is_valid());§Physical World Rule
let result = Authorization::new(
"aap://factory/robot/arm@1.0.0",
Level::Autonomous, // Level 4
vec!["move:arm".into()],
true, // physical = true
&supervisor,
"did:key:z6Mk",
);
assert!(matches!(result, Err(AAPError::PhysicalWorldViolation { .. })));Structs§
- Audit
Chain - Tamper-evident append-only audit log.
- Audit
Entry - A single tamper-evident entry in the audit chain.
- Authorization
- Authorization token granting an agent permission to act.
- Identity
- An AI agent’s cryptographic identity. Signed by a human supervisor.
- KeyPair
- An Ed25519 keypair for signing AAP documents.
- Provenance
- Provenance records the immutable origin of an agent-produced artifact.
Enums§
- AAPError
- All AAP errors implement this trait.
- Audit
Result - The result of an agent action.
- Level
- AAP authorization levels.
Functions§
- sha256_
of - Compute
"sha256:<hex>"ofdata. - verify_
signature - Verify an Ed25519 AAP signature.