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 asks the user for confirmation via MCP elicitation delivered through the MRTR pattern (MCP 2026-07-28): the call returns an InputRequiredResult with an allow/deny form, and the client retries the call with the decision — the gated tool only executes on an allowed retry. Clients that cannot elicit (no elicitation capability, or protocol older than 2026-07-28) get a tool error for gated calls.
Which tools are gated is derived from each tool’s destructive_hint annotation, so tools declared destructive (write_file, edit_file, bash, lsp_rename, and any future ones) are covered automatically. Read-only tools 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– Every destructive-annotated tool call triggers 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
Every destructive-annotated tool call triggers elicitation; read-only tools are ungated.
Trait Implementations§
Source§impl Clone for PermissionMode
impl Clone for PermissionMode
Source§impl Debug for PermissionMode
impl Debug for PermissionMode
Source§impl Default for PermissionMode
impl Default for PermissionMode
Source§impl PartialEq for PermissionMode
impl PartialEq for PermissionMode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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