Skip to content

PermissionGate ​

Category: Orchestrator

Source: permission_gate.dart

Enums ​

PermissionDecision ​

ValueDescription
allow
ask
deny

Classes ​

PermissionGate ​

Pure permission decision logic for tool calls.

Combines [ApprovalMode] (confirm vs auto) with per-tool trust and the user's trusted-tool allowlist.

Constructor ​

dart
const PermissionGate({
    required this.approvalMode,
    required this.trustedTools,
    required this.tools,
    required this.cwd,
  })

Properties ​

PropertyTypeDescription
approvalModeApprovalMode
trustedToolsSet<String>
toolsMap<String, Tool>
cwdString

Methods ​

PermissionDecision resolve(ToolCall call) ​
bool isTrusted(String toolName) ​
bool needsEarlyConfirmation(String toolName) ​

Whether this tool needs confirmation at ToolCallPending time.

Released under the MIT License.