Skip to main content

is_tool_allowed

Function is_tool_allowed 

Source
pub fn is_tool_allowed(tool_name: &str, auto_approve: AutoApprove) -> bool
Expand description

Return whether a tool may run under the selected auto-approve policy.

ยงExamples

use codetether_agent::a2a::worker::AutoApprove;
use codetether_agent::a2a::worker_tool_registry::is_tool_allowed;

assert!(is_tool_allowed("read", AutoApprove::Safe));
assert!(is_tool_allowed("todoread", AutoApprove::Safe));
assert!(!is_tool_allowed("write", AutoApprove::Safe));
assert!(is_tool_allowed("write", AutoApprove::All));