Back to Guides & Cookbooks
Cookbook
How to audit every AI decision with intelligence traces
Every response carries a trace ID. Fetch the full trace: what it remembered, what tools it proposed, what governance decided, what gaps it found. Hash-chained for tamper detection.
1
Every response includes a trace
The intelligence object in every response contains the full decision breakdown.
intelligence object
{
"intelligence": {
"capability": {
"total_available": 42,
"healthy_count": 38,
"active_integrations": ["stripe", "github", "slack"]
},
"reasoning": {
"intent": "create_invoice",
"complexity": "simple",
"confidence": 0.95,
"approach": "direct_tool_call"
},
"memory": {
"healthy": true,
"knowledge_queried": 147
},
"governance": {
"active": true,
"decision": "auto",
"confidence": 0.94
},
"humility": {
"gaps_detected": 0,
"blocking": false
},
"process": {
"started_at": "2026-06-21T10:30:00Z",
"duration_ms": 840,
"trace_id": "tr_abc123"
}
}
}2
Query traces from any surface
SDK — list traces
const traces = await cadreen.traces.list({ limit: 10 });
for (const trace of traces) {
console.log(trace.id, trace.governance.decision, trace.process.duration_ms);
}CLI
cadreen traces # last 10 traces
cadreen traces --limit 50 # last 50Dashboard
Visit /infra/dashboard/traces to see all traces with:
- Humanized governance decisions ("Handled on its own", "Asked for permission")
- Replay capability
- Filter by decision type, time range, sourceSame traces, accessible from dashboard, CLI, and SDK
3
Hash-chain integrity (Semantic Action Log)
Every action in the Semantic Action Log is hash-chained. Each entry includes the hash of the previous entry. Any tampering breaks the chain — detectable instantly.
Verify chain integrity
// Verify the entire chain
const verification = await fetch("/api/sal/chain/verify");
const result = await verification.json();
console.log(result.valid); // true
console.log(result.entries); // 12,847
console.log(result.broken_at); // null (or index if tampered)Note
The Semantic Action Log records 24 semantic action types with hash-chain integrity. This is your "black box recorder" for compliance.
Note
Next: How to make AI learn from repeated interactions — reusable procedures, pattern detection.