Auto-Approval Mode (--yes)
Overview
The --yes (or -y) flag enables auto-approval mode, which disables all confirmation prompts and allows the AI to execute operations immediately without asking for permission.
This is useful when you trust the AI completely and want maximum automation without interruption.
Quick Start
What Changes with --yes?
Without --yes (Default Behavior)
The AI may be cautious and ask for confirmation before executing sensitive operations:
Example conversation:
With --yes (Auto-Approval Mode)
The AI immediately executes the requested operation without asking:
Example conversation:
Behavior Changes
When --yes is enabled, the AI receives these instructions:
- Execute file writes immediately - No confirmation needed for creating/updating files
- Run shell commands directly - No permission prompts for command execution
- Delete/modify files without hesitation - Trust user intent completely
- Skip safety prompts - User has explicitly disabled all warnings
- Only reject impossible/dangerous operations - Like
rm -rf /or system-breaking commands
Use Cases
✅ When to Use --yes
- Batch operations: Processing multiple files or tasks automatically
- Trusted environment: Running in your own development environment
- Known safe operations: File edits, documentation updates, code generation
- CI/CD pipelines: Automated workflows where manual approval isn't feasible
- Power users: You understand the risks and want maximum efficiency
❌ When NOT to Use --yes
- Production servers: Direct operations on live systems
- Shared environments: Multi-user systems where mistakes affect others
- Learning/testing: First time using a feature or command
- Uncertain operations: When you're not sure what will happen
- Sensitive data: Operations involving credentials, keys, or private information
Safety Considerations
What --yes Does NOT Disable
Even with auto-approval enabled, the AI will still refuse:
- Destructive system commands:
rm -rf /,mkfs,dd if=/dev/zero - Dangerous operations: Deleting critical system files or directories
- Impossible operations: Tasks that would break the system
- Out-of-scope actions: Operations outside the AI's capabilities
What You Should Still Monitor
- File system changes (use
git statusto track) - Shell command outputs (check logs with
--debug) - Network operations (external API calls, downloads)
- Resource usage (CPU, memory, disk space)
Examples
Example 1: Documentation Update
Without --yes:
With --yes:
Example 2: Batch File Operations
Without --yes:
With --yes:
Example 3: Code Generation
Without --yes:
With --yes:
Command Reference
Global Flag
- Flag:
--yesor-y - Scope: Global (works with all commands)
- Default:
false(auto-approval disabled) - Type: Boolean (no value needed)
Combining with Other Flags
Environment Variables
Currently, auto-approval can only be enabled via command-line flag. There is no environment variable equivalent.
If you need persistent auto-approval, consider:
-
Creating a shell alias:
-
Using a wrapper script:
Troubleshooting
AI Still Asks for Confirmation
Possible causes:
-
Flag placed incorrectly (must be before subcommand):
-
Using old binary (rebuild after updating):
How to Verify Auto-Approval is Enabled
Check the logs at startup:
In verbose mode, you should see the system prompt includes:
Best Practices
-
Version Control: Always use
--yesin git-tracked directories- Easy to review changes:
git diff - Easy to undo mistakes:
git reset --hard
- Easy to review changes:
-
Start with
--debug: First time using auto-approval?This shows all operations being performed.
-
Test in Safe Directory: Try auto-approval in a test folder first
-
Review Regularly: Periodically check what was changed
-
Use with Specific Tasks: Enable only for specific operations
Security Notes
- Not a Security Feature:
--yesis about convenience, not security - Trust Required: Only use when you trust the AI's judgment
- Audit Trail: Always keep logs (
--log verbose) when using auto-approval - Backup First: Have backups before enabling auto-approval on important files
- Gradual Adoption: Start with read-only tasks, then gradually enable for writes
Comparison Table
| Feature | Without --yes | With --yes |
|---|---|---|
| File writes | May ask for confirmation | Executes immediately |
| File deletions | May ask for confirmation | Executes immediately |
| Shell commands | May ask for confirmation | Executes immediately |
| Dangerous operations | Blocked + warning | Blocked + warning |
| Read operations | Always allowed | Always allowed |
| User experience | Safer, more prompts | Faster, fewer prompts |
| Best for | Exploratory tasks, learning | Automation, batch processing |
Related Flags
--debug: Enable debug mode (shows all operations)--log <level>: Set logging level (silent, info, verbose, very-verbose)--debug-dir <path>: Set debug screenshot directory
FAQ
Q: Can I set auto-approval as default?
A: Currently no. You must explicitly pass --yes each time. This is by design for safety.
Q: Does --yes bypass all security checks?
A: No. It only disables confirmation prompts. Dangerous operations (like rm -rf /) are still blocked.
Q: Can I use --yes with the MCP server mode?
A: The --yes flag currently only affects the router command. Other commands may not support it.
Q: What if I want to cancel after using --yes?
A: Use Ctrl+C to stop the program at any time. This works with or without --yes.
Q: Does --yes make operations faster?
A: No. It only removes confirmation prompts. The actual operations take the same time.
See Also
- Browser Debug Mode - Debug browser automation
- Global Flags - All available global flags
- Security Configuration - Configure security settings