Approval Modes
Approval modes are used to control Carry Code’s operation permissions, allowing you to finely control what AI can do.
What are Approval Modes?
Section titled “What are Approval Modes?”Approval modes define what kind of authorization AI needs when executing operations:
- 🔒 Safety first - Only allows safe read operations
- ⚖️ Balanced mode - Allows most operations but requires confirmation
- 🚀 Full access - Allows all operations without confirmation
Three Approval Modes
Section titled “Three Approval Modes”1. Read-Only
Section titled “1. Read-Only”AI can only read files and cannot modify or execute anything.
| Operation | Allowed |
|---|---|
| Read files | ✅ |
| Search files | ✅ |
| Execute commands | ❌ |
| Write files | ❌ |
| Delete files | ❌ |
Use cases:
- Learning code
- Code review
- Problem analysis
2. Agent (Default)
Section titled “2. Agent (Default)”AI can execute most operations but requires user confirmation.
| Operation | Allowed | Confirmation Required |
|---|---|---|
| Read files | ✅ | - |
| Search files | ✅ | - |
| Write files | ✅ | ✅ |
| Execute commands | ✅ | ✅ |
| Delete files | ✅ | ✅ |
Use cases:
- Daily programming
- Code modification
- Task execution
3. Agent-Full
Section titled “3. Agent-Full”AI can execute all operations without confirmation.
| Operation | Allowed |
|---|---|
| Read files | ✅ |
| Search files | ✅ |
| Write files | ✅ |
| Execute commands | ✅ |
| Delete files | ✅ |
Use cases:
- Automated scripts
- Trusted AI operations
- Batch processing
Switching Approval Modes
Section titled “Switching Approval Modes”Command
Section titled “Command”/approvalThen select the mode you want.
Quick Switch
Section titled “Quick Switch”/approval read-only/approval agent/approval agent-fullCombining with Dual Modes
Section titled “Combining with Dual Modes”Approval modes can work with Build/Plan modes:
| Approval Mode | Build Mode | Plan Mode |
|---|---|---|
read-only | ❌ Restricted | ✅ Read-only |
agent | ✅ Executable | ✅ Read-only |
agent-full | ✅ Full access | ✅ Read-only |
Confirmation Mechanism
Section titled “Confirmation Mechanism”Operations Requiring Confirmation
Section titled “Operations Requiring Confirmation”When using agent mode, these operations require confirmation:
- Write files - Create or modify files
- Execute commands - Run shell commands
- Delete files - Delete files or directories
Confirmation Interface
Section titled “Confirmation Interface”When AI requests to execute an operation:
⚠️ Confirmation RequestOperation: Execute commandCommand: npm installAllow? [y/n]Security Recommendations
Section titled “Security Recommendations”Recommended Settings
Section titled “Recommended Settings”| Scenario | Recommended Mode |
|---|---|
| Learning code | read-only |
| Daily development | agent |
| Automated tasks | agent-full |
Security Best Practices
Section titled “Security Best Practices”- Unknown projects → Use
read-only - Daily use → Use
agent - Trust AI → Use
agent-full
Configuration
Section titled “Configuration”Set Default Approval Mode
Section titled “Set Default Approval Mode”Configure in ~/.carry/carrycode.json:
{ "approval": { "mode": "agent", "confirmWrite": true, "confirmDelete": true, "confirmCommand": true }}Parameter Description
Section titled “Parameter Description”| Parameter | Description | Default |
|---|---|---|
mode | Approval mode | agent |
confirmWrite | Confirm when writing | true |
confirmDelete | Confirm when deleting | true |
confirmCommand | Confirm when executing commands | true |
Q: What is the default approval mode?
Section titled “Q: What is the default approval mode?”Default is agent mode, requiring confirmation for sensitive operations.
Q: Can I switch modes using keyboard shortcuts?
Section titled “Q: Can I switch modes using keyboard shortcuts?”You can use /approval <mode-name> for quick switching.
Q: Will approval modes affect AI’s capabilities?
Section titled “Q: Will approval modes affect AI’s capabilities?”No. They only affect execution capabilities, not AI’s analysis and suggestion capabilities.
Q: What options are available when confirming?
Section titled “Q: What options are available when confirming?”| Option | Action |
|---|---|
y | Allow execution |
n | Deny execution |
a | Remember choice, don’t ask again |
Next Steps
Section titled “Next Steps”- Command Reference - All commands
- Themes - Customize the interface
- FAQ - More help