Agent identity, beliefs, and self-model for the Life Agent OS -- the crate that answers who the agent is, while every other crate answers what the agent does.
Anima (Latin: soul, inner self) provides the foundational identity primitives: an immutable soul, a cryptographic identity with dual keypairs, mutable beliefs constrained by policy, and a composite self that ties them together.
anima/
crates/
anima-core/ Pure types: Soul, Identity, Belief, Self, Policy, Events
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 consumers. |
PolicyManifest |
Immutable (in soul) | Safety constraints, capability ceiling, economic limits |
AgentIdentityDocument |
Derived | KYA (Know Your Agent) document: DID, capabilities, trust, attestations |
MasterSeed (32 bytes, random)
+-- HKDF-SHA256(seed, "anima/ed25519/v1") --> Ed25519 (Agent Auth Protocol)
+-- HKDF-SHA256(seed, "anima/secp256k1/v1") --> secp256k1 (Haima / web3)
A single seed derives a dual keypair. The seed is encrypted at rest with ChaCha20-Poly1305 and zeroized on drop.
Anima generates did:key identifiers from Ed25519 public keys:
did:key:z6Mk... (multicodec Ed25519 prefix 0xed01 + public key, base58-btc encoded)
Functions: generate_did_key(), resolve_did_key(), verify_did_key().
The PolicyManifest is embedded in the AgentSoul and acts as an immutable ceiling on agent behavior:
- Safety constraints: Hard limits on what the agent may do
- Capability ceiling: Maximum capabilities that beliefs can never exceed
- Economic limits: Spending caps, revenue thresholds
Beliefs are always constrained by the soul's policy -- the agent can learn and adapt, but never violate its constitutional law.
| Layer | Storage | Pattern |
|---|---|---|
| Soul | Lago genesis event | First event, never overwritten |
| Identity | Event-sourced lifecycle | Transitions via anima.* events |
| Belief | Pure projection | Deterministic fold over event stream |
| Self | Reconstructed | Journal replay on session start |
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.identity_attested-- attestation received (KYA)
| System | 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 |
# Full verification
cargo fmt && cargo clippy --workspace && cargo test --workspace
# Run all tests (111)
cargo test --workspace
# Type check
cargo check --workspace
# Lint
cargo clippy --workspaceaios-protocol (canonical contract)
|
anima-core (types + traits, depends on aios-protocol + haima-core)
| \
anima-identity anima-lago (+ lago-core, lago-journal)
(ed25519-dalek,
k256, hkdf,
chacha20poly1305)
Full documentation: docs.broomva.tech/docs/life/anima