feat: YOLO Mode — Auto-Approve All Permission Prompts #8359

Open
opened 2026-02-16 18:09:46 -05:00 by yindo · 1 comment
Owner

Originally created by @mguttmann on GitHub (Feb 2, 2026).

Originally assigned to: @thdxr on GitHub.

Summary

Add a YOLO mode that automatically approves all tool permission prompts (while still respecting explicit deny rules in config).

Motivation

Power users who fully trust OpenCode's actions often find permission prompts disruptive to their workflow. YOLO mode lets them skip all "ask" prompts while maintaining safety through explicit deny rules.

This is useful for:

  • Automated/CI workflows where no human is available to approve
  • Experienced users who want uninterrupted coding sessions
  • Quick prototyping where speed matters more than review

Changes

Backend (packages/opencode)

  • Yolo namespace (yolo/index.ts): Enable/disable/toggle with bus events
  • Flag (flag/flag.ts): OPENCODE_YOLO env var support
  • Permission (permission/next.ts): Auto-approve "ask" rules when YOLO is active (explicit "deny" rules are always respected)
  • Bootstrap (project/bootstrap.ts): Initialize YOLO on startup from config
  • Config (config/config.ts): yolo: boolean field
  • Server routes (server/routes/config.ts): GET/POST /config/yolo endpoints

Frontend (packages/app)

  • Settings UI (settings-general.tsx): YOLO section with:
    • "This Session Only" toggle (resets on restart)
    • "Always Enabled" toggle (persists to config.json)
    • CLI usage reference (opencode --yolo, OPENCODE_YOLO=true)
    • Warning about dangers

SDK

  • Regenerated with YOLO endpoints

Safety

  • Explicit deny rules in permission config are always respected, even in YOLO mode
  • Only "ask" rules are auto-approved
  • Clear warnings in the UI about the risks
  • Session-only mode available for temporary use

Related

Split from #9971 (closed) for cleaner review.

Originally created by @mguttmann on GitHub (Feb 2, 2026). Originally assigned to: @thdxr on GitHub. ## Summary Add a YOLO mode that automatically approves all tool permission prompts (while still respecting explicit `deny` rules in config). ## Motivation Power users who fully trust OpenCode's actions often find permission prompts disruptive to their workflow. YOLO mode lets them skip all "ask" prompts while maintaining safety through explicit deny rules. This is useful for: - Automated/CI workflows where no human is available to approve - Experienced users who want uninterrupted coding sessions - Quick prototyping where speed matters more than review ## Changes ### Backend (`packages/opencode`) - **Yolo namespace** (`yolo/index.ts`): Enable/disable/toggle with bus events - **Flag** (`flag/flag.ts`): `OPENCODE_YOLO` env var support - **Permission** (`permission/next.ts`): Auto-approve "ask" rules when YOLO is active (explicit "deny" rules are always respected) - **Bootstrap** (`project/bootstrap.ts`): Initialize YOLO on startup from config - **Config** (`config/config.ts`): `yolo: boolean` field - **Server routes** (`server/routes/config.ts`): `GET/POST /config/yolo` endpoints ### Frontend (`packages/app`) - **Settings UI** (`settings-general.tsx`): YOLO section with: - "This Session Only" toggle (resets on restart) - "Always Enabled" toggle (persists to config.json) - CLI usage reference (`opencode --yolo`, `OPENCODE_YOLO=true`) - Warning about dangers ### SDK - Regenerated with YOLO endpoints ## Safety - Explicit `deny` rules in permission config are **always respected**, even in YOLO mode - Only "ask" rules are auto-approved - Clear warnings in the UI about the risks - Session-only mode available for temporary use ## Related Split from #9971 (closed) for cleaner review.
Author
Owner

@mguttmann commented on GitHub (Feb 2, 2026):

Image
@mguttmann commented on GitHub (Feb 2, 2026): <img width="734" height="431" alt="Image" src="https://github.com/user-attachments/assets/b043ce1c-a25a-43e9-a128-be803105abe5" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8359