Skip to main content

agent_mesh_protocol/
lib.rs

1//! Cryptographic primitives for the agent-mesh.
2//!
3//! This crate provides the identity layer the rest of the workspace
4//! builds on:
5//!
6//! * [`UserKey`] — root of trust, one ed25519 keypair per user.
7//! * [`AgentKey`] — short-lived per-process sub-key, certified by a
8//!   `UserKey` via a [`CertChain`].
9//! * [`GitHubBinding`] — cross-signature linking a `UserKey` to the
10//!   ed25519 SSH key GitHub already knows about.
11//! * [`SignedEnvelope`] — the wire format every mesh message is
12//!   wrapped in.
13//! * [`Fingerprint`] — short BLAKE3 identifier for keys and content.
14//!
15//! All wall-clock time in this crate is treated as a *claim* (e.g.
16//! `AgentMetadata::issued_at`), never as a coordination primitive.
17//! See the project `CLAUDE.md` for the rationale.
18
19#![doc(html_root_url = "https://docs.rs/agent-mesh-protocol")]
20
21pub mod agent_key;
22pub mod assertion;
23pub mod atomic;
24pub mod authority;
25pub mod caveats;
26pub mod envelope;
27pub mod error;
28pub mod fingerprint;
29pub mod github_binding;
30pub mod guard;
31pub mod revocation;
32pub mod signer;
33pub mod user_key;
34
35#[cfg(feature = "pyo3")]
36pub mod pyo3_module;
37
38pub use agent_key::{AgentKey, AgentMetadata, CertChain, Issuer, SerdeSig};
39pub use assertion::Assertion;
40pub use atomic::atomic_write;
41pub use authority::{
42    admit, check_derivation, empty_closure, relate, verify_chain, AdmissionDecision,
43    AdmissionReject, AttestationId, AttestationVerifier, Authority, AuthorityId, AuthorityMismatch,
44    BindError, ChainDecision, ChainReject, ConfinedAxis, DenyAllElevations, Derivation,
45    DerivationDecision, DerivationReject, Grant, GrantId, ResolvedAuthority, ResolvedGrant,
46    ResolvedScope, ScopeRelation,
47};
48pub use caveats::{Caveats, CountBound, Scope};
49pub use envelope::{Recipient, SignedEnvelope};
50pub use error::{MeshError, Result};
51pub use fingerprint::Fingerprint;
52pub use github_binding::{ssh_pubkey_ed25519_bytes, GitHubBinding};
53pub use guard::{GuardError, RevocationGuard};
54pub use revocation::{RevocationEntry, RevocationLog, RevocationState, Seen, SignedEntry};
55pub use signer::MeshSigner;
56pub use user_key::{UserKey, UserPublic};