#[non_exhaustive]pub enum ToolPolicy {
Default,
McpOnly,
Web,
}Expand description
Which tools the agent may use during a run.
ToolPolicy::Default keeps each CLI’s historical settings (see the README). The other
policies never give the agent a shell, file access or code execution: a CLI that cannot
enforce a requested policy fails with Error::InvalidRequest instead of running with more
power.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Default
The CLI’s previous behaviour (Claude: bypassPermissions; Codex: read-only sandbox).
McpOnly
Only tools from the request’s MCP servers. Supported by Claude and Codex.
Web
MCP tools plus the CLI’s built-in web search and fetch. Supported by Claude and Codex.
Trait Implementations§
Source§impl Clone for ToolPolicy
impl Clone for ToolPolicy
impl Copy for ToolPolicy
Source§impl Debug for ToolPolicy
impl Debug for ToolPolicy
Source§impl Default for ToolPolicy
impl Default for ToolPolicy
impl Eq for ToolPolicy
Source§impl Hash for ToolPolicy
impl Hash for ToolPolicy
Source§impl PartialEq for ToolPolicy
impl PartialEq for ToolPolicy
impl StructuralPartialEq for ToolPolicy
Auto Trait Implementations§
impl Freeze for ToolPolicy
impl RefUnwindSafe for ToolPolicy
impl Send for ToolPolicy
impl Sync for ToolPolicy
impl Unpin for ToolPolicy
impl UnsafeUnpin for ToolPolicy
impl UnwindSafe for ToolPolicy
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
Mutably borrows from an owned value. Read more