Skip to content

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

@mguttmann

Description

@mguttmann

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions