docs/users/features/approval-mode.md
Qwen Code offers four distinct permission modes that allow you to flexibly control how AI interacts with your code and system based on task complexity and risk level.
| Mode | File Editing | Shell Commands | Best For | Risk Level |
|---|---|---|---|---|
| Plan | ❌ Read-only analysis only | ❌ Not executed | • Code exploration | |
| • Planning complex changes | ||||
| • Safe code review | Lowest | |||
| Default | ✅ Manual approval required | ✅ Manual approval required | • New/unfamiliar codebases | |
| • Critical systems | ||||
| • Team collaboration | ||||
| • Learning and teaching | Low | |||
| Auto-Edit | ✅ Auto-approved | ❌ Manual approval required | • Daily development tasks | |
| • Refactoring and code improvements | ||||
| • Safe automation | Medium | |||
| YOLO | ✅ Auto-approved | ✅ Auto-approved | • Trusted personal projects | |
| • Automated scripts/CI/CD | ||||
| • Batch processing tasks | Highest |
[!tip]
You can quickly cycle through modes during a session using Shift+Tab (or Tab on Windows). The terminal status bar shows your current mode, so you always know what permissions Qwen Code has.
Plan Mode instructs Qwen Code to create a plan by analyzing the codebase with read-only operations, perfect for exploring codebases, planning complex changes, or reviewing code safely.
Turn on Plan Mode during a session
You can switch into Plan Mode during a session using Shift+Tab (or Tab on Windows) to cycle through permission modes.
If you are in Normal Mode, Shift+Tab (or Tab on Windows) first switches into auto-edits Mode, indicated by ⏵⏵ accept edits on at the bottom of the terminal. A subsequent Shift+Tab (or Tab on Windows) will switch into Plan Mode, indicated by ⏸ plan mode.
Use the /plan command
The /plan command provides a quick shortcut for entering and exiting Plan Mode:
/plan # Enter plan mode
/plan refactor the auth module # Enter plan mode and start planning
/plan exit # Exit plan mode, restore previous mode
When you exit Plan Mode with /plan exit, your previous approval mode is automatically restored (e.g., if you were in Auto-Edit before entering Plan Mode, you'll return to Auto-Edit).
Start a new session in Plan Mode
To start a new session in Plan Mode, use the /approval-mode then select plan
/approval-mode
Run "headless" queries in Plan Mode
You can also run a query in Plan Mode directly with -p or prompt:
qwen --prompt "What is machine learning?"
/plan I need to refactor our authentication system to use OAuth2. Create a detailed migration plan.
Qwen Code enters Plan Mode and analyzes the current implementation to create a comprehensive plan. Refine with follow-ups:
What about backward compatibility?
How should we handle database migration?
// .qwen/settings.json
{
"permissions": {
"defaultMode": "plan"
}
}
Default Mode is the standard way to work with Qwen Code. In this mode, you maintain full control over all potentially risky operations - Qwen Code will ask for your approval before making any file changes or executing shell commands.
Turn on Default Mode during a session
You can switch into Default Mode during a session using Shift+Tab (or Tab on Windows) to cycle through permission modes. If you're in any other mode, pressing Shift+Tab (or Tab on Windows) will eventually cycle back to Default Mode, indicated by the absence of any mode indicator at the bottom of the terminal.
Start a new session in Default Mode
Default Mode is the initial mode when you start Qwen Code. If you've changed modes and want to return to Default Mode, use:
/approval-mode default
Run "headless" queries in Default Mode
When running headless commands, Default Mode is the default behavior. You can explicitly specify it with:
qwen --prompt "Analyze this code for potential bugs"
/approval-mode default
I need to add user profile pictures to our application. The pictures should be stored in an S3 bucket and the URLs saved in the database.
Qwen Code will analyze your codebase and propose a plan. It will then ask for approval before:
You can review each proposed change and approve or reject it individually.
// .qwen/settings.json
{
"permissions": {
"defaultMode": "default"
}
}
Auto-Edit Mode instructs Qwen Code to automatically approve file edits while requiring manual approval for shell commands, ideal for accelerating development workflows while maintaining system safety.
# Switch via command
/approval-mode auto-edit
# Or use keyboard shortcut
Shift+Tab (or Tab on Windows) # Switch from other modes
npm testYOLO Mode grants Qwen Code the highest permissions, automatically approving all tool calls including file editing and shell commands.
[!warning]
Use YOLO Mode with caution: AI can execute any command with your terminal permissions. Ensure:
- You trust the current codebase
- You understand all actions AI will perform
- Important files are backed up or committed to version control
# Temporarily enable (current session only)
/approval-mode yolo
# Set as project default
/approval-mode yolo --project
# Set as user global default
/approval-mode yolo --user
// .qwen/settings.json
{
"permissions": {
"defaultMode": "yolo",
"confirmShellCommands": false,
"confirmFileEdits": false
}
}
# Fully automated refactoring task
qwen --prompt "Run the test suite, fix all failing tests, then commit changes"
# Without human intervention, AI will:
# 1. Run test commands (auto-approved)
# 2. Fix failed test cases (auto-edit files)
# 3. Execute git commit (auto-approved)
During a Qwen Code session, use Shift+Tab (or Tab on Windows) to quickly cycle through the four modes:
Default Mode → Auto-Edit Mode → YOLO Mode → Plan Mode → Default Mode
// Project-level: ./.qwen/settings.json
// User-level: ~/.qwen/settings.json
{
"permissions": {
"defaultMode": "auto-edit", // or "plan" or "yolo"
"confirmShellCommands": true,
"confirmFileEdits": true
}
}