Steward: Contract-driven governance engine for AI systems
โ Rust ๐ 2025-12-21 ๐ค surdeus ๐๏ธ 7I'm sharing Steward, an open-source governance engine for evaluating AI outputs against human-authored contracts.
The goal: deterministic, traceable verdicts (PROCEED / ESCALATE / BLOCKED) with evidence-backed accountability.
Crate structure:
steward-core โ Deterministic evaluation (zero LLM calls)
steward-runtime โ Optional async LLM orchestration
steward-cli โ Pipe-friendly CLI
Key design decisions:
- Parallel lenses with tokio::join! โ Five independent evaluators fan-out, synthesizer fans-in. Each lens implements a Lens trait; runtime uses LensAgent (async). Reasonable pattern or overengineered?
- BTreeMap for determinism โ All config maps use BTreeMap + LensType derives Ord to guarantee iteration order. Worth the overhead vs IndexMap?
- ProviderFactory trait for LLM providers โ Dynamic registration via ProviderRegistry instead of a ProviderType enum. Adds complexity but avoids enum bloat as providers grow.
- Hard boundary: no LLM in steward-core โ The synthesizer is a strict policy machine. All LLM assistance lives in steward-runtime. Is this separation clear from the API?
- Fallback chain โ On LLM failure: Cache โ Simpler Model โ Deterministic (core) โ Escalate. Configured via Vec. Suggestions on the pattern?
Also includes:
- Python bindings (PyO3/maturin)
- Node.js bindings (napi-rs)
- Domain packs: healthcare, finance, legal, education, HR
Repo: Steward GitHub
This is a work in progressโcontributors welcome.
Happy to receive any feedback.
Thank you!
1 post - 1 participant
๐ท๏ธ Rust_feed