Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
dyolo-kya
Know Your Agent (KYA) — cryptographic chain-of-custody for recursive AI delegation.
dyolo-kya solves the Recursive Delegation Gap: the security failure that occurs when AI agents delegate tasks to other AI agents without cryptographic proof linking those actions back to an original human authorization.
Every action verified by this library generates a cryptographically verifiable audit trail from the executing agent back to the authorizing human. The protocol enforces strict capability boundaries: agents cannot grant authority they do not possess, certificates cannot outlive their parents, and cryptographic nonces prevent replay attacks.
The Problem
Modern AI agent systems suffer from a fundamental security failure:
- Scope escalation — an agent authorized only to query a portfolio can silently grant
drainauthority to a sub-agent. - Broken provenance — when an action is executed by a deeply nested agent, there is no proof it traces back to a human.
- Coarse authorization — delegations are typically "full access" rather than "only TRADE_AAPL_100 at limit=182.50".
- No replay protection — the same delegation token can be reused indefinitely.
- No revocation — a compromised delegation cannot be cancelled mid-chain.
- Temporal abuse — a child delegation can outlive its parent.
In a world where autonomous AI agents manage real capital, these gaps are not theoretical.
The Solution
dyolo-kya closes every gap through five composable primitives:
| Primitive | Role |
|---|---|
Intent / IntentTree |
Human defines exact allowed actions; tree root is the canonical scope commitment |
SubScopeProof |
Cryptographic evidence that a delegated scope is a strict subset of the delegator's |
DelegationCert |
Signed, domain-separated hop binding scope + temporal bounds + nonce per delegation |
DyoloChain |
Verifies all invariants atomically in a single pass |
AuthorizedAction |
Type-level proof — the only way to reach this type is through a successful verification |
The AuthorizedAction type is the key design: you cannot construct one yourself. The Rust type system enforces that no execution path exists that bypasses verification.
Install
[]
= "1"
With JSON/binary serialization:
[]
= { = "1", = ["serde"] }
Quick Start
use ;
// ── Identities ────────────────────────────────────────────────────────────────
let human = generate;
let orchestrator = generate;
let executor = generate;
// ── Principal defines the authorized intent set ───────────────────────────────
let trade = new
.param
.param
.param
.param
.hash;
let query = new.hash;
let tree = build.unwrap;
let root = tree.root;
// ── Human → Orchestrator (full scope) ────────────────────────────────────────
let now = 1_700_000_000u64;
let expiry = now + 3_600;
let cert_orch = new
.sign;
// ── Orchestrator → Executor (trade-only, no further delegation) ───────────────
let sub_proof = build.unwrap;
let sub_root = build.unwrap.root;
let cert_exec = new
.scope_proof
.max_depth
.sign;
// ── Assemble chain and authorize ──────────────────────────────────────────────
let mut chain = new;
chain.push.push;
let action = chain.authorize.unwrap;
// action.receipt is your tamper-proof compliance record.
println!;
Security Guarantees
| Property | Mechanism |
|---|---|
| Unforgeability | Ed25519 signatures with domain-separated signing context |
| Non-escalation | SubScopeProof proves strict subset at every hop; ScopeEscalation error otherwise |
| Termination | max_depth per cert + expiration monotonicity enforced across hops |
| Replay resistance | Per-cert 128-bit nonces; NonceStore records consumed nonces persistently |
| Revocability | Fingerprint-based RevocationStore; pluggable to Redis, CRLs, or on-chain accumulators |
| Temporal integrity | No child cert may outlive its parent |
| Audit completeness | chain_fingerprint commits the full delegation path; deterministic across calls |
| Type-enforced authorization | AuthorizedAction has no public constructor — only DyoloChain::authorize produces one |
Pluggable Backends
The in-memory stores (MemoryRevocationStore, MemoryNonceStore) are for development and testing. Production systems should implement the traits over persistent storage:
use ;
The same pattern applies to NonceStore. A persistent NonceStore is critical for production replay protection across process restarts.
Architecture
dyolo-kya/
├── src/
│ ├── lib.rs — public API surface
│ ├── crypto.rs — domain-separated Blake3 hashing (private)
│ ├── intent.rs — Intent, IntentTree, SubScopeProof, MerkleProof
│ ├── identity.rs — DyoloIdentity (Ed25519, ZeroizeOnDrop)
│ ├── cert.rs — DelegationCert, CertBuilder
│ ├── registry.rs — RevocationStore, NonceStore, in-memory impls
│ ├── chain.rs — DyoloChain, AuthorizedAction, VerificationReceipt
│ └── zk_guest/ — RISC Zero ZK guest program (feature = "prove")
│ ├── Cargo.toml
│ └── src/main.rs — Ed25519 chain verifier inside ZK VM
├── benches/
│ └── chain_bench.rs — criterion benchmarks (single-hop, two-hop, revocation)
├── tests/
│ └── integration.rs — adversarial test suite (clock, tampering, revocation)
├── examples/
│ └── trading_agent.rs — end-to-end multi-agent authorization demo
├── .github/
│ └── workflows/
│ └── ci.yml — matrix CI (Linux, macOS, Windows)
├── CHANGELOG.md
├── SECURITY.md
└── LICENSE
Running
# End-to-end example
# Test suite (including adversarial integration tests)
# Benchmarks
Environment Variables
| Variable | Default | Description |
|---|---|---|
DYOLO_CLOCK_DRIFT_SEC |
15 |
Maximum clock skew tolerated when checking issued_at and expiration_unix. Read once at first authorize call and cached for the process lifetime. |
Target Use Cases
- Autonomous crypto trading agents and execution engines
- Multi-agent research and orchestration frameworks
- Enterprise AI workflow automation requiring compliance
- On-chain agent protocols (AI DAOs, intent-based solvers)
- Any system where humans delegate authority to AI that may further delegate
Authors
Created by dyolo (@dyologician).
License
MIT — see LICENSE.