Permission System Deep Dive
Overview
The permission system is a multi-layered security framework that controls what Claude can do. It ranges from simple allow/deny rules to sophisticated AI-powered classification.
Plain text
┌─────────────────────────────────────────────────────────────────────────────┐
│ PERMISSION SYSTEM LAYERS │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ LAYER 5: AI CLASSIFICATION (Auto Mode) │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ LLM evaluates: "Is this operation safe?" │ │
│ │ Input: Tool name, arguments, file paths, git status │ │
│ │ Output: SAFE / ASK / DENY │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │ │
│ LAYER 4: MODE OVERRIDE │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Mode: default / auto / bypass │ │
│ │ │ │
│ │ default: Ask for dangerous operations │ │
│ │ auto: AI classifies, then auto-allow/deny │ │
│ │ bypass: Allow everything (enterprise policy permitting) │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │ │
│ LAYER 3: RULES ENGINE │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ alwaysAllowRules: Glob patterns for trusted paths/commands │ │
│ │ alwaysDenyRules: Glob patterns for forbidden operations │ │
│ │ alwaysAskRules: Force prompts for specific patterns │ │
│ │ │ │
│ │ Example: { pattern: "**/node_modules/**", action: "deny" } │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │ │
│ LAYER 2: TOOL PERMISSION LEVEL │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ background: Always allow (reading files, searching) │ │
│ │ user: Show indicator (moderate risk) │ │
│ │ dangerous: Require approval (write, delete, execute) │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │ │
│ LAYER 1: POLICY LIMITS (Enterprise) │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Organization-defined global restrictions: │ │
│ │ - allow_remote_control: false │ │
│ │ - allow_auto_mode: false │ │
│ │ - blocked_domains: ["evil.com"] │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘