pub enum PermissionMode {
AlwaysAllow,
Auto,
AlwaysAsk,
}Expand description
Controls whether tool calls in CodingMcp require user approval before executing.
When a tool call is gated, the server uses MCP elicitation to ask the user for confirmation before proceeding. Read-only tools (read_file, grep, find, list_files) are never gated regardless of mode.
§Variants
AlwaysAllow(default) – All tools auto-execute without user approval.Auto– File writes auto-execute; bash commands that look destructive (rm,git push --force, redirect operators, etc.) trigger an elicitation prompt.AlwaysAsk– All write, edit, and bash calls trigger an elicitation prompt.
§See also
CodingMcp::with_permission_mode– Set the mode on a server instance.
Variants§
AlwaysAllow
Everything auto-executes (current default behavior).
Auto
File writes auto-execute; destructive bash commands trigger elicitation.
AlwaysAsk
All write/edit/bash calls trigger elicitation; read-only tools are ungated.
Trait Implementations§
Source§impl Clone for PermissionMode
impl Clone for PermissionMode
Source§fn clone(&self) -> PermissionMode
fn clone(&self) -> PermissionMode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PermissionMode
impl Debug for PermissionMode
Source§impl Default for PermissionMode
impl Default for PermissionMode
Source§fn default() -> PermissionMode
fn default() -> PermissionMode
Returns the “default value” for a type. Read more
Source§impl PartialEq for PermissionMode
impl PartialEq for PermissionMode
Source§fn eq(&self, other: &PermissionMode) -> bool
fn eq(&self, other: &PermissionMode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PermissionMode
Source§impl ValueEnum for PermissionMode
impl ValueEnum for PermissionMode
Auto Trait Implementations§
impl Freeze for PermissionMode
impl RefUnwindSafe for PermissionMode
impl Send for PermissionMode
impl Sync for PermissionMode
impl Unpin for PermissionMode
impl UnsafeUnpin for PermissionMode
impl UnwindSafe for PermissionMode
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