Epistemic trust layer for AI agents — confidence tiers, routing, and accountability
Project description
cognilateral-trust
Epistemic trust layer for AI agents. AI that tells you when it's guessing.
pip install cognilateral-trust
Zero external dependencies. Python 3.11+.
Quick Start
from cognilateral_trust import evaluate_trust
result = evaluate_trust(0.7)
if result.should_proceed:
perform_action()
else:
escalate(result.accountability_record.reasons)
Confidence Tiers (C0-C9)
| Tier | Name | Route |
|---|---|---|
| C0-C3 | Unverified to Measured | basic — straight-through |
| C4-C6 | Tested to Falsifiable | warrant_check — evidence required |
| C7-C9 | Governance to Resilient | sovereignty_gate — full evaluation |
Features
Core
evaluate_trust()— confidence to tier to verdict (ACT/ESCALATE)@trust_gate— one-line trust enforcement decoratorextract_confidence()— parse confidence from text, OpenAI, or Anthropic responsesCalibratedTrustEngine— learning loop with JSONL persistence
Verification
- Claims extraction — factual, causal, comparative, quantitative
- Fidelity verification — word-overlap source checking
- Epistemic firewall — confidence mismatch detection (7-tier)
- Sovereignty gate — D-07 with D-05 welfare hard constraint
Network Primitives
- Trust decay — confidence attenuates across agent handoffs
- Contagion detection — track low-trust claim propagation
- Trust-weighted consensus — Bayesian composition, not majority vote
- Sovereign worker — leaf-level self-governance (D-07 at edge)
- Provenance chain — cryptographic accountability ledger
TrustBench
- Scoring — expected calibration error (ECE) measurement
- Fingerprint — radial calibration profile per model/domain
- CLI —
trust-check run,trust-check fingerprint - Leaderboard — self-contained HTML ranking
Integrations
- LangGraph —
TrustNodefor StateGraph + conditional edges - CrewAI —
TrustToolimplementing the Tool protocol - OpenClaw —
TrustProviderfor always-on agent governance - Cognee — trust scoring on knowledge graph edges
MCP Server
Zero-install trust evaluation as an MCP tool:
uvx cognilateral-trust-mcp
Exposes trust_evaluate, trust_extract_confidence, and trust_health over stdio JSON-RPC 2.0.
Examples
See examples/ for runnable demos including a Colab notebook.
| Example | Description |
|---|---|
demo_trust_agent.py |
End-to-end agent with trust gating and calibration |
langgraph_trust_agent.py |
LangGraph agent with trust node |
crewai_trust_tool.py |
CrewAI tool integration |
anthropic_trust_wrapper.py |
Anthropic API with trust evaluation |
openai_trust_wrapper.py |
OpenAI API with trust evaluation |
Package Stats
| Metric | Value |
|---|---|
| Modules | 41 |
| Tests | Run uv run pytest -q for current count |
| External dependencies | 0 |
| Python | 3.11+ |
| Version | 1.1.0 |
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cognilateral_trust-1.2.0.tar.gz.
File metadata
- Download URL: cognilateral_trust-1.2.0.tar.gz
- Upload date:
- Size: 201.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d09060917e6426352c4ad2f6a2170d4b660d84c69d1db69715a8b0721a161397
|
|
| MD5 |
4506872a19ddac77fd206621bc7ce027
|
|
| BLAKE2b-256 |
4d43671947bee18984bd7a0b42b228e26baec1930428d2a6fa3874a1f8e65e89
|
File details
Details for the file cognilateral_trust-1.2.0-py3-none-any.whl.
File metadata
- Download URL: cognilateral_trust-1.2.0-py3-none-any.whl
- Upload date:
- Size: 86.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d143f62e5f7bd39c96dcaf66645ba68f2d902a266726fea73ddbe5669be02833
|
|
| MD5 |
66139f2d044c379a45422359db363ec5
|
|
| BLAKE2b-256 |
df732363c5d86676c9f5c60f3e71fc008300a3447d4bc3b9c41cc6528a6ea681
|