Decision-Safety & Escalation Guide
Every Bipkit evaluation is designed to be fail-safe: rather than forcing you to blindly trust a winning label, Bipkit surfaces calibrated certainty so your pipeline knows whether to auto-execute, confirm, or escalate.
Certainty Action Matrix
Section titled “Certainty Action Matrix”confidence_tier |
Typical Signal | Recommended Action | Example (Tool Safety Gate) |
|---|---|---|---|
high |
Strong confidence_index, clear margin, low uncertainty_entropy |
Auto-execute the System One decision directly | Immediately block or allow the tool call |
medium |
Moderate confidence_index or narrower margin |
Proceed with guardrails (log for review, apply conservative default, or run a lightweight secondary check) | Allow read-only actions; require confirmation for state-mutating actions |
low |
Low confidence_index, tight margin, or high uncertainty_entropy |
Escalate to System Two (frontier LLM or human-in-the-loop) | Route the ambiguous request to a frontier reasoning model |
Built-In SDK Escalation Helpers
Section titled “Built-In SDK Escalation Helpers”All four official SDKs ship a Decision-Safety escalation helper that checks confidence_tier, uncertainty_entropy, and margin in a single call. For high-stakes workflows (such as blocking destructive shell commands or routing regulated financial actions), require "high" confidence with tight entropy and margin bounds:
import { Bipkit, shouldEscalate } from "@bipware-org/bipkit";
const bipkit = new Bipkit();const decision = await bipkit.decide({ state, choices: [ { id: "approve", label: "Approve Action" }, { id: "block", label: "Block Action" }, ], engine: "bip-cascade",});
if (shouldEscalate(decision, { minConfidenceTier: "high", maxEntropy: 0.2, minMargin: 0.25 })) { await escalateToFrontierLLM(state);} else { await routeFast(decision.top_choice!);}from bipkit import Bipkit, should_escalate
client = Bipkit()decision = client.decide( state=state, choices=[ {"id": "approve", "label": "Approve Action"}, {"id": "block", "label": "Block Action"}, ], engine="bip-cascade",)
if should_escalate(decision, min_confidence_tier="high", max_entropy=0.2, min_margin=0.25): escalate_to_frontier_llm(state)else: route_fast(decision.top_choice)maxEntropy := 0.2minMargin := 0.25
if bipkit.ShouldEscalateDecision(res, bipkit.EscalationOptions{ MinConfidenceTier: "high", MaxEntropy: &maxEntropy, MinMargin: &minMargin,}) { escalateToFrontierLLM(state)} else if res.TopChoice != nil { routeFast(*res.TopChoice)}use bipkit::{EscalationOptions, should_escalate_decision};
let opts = EscalationOptions { min_confidence_tier: "high".into(), max_entropy: Some(0.2), min_margin: Some(0.25),};
if should_escalate_decision(&res, &opts) { escalate_to_frontier_llm(&state).await;} else if let Some(choice) = res.top_choice.as_deref() { route_fast(choice).await;}Closing the Loop with Outcome Feedback
Section titled “Closing the Loop with Outcome Feedback”Whenever a human reviewer or System Two LLM resolves an escalated decision, submit the verified outcome to POST /api/v1/feedback (or POST /api/v1/provenance/outcomes for DPL audit linkage) using the original request_id.
