Anima (Latin: soul, inner self) — the crate that answers who the agent is, while every other crate answers what the agent does.
anima/
├── crates/
│ ├── anima-core/ # Pure types: Soul, Identity, Belief, Self, Policy, Events, IdentityDocument
│ ├── anima-identity/ # Cryptographic operations: seed, Ed25519, secp256k1, JWT, DID
│ └── anima-lago/ # Persistence bridge: genesis events, belief projection
| Type | Mutability | Purpose |
|---|---|---|
AgentSoul |
Immutable | Origin, lineage, values, cryptographic root. Created once. |
AgentIdentity |
Lifecycle-mutable | Ed25519 (auth) + secp256k1 (economics) dual keypair + DID |
AgentBelief |
Mutable | Capabilities, trust scores, reputation, economic state |
AgentSelf |
Composite | Soul + Identity + Belief. The entry point for all crates. |
PolicyManifest |
Immutable (in soul) | Safety constraints, capability ceiling, economic limits |
AgentIdentityDocument |
Derived | KYA (Know Your Agent) document: DID, capabilities, trust, attestations |
AgentType |
Value | Autonomous, Delegated, or Hosted |
TrustTier |
Value | Unverified, Provisional, Trusted, or Certified |
MasterSeed (32 bytes, random)
├── HKDF-SHA256(seed, "anima/ed25519/v1") → Ed25519 (Agent Auth Protocol)
└── HKDF-SHA256(seed, "anima/secp256k1/v1") → secp256k1 (Haima/web3)
Single seed → dual keypair. Encrypted at rest with ChaCha20-Poly1305.
All events use EventKind::Custom with prefix "anima.":
anima.soul_genesis— first event in an agent's journalanima.identity_created— keypair createdanima.capability_granted/capability_revokedanima.trust_updated— peer trust score changeanima.economic_belief_updated— from Haima/Autonomicanima.belief_snapshot— periodic checkpointanima.policy_violation_detected— blocked actionanima.identity_attested— attestation received (KYA)anima.identity_verified— identity verified by external party (KYA)
- Soul → Lago genesis event (first event, never overwritten)
- Belief → Pure projection (fold over event stream), like Haima's
FinancialState - Identity → Event-sourced lifecycle transitions
- Self → Reconstructed from journal replay
anima-core → aios-protocol, haima-core, bs58
anima-identity → anima-core, haima-wallet, ed25519-dalek, k256, hkdf, chacha20poly1305, bs58
anima-lago → anima-core, lago-core, lago-journal
- Edition: 2024 (Rust 1.85)
- No unsafe:
#[forbid(unsafe_code)] - Errors:
thiserror(notanyhow) - Testing: Every module has unit tests
- Soul immutability: No
&mut selfmethods onAgentSoul - Belief constrained by Soul:
PolicyManifestis the hard ceiling
cargo check --workspace # Type check
cargo test --workspace # Run all 111 tests
cargo clippy --workspace # Lint
cargo fmt --all # FormatKYA is the agent-era equivalent of KYC. It provides:
generate_did_key(public_key)— Createsdid:key:z6Mk...from Ed25519 public keyresolve_did_key(did)— Extracts public key from adid:keyDIDverify_did_key(did, public_key)— Verifies DID matches a public key- Format: multicodec Ed25519 prefix (0xed01) + public key, base58-btc encoded
AgentIdentityDocument— Complete KYA document (DID, capabilities, trust, attestations)AgentType— Autonomous, Delegated, or HostedTrustTier— Unverified (<0.4), Provisional (0.4-0.7), Trusted (0.7-0.9), Certified (>=0.9)Attestation— Verifiable claims from issuers with expiryIdentityDocumentBuilder— Builder pattern for document construction
AgentSelf::did()— Access the agent's DIDAgentSelf::identity_document(agent_type, trust_score)— Generate a KYA document
anima.identity_attested— Attestation receivedanima.identity_verified— Identity verified by external party
| Crate | How Anima Integrates |
|---|---|
| Arcan | Reconstructs AgentSelf from Lago on session start |
| Lago | Soul = genesis event; Belief = projection fold |
| Autonomic | Beliefs feed into homeostasis regulation |
| Haima | secp256k1 identity unifies with wallet |
| Spaces | Ed25519 key signs messages, presence includes identity |
| Vigil | OTel spans carry agent.id + agent.soul_hash |
| broomva.tech | Agent Auth Protocol via Ed25519 JWT signing |