Overview
Craft Agents uses a per-session permission mode system to control what actions the agent can perform. Each session maintains its own mode state independently, preventing cross-session contamination.Permission modes are stored per-session and persist across app restarts. Use SHIFT+TAB to cycle between modes.
Three Permission Modes
The agent operates in one of three modes, each with different behavior for tool execution:Explore
Read-only mode
- Blocks all write operations
- Never prompts for approval
- Allows safe exploration without risk
- Green indicator in UI
Ask to Edit
Interactive mode (default)
- Prompts before dangerous operations
- Bash commands require approval
- Balances safety and productivity
- Amber indicator in UI
Execute
Auto-approve mode
- Skips all permission checks
- Everything runs automatically
- Maximum productivity, minimum friction
- Violet indicator in UI
Explore Mode (Safe)
Explore mode provides read-only access to your workspace and connected sources. It’s designed for safe exploration without risk of accidental changes.What’s Blocked
What’s Allowed
In Explore mode, the agent can:- Read files using the Read tool
- Search code with Glob and Grep
- Run safe bash commands matching allowlist patterns
- Call read-only MCP tools (matching patterns)
- Make GET API requests to connected sources
Bash Command Filtering
Explore mode uses regex-based allowlists to determine which bash commands are safe:- Check for dangerous control characters (null bytes)
- Detect PowerShell vs Bash syntax
- Parse command with AST-based validator
- Check each command against allowlist patterns
- Block pipelines, redirects, and substitutions
Compound commands like
git status && git log are allowed if all parts match safe patterns.MCP Tool Filtering
MCP tools are filtered by pattern matching against tool names:Ask to Edit Mode
Ask to Edit is the default mode. The agent prompts for approval before:- Running bash commands
- Modifying files (Write, Edit)
- Making non-GET API requests
- Calling write-capable MCP tools
User Experience
When approval is needed:- Agent pauses execution
- Shows approval dialog with command details
- User approves or rejects
- Agent continues or stops based on response
Approval prompts block the agent until user responds. This ensures you maintain control over dangerous operations.
Execute Mode (Allow All)
Execute mode removes all safety checks. Use this when:- You fully trust the agent’s plan
- You’re implementing well-defined changes
- You want maximum automation
- You’re working in a sandboxed environment
When to Use
Cycling Modes with SHIFT+TAB
Press SHIFT+TAB to cycle through modes in order:Implementation
Custom Mode Cycles
You can configure which modes are available:Per-Session State
Each session maintains independent mode state:State Persistence
Mode state is saved to~/.craft-agent/sessions/{sessionId}.json and restored on app restart:
Sessions remember their last mode. Opening a session always restores its previous permission mode.
API Reference
Get Current Mode
Set Mode
Subscribe to Changes
Get Diagnostics
Best Practices
Start with Ask
Begin new tasks in Ask mode to review what the agent plans to do before execution.
Use Explore for Discovery
Switch to Explore when investigating unfamiliar codebases or exploring data sources.
Execute for Trusted Plans
Once you’ve approved a plan in Ask mode, switch to Execute for faster implementation.
Review Mode Icons
Always check the mode indicator before starting work to avoid unexpected behavior.
Next Steps
Configuration
Customize allowlists and rules via permissions.json
Security Details
Learn about encryption, OAuth, and security architecture