MCPcopy Create free account
hub / github.com/AI45Lab/Code / confirmation_decision

Method confirmation_decision

core/src/safety_gate.rs:142–167  ·  view source on GitHub ↗
(&self, tool_name: &str)

Source from the content-addressed store, hash-verified

140 }
141
142 async fn confirmation_decision(&self, tool_name: &str) -> ToolGateDecision {
143 let Some(cm) = &self.config.confirmation_manager else {
144 let msg = format!(
145 "Tool '{}' requires confirmation but no HITL confirmation manager is configured. \
146 Configure a confirmation policy to enable tool execution.",
147 tool_name
148 );
149 return ToolGateDecision::Deny {
150 output: msg.clone(),
151 event_reason: msg,
152 reason: ToolGateDenial::MissingConfirmationManager,
153 };
154 };
155
156 if !cm.requires_confirmation(tool_name).await {
157 return ToolGateDecision::Execute {
158 reason: ToolGateApproval::ConfirmationNotRequired,
159 };
160 }
161
162 let policy = cm.policy().await;
163 ToolGateDecision::Confirm {
164 timeout_ms: policy.default_timeout_ms,
165 timeout_action: policy.timeout_action,
166 }
167 }
168}
169
170#[cfg(test)]

Callers 1

decideMethod · 0.80

Calls 3

cloneMethod · 0.45
requires_confirmationMethod · 0.45
policyMethod · 0.45

Tested by

no test coverage detected