pub struct ConfidenceEscalationConfig {
pub enabled: bool,
pub confidence_threshold: f64,
pub always_escalate_tools: Vec<String>,
pub cost_threshold_usd: f64,
pub use_llm_confidence: bool,
pub plan_mode_only: bool,
pub max_replan_attempts: u32,
pub max_total_escalations: u32,
pub prompt_user_on_exhaust: bool,
}Expand description
Implements the escalation decision rule from “The Hitchhiker’s Guide to Agentic AI” (Eq. 18.12): Escalate iff p_success < tau_conf OR action in A_irreversible OR cost > B_auto
When enabled, the harness evaluates tool calls before execution and escalates high-risk or low-confidence actions to a blocked-handoff (requiring human review).
Fields§
§enabled: boolMaster switch. Default: false (opt-in).
confidence_threshold: f64Minimum p_success threshold (0.0–1.0). Tools whose estimated success probability falls below this threshold trigger escalation.
always_escalate_tools: Vec<String>Tool names that always trigger escalation regardless of confidence. These are matched against the tool call’s function name.
cost_threshold_usd: f64Maximum estimated cost in USD before escalation. Tool calls whose estimated cost exceeds this threshold trigger escalation.
use_llm_confidence: boolWhether to solicit LLM-based confidence estimation alongside heuristics. When false (default), only heuristic signals (error history, tool class) are used to estimate p_success.
plan_mode_only: boolWhen true, only escalate during PlanBuildEvaluate orchestration mode. During single-mode or other orchestration modes, escalation is skipped.
max_replan_attempts: u32Maximum number of re-plan attempts via conversation injection before prompting the user. The agent sees a structured message explaining which tools were blocked and is asked to try a different approach.
max_total_escalations: u32Maximum total escalations (across all chain steps) before aborting with partial results. Must be >= max_replan_attempts.
prompt_user_on_exhaust: boolWhether to prompt the user when the escalation chain is exhausted. When false, the chain falls through directly to abort-with-partial-results.
Implementations§
Trait Implementations§
Source§impl Clone for ConfidenceEscalationConfig
impl Clone for ConfidenceEscalationConfig
Source§impl Debug for ConfidenceEscalationConfig
impl Debug for ConfidenceEscalationConfig
Source§impl Default for ConfidenceEscalationConfig
impl Default for ConfidenceEscalationConfig
Source§impl<'de> Deserialize<'de> for ConfidenceEscalationConfig
impl<'de> Deserialize<'de> for ConfidenceEscalationConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ConfidenceEscalationConfig
impl JsonSchema for ConfidenceEscalationConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more