qae-kernel
Domain-agnostic safety certification kernel for AI agents and autonomous systems.
An agent proposes an action, the kernel evaluates it against pluggable constraint channels, and produces a tamper-evident safety certificate with a deterministic SHA-256 hash.
Quick Example
use ;
use BTreeMap;
// 1. Define a constraint channel
;
// 2. Define a domain adapter
;
// 3. Certify an action
let config = default;
let action = SimpleAction ;
let cert = certify_action.unwrap;
assert!;
How It Works
ProposedAction --> DomainAdapter --> ConstraintChannels --> SafetyCertifier --> SafetyCertificate
| |
(domain-specific) (margin in [0,1])
Each constraint channel returns a margin in [0, 1] where 0 = at boundary and 1 = maximum headroom. The minimum margin across all channels determines the certification decision:
| Min Margin | Zone | Decision |
|---|---|---|
| > 0.6 | Safe | Certified |
| (0.3, 0.6] | Caution | CertifiedWithWarning |
| (0.1, 0.3] | Danger | EscalateToHuman |
| <= 0.1 | Danger | Blocked |
Key Traits
DomainAdapter-- plugs domain-specific logic into the kernelConstraintChannel-- evaluates a single constraint dimensionProposedAction-- represents an agent's proposed action
Features
- Deterministic certification with SHA-256 tamper-evident hashing
- BTreeMap-based ordering for full reproducibility (no HashMap)
- Declarative constraint channels (JSON-defined, no recompilation)
- Runtime constraint registry (add/remove/enable/disable channels)
- Builder pattern for certificate assembly
- Zero domain dependencies -- bring your own adapter
Links
License
BSL-1.1 (Business Source License 1.1). Converts to Apache 2.0 on 2032-01-01.