Overview
Every AI agent in HAPI can operate in different permission modes that control how much autonomy the agent has. From fully manual approval to complete automation, you decide the level of control.Per-Agent Modes
Each agent type has its own set of permission modes
Real-Time Switching
Change modes mid-session without restarting
Approval Workflows
Get notified and approve/deny actions from any device
Safe Defaults
Default modes require approval for destructive actions
Permission Modes by Agent
Claude Code
Claude Code supports four permission modes:| Mode | Label | Description | Tone |
|---|---|---|---|
default | Default | Standard approval workflow — requests permission for tool usage | Neutral |
acceptEdits | Accept Edits | Auto-approves file edits but asks for other tools | Warning |
plan | Plan Mode | Creates execution plans for review before running | Info |
bypassPermissions | YOLO | Fully autonomous — no permission requests | Danger |
Codex / Gemini
Codex and Gemini share the same modes:| Mode | Label | Description | Tone |
|---|---|---|---|
default | Default | Standard approval workflow | Neutral |
read-only | Read Only | Agent can only read files, no modifications | Warning |
safe-yolo | Safe YOLO | Auto-approves safe operations, asks for risky ones | Warning |
yolo | YOLO | Fully autonomous — no permission requests | Danger |
OpenCode
OpenCode has simplified modes:| Mode | Label | Description | Tone |
|---|---|---|---|
default | Default | Standard approval workflow | Neutral |
yolo | YOLO | Fully autonomous — no permission requests | Danger |
Cursor Agent
Cursor supports:| Mode | Label | Description | Tone |
|---|---|---|---|
default | Default | Standard approval workflow | Neutral |
plan | Plan Mode | Creates execution plans first | Info |
ask | Ask Mode | Prompts before every action | Info |
yolo | YOLO | Fully autonomous | Danger |
Mode Descriptions
Default Mode
The balanced approach for most workflows:- ✅ Agent requests permission for file edits
- ✅ Agent requests permission for bash commands
- ✅ Agent requests permission for other tools
- ⚠️ You approve/deny via web, PWA, or Telegram
Accept Edits (Claude Code)
Trust the agent with file changes:- ✅ Auto-approves file edits (Write, Edit)
- ❌ Still asks for bash commands
- ❌ Still asks for other tools
Plan Mode (Claude Code, Cursor)
Review before execution:- 📋 Agent creates execution plan
- ⏸️ Pauses for your review
- ✅ You approve the whole plan or iterate
Read-Only (Codex, Gemini)
Explore without risk:- ✅ Agent can read files
- ✅ Agent can search codebase
- ❌ No file modifications
- ❌ No bash commands
Safe YOLO (Codex, Gemini)
Automation with guardrails:- ✅ Auto-approves “safe” operations (reads, writes to existing files)
- ❌ Asks for risky operations (delete, network, installs)
YOLO Mode (All Agents)
Full autonomy:- ✅ Auto-approves everything
- ✅ No interruptions
- ⚠️ Agent has full control
Approval Workflows
Permission Request Flow
Approval Channels
You can approve permissions from:Web App
View details, approve, or deny
PWA
Get push notifications, respond instantly
Telegram
Inline buttons in notifications
Permission Details
When reviewing a permission request, you see:- Tool name (e.g., “Write”, “Bash”, “Edit”)
- Files affected (for file operations)
- Command (for bash operations)
- Context from the agent’s reasoning
Switching Modes
From Web Interface
From API
Via CLI
Start session with specific mode:Use Cases
Exploratory Phase
Start safe, then speed up:- Begin: Use
defaultmode to understand codebase - Trust building: Switch to
acceptEditsfor refactoring - Rapid iteration: Switch to
yolofor quick fixes
Production Hotfixes
Stay cautious:- Always use
defaultorplanmode - Review every change carefully
- Never use
yoloin production
Bulk Refactoring
Balance speed and safety:- Use
planmode for architecture changes - Review the plan
- Switch to
acceptEditsfor execution - Monitor progress
Learning
Understand agent behavior:- Use
defaultmode - Review every permission request
- Learn what the agent wants to do
- Adjust mode as you build trust
Real-Time Notifications
When a permission is requested:Push Notifications (PWA)
Telegram Notifications
In-App
Session shows:- Badge count of pending requests
- Inline approval UI in chat
- Highlighted permission requests
Permission Mode Types
Fromshared/src/modes.ts:
Permission modes are validated at runtime using Zod schemas. Invalid modes are rejected.
Best Practices
Starting a New Project
Starting a New Project
- Use
defaultmode initially - Build trust with the agent over time
- Graduate to
acceptEditsafter confidence - Reserve
yolofor routine tasks
Working with Sensitive Code
Working with Sensitive Code
- Always use
defaultorplanmode - Review every change
- Consider
read-onlyfor analysis - Never use
yoloin production
Rapid Prototyping
Rapid Prototyping
- Start with
yolofor speed - Review changes in git diffs
- Switch to stricter mode for refinement
- Commit often
Team Environments
Team Environments
- Establish team conventions
- Document which modes to use when
- Default to safer modes for junior devs
- Use
planmode for shared codebases
Security Considerations
Sandboxing
HAPI does not sandbox agent actions:- Agent runs with your user permissions
- Has access to all files you can access
- Can run any command you can run
- No containerization or virtualization
Recommended Setup
For safer operation:- Separate machine: Run agents on non-production machine
- Docker container: Run CLI in container for isolation
- Limited user: Run CLI as user with restricted permissions
- Git: Always use version control to review changes
Related Features
Remote Control
Approve permissions from anywhere
Telegram
Get notified and approve via Telegram
PWA
Push notifications for permission requests