pub struct ToolPolicyConfig {Show 40 fields
pub enabled: bool,
pub require_confirmation: bool,
pub allow_without_confirmation: bool,
pub confirmation_message: Option<String>,
pub rate_limit: Option<u32>,
pub timeout_ms: Option<u64>,
pub allowed_domains: Vec<String>,
pub blocked_domains: Vec<String>,
pub allowed_paths: Vec<String>,
pub read_paths: Vec<String>,
pub write_paths: Vec<String>,
pub blocked_paths: Vec<String>,
pub max_file_size_bytes: Option<u64>,
pub max_output_chars: Option<usize>,
pub max_results: Option<usize>,
pub max_response_bytes: Option<usize>,
pub blocked_private_networks: bool,
pub allowed_schemes: Vec<String>,
pub allowed_ports: Vec<u16>,
pub max_redirects: Option<usize>,
pub max_changed_files: Option<usize>,
pub max_changed_lines: Option<usize>,
pub max_replacements: Option<usize>,
pub require_read_before_write: bool,
pub overwrite_existing: bool,
pub create_parent_dirs: bool,
pub no_write_policy: NoWritePolicyBehavior,
pub allowed_commands: Vec<CommandRuleConfig>,
pub command_templates: Vec<CommandTemplateConfig>,
pub working_dirs: Vec<String>,
pub env_passthrough: Vec<String>,
pub redact_env: Vec<String>,
pub deny_shell: bool,
pub deny_interactive: bool,
pub allow_command_escalation: bool,
pub domains: DomainPolicyConfig,
pub paths: PathPolicyConfig,
pub commands: CommandPolicyConfig,
pub operations: OperationPolicyConfig,
pub config: HashMap<String, Value>,
}Expand description
Per-tool policy configuration.
Fields§
§enabled: boolEnables this tool policy.
require_confirmation: boolRequires approval for this tool after hard denials pass.
allow_without_confirmation: boolExplicitly permits side-effecting calls to skip classification-default approval.
confirmation_message: Option<String>Message shown when tool-level approval is required.
rate_limit: Option<u32>Maximum allowed calls per minute.
timeout_ms: Option<u64>Tool-specific timeout in milliseconds, up to MAX_TOOL_TIMEOUT_MS.
allowed_domains: Vec<String>Legacy domain allowlist mapped to domain policy.
blocked_domains: Vec<String>Legacy domain blocklist mapped to domain policy.
allowed_paths: Vec<String>Legacy path allowlist mapped to path policy.
read_paths: Vec<String>Explicit read path allowlist for local read-only tools.
write_paths: Vec<String>Explicit write path allowlist for local mutation tools.
blocked_paths: Vec<String>Paths that override any allowlist.
max_file_size_bytes: Option<u64>Maximum file size read or searched by local tools.
max_output_chars: Option<usize>Maximum model-facing output characters.
max_results: Option<usize>Maximum rows or entries for list/search tools.
max_response_bytes: Option<usize>Maximum response bytes for web fetch tools.
blocked_private_networks: boolBlocks private, localhost, link-local, and metadata network targets.
allowed_schemes: Vec<String>Allowed URL schemes for network tools.
allowed_ports: Vec<u16>Allowed URL ports for network tools.
max_redirects: Option<usize>Maximum redirect count for network tools.
max_changed_files: Option<usize>Maximum files a mutation tool may change.
max_changed_lines: Option<usize>Maximum changed lines a mutation tool may produce.
max_replacements: Option<usize>Maximum exact replacements a mutation tool may perform.
require_read_before_write: boolRequires a matching file-read version before mutating an existing file.
overwrite_existing: boolAllows overwriting existing files for mutation tools.
create_parent_dirs: boolAllows mutation tools to create missing parent directories.
no_write_policy: NoWritePolicyBehaviorBehavior when no write_paths allowlist is configured.
allowed_commands: Vec<CommandRuleConfig>Exact argv allowlist for the command tool.
command_templates: Vec<CommandTemplateConfig>Argv templates for the command tool.
working_dirs: Vec<String>Working directories allowed for command execution.
env_passthrough: Vec<String>Environment variables that may be passed from tool arguments.
redact_env: Vec<String>Environment variables redacted from evidence.
deny_shell: boolReject shell-like command strings and metacharacters.
deny_interactive: boolReject interactive command execution.
allow_command_escalation: boolAllows approval-based command escalation beyond the allowlist.
domains: DomainPolicyConfigParsed domain policy.
paths: PathPolicyConfigNormalized path policy.
commands: CommandPolicyConfigCommand policy for process-backed tools.
operations: OperationPolicyConfigOperation policy based on arguments such as operation, function, or method.
config: HashMap<String, Value>Custom tool settings exposed through ToolExecutionContext.custom_config.
Trait Implementations§
Source§impl Clone for ToolPolicyConfig
impl Clone for ToolPolicyConfig
Source§fn clone(&self) -> ToolPolicyConfig
fn clone(&self) -> ToolPolicyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolPolicyConfig
impl Debug for ToolPolicyConfig
Source§impl Default for ToolPolicyConfig
impl Default for ToolPolicyConfig
Source§fn default() -> ToolPolicyConfig
fn default() -> ToolPolicyConfig
Source§impl<'de> Deserialize<'de> for ToolPolicyConfig
impl<'de> Deserialize<'de> for ToolPolicyConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolPolicyConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolPolicyConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ToolPolicyConfig
impl Serialize for ToolPolicyConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ToolPolicyConfig
impl RefUnwindSafe for ToolPolicyConfig
impl Send for ToolPolicyConfig
impl Sync for ToolPolicyConfig
impl Unpin for ToolPolicyConfig
impl UnsafeUnpin for ToolPolicyConfig
impl UnwindSafe for ToolPolicyConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more