Skip to content

feat(agents): add guarded Auto permission presets and per-agent controls - #19244

Closed
nwparker wants to merge 2 commits into
mainfrom
nwparker/redo-auto-perms
Closed

nwparker wants to merge 2 commits into
mainfrom
nwparker/redo-auto-perms

Conversation

@nwparker

@nwparker nwparker commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​544 $\color{#cf222e}{\Huge{\mathbf{−}}}$​25 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​519
Prod 27 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​648 $\color{#cf222e}{\Huge{\mathbf{−}}}$​318 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​330

ELI5

Users who want fewer approval prompts should be able to keep the protections their agent offers. Orca currently exposes only Manual and Yolo globally. This adds an intermediate Auto preset in Settings and onboarding, plus a permission selector inside each installed agent’s launch settings.

For example, choosing Auto changes a standard Claude launch from --dangerously-skip-permissions to --permission-mode auto and a standard Codex launch to --approve-for-me. A harness without a verified Auto preset, such as Amp, falls back to Manual. Custom launch settings remain intact.

What Changed

Settings and onboarding

  • Settings → Agents → Agent Permissions: Manual / Auto / Yolo, with visible explanation of the fallback and preservation rules.
  • Per-agent launch settings: the same control offers Auto only for harnesses with a verified mapping. Selecting a mode updates that agent’s defaults without changing the other agents.
  • Custom configurations: no preset is falsely selected. The global control can update recognized presets while preserving custom arguments and environment values. A custom per-agent profile disables its preset buttons and explains how to edit/reset the fields before using a preset.
  • Onboarding: replaces the Yolo checkbox with the shared three-mode control. Permissions are written only after an explicit selection; continuing with an existing mixed profile does not silently convert it to Yolo.
  • Launch editor: recognized permission changes no longer expand every agent’s advanced editor by default. Empty arguments/environment fields no longer display bypass presets as misleading placeholders.
  • Updated English, Spanish, French, Japanese, Korean, and Chinese catalogs, settings search entries, and required runtime English entries.

Auto mappings

Harness Preset Behavior
Claude Code --permission-mode auto Uses Claude’s permission classifier.
Claude Agent Teams --permission-mode auto Forwards through the existing orca claude-teams wrapper to Claude.
Codex --approve-for-me Routes approvals through automatic review with the workspace-write sandbox.
Gemini CLI --approval-mode auto_edit Automatically approves edit tools; other actions can still prompt.
Qwen Code --approval-mode auto Uses its permission classifier; risky or uncertain actions can still prompt.
Devin CLI --permission-mode smart Uses Smart approval; availability depends on the account/rollout.
Droid --auto medium Uses the intermediate autonomy level; higher-risk actions can still prompt.
goose GOOSE_MODE=smart_approve Automatically approves low-risk actions and asks about higher-risk actions.

The remaining harnesses have no verified intermediate mapping in this change. Global Auto clears recognized Yolo presets for those harnesses to Manual; their per-agent controls omit Auto. This is a supported-preset matrix, not a claim that those tools have no other permission configuration mechanisms.

Vendor evidence and rollout caveats are recorded in docs/reference/agent-permission-presets.md. Auto is not one uniform security policy across vendors.

Permission handling and compatibility

  • Reuses agentDefaultArgs and agentDefaultEnv; no new persisted permission-mode field or stream opcode.
  • Recognizes exact known presets and preserves custom values. A profile containing Auto plus Manual fallbacks is classified as Auto; divergent per-agent choices remain mixed.
  • Keeps the existing launch paths for local hosts, SSH/remote execution, and folder workspaces. Existing default preferences are not migrated automatically.
  • Codex Auto waits remain visible. Unlike full bypass, Auto can still require attention. Regression tests cover waiting/blocked states and genuine request_user_input questions.
  • Advertises settings.agent-permission-auto.v1 through the existing capability mechanism.
  • A new host projects Auto presets to Manual for legacy clients. Unchanged projected settings roundtrips preserve the host’s Auto configuration; attempts by legacy clients to change the permission maps are rejected with an upgrade message while Auto is stored. Unrelated settings updates remain available.
  • Applies the projection to settings reads and settings-bearing update responses, including bot-author updates.

Why

The binary choice made users trade convenience against all available guardrails, even when their CLI supports a middle ground. Harness-specific mappings allow users to choose that middle ground without guessing flags or assuming every tool supports the same mode.

Preserving custom profiles and untouched onboarding state also avoids turning a preference change into an unintended permission escalation.

Linked Issue

Fixes #13081.

Reworks the feature requested in #13348 and the linked follow-up comment. The implementation includes per-agent controls and a verified mapping list; it does not assume every mapping proposed in that PR is supported.

Visual Proof

Actual full-window Electron screenshots, captured via Playwright CDP with ORCA_BACKGROUND_LAUNCH=1. Before views use the pre-change source from e9af947035f; after views show this implementation. Test windows remained hidden. Images are GitHub attachments and are not committed to the PR.

Settings — before and after

Before: Yolo / Manual After: Manual / Auto / Yolo
Before: original two-mode Agent Permissions setting After: Auto selected in Agent Permissions

Onboarding — before and after

Before: Yolo checkbox After: shared permission preset control
Before: Yolo checkbox in onboarding After: Auto selected in onboarding

Unsupported harness — Manual fallback, light theme

Amp exposes only Manual / Yolo and remains Manual after applying global Auto. The empty arguments field does not imply bypass arguments are active.

Amp Manual fallback and empty arguments in light theme

Custom arguments — preserved after applying global Auto

Claude retains --model custom; its individual preset control is disabled with an explanation, while other recognized harness presets use Auto.

Custom Claude arguments preserved after applying Auto

Testing

  • Manually exercised the rendered app locally through Playwright CDP.
  • Automated tests added/updated.

Latest targeted run: 302 tests passed across 26 files, covering preset classification/application, custom preservation, local/remote launch-command construction, Settings controls, onboarding persistence, Codex notifications, legacy-client settings protection, and remote transport handshakes.

Also passed during implementation:

  • pnpm tc — node, CLI, and web typechecks.
  • pnpm run check:code-quality:changed — native, type-aware, and React Doctor gates.
  • pnpm run check:max-lines-ratchet.
  • Localization catalog, runtime catalog, extraction, and coverage checks.
  • Formatting checks and git diff --check; commit hooks passed.
  • Production Electron main/preload/renderer build (pnpm run build:electron-vite), plus the development build used for rendered verification.
Reproduce the targeted test run
ORCA_BACKGROUND_LAUNCH=1 pnpm test \
  src/shared/tui-agent-auto-permission-launch.test.ts \
  src/shared/tui-agent-permissions.test.ts \
  src/shared/tui-agent-startup.test.ts \
  src/renderer/src/components/settings/AgentsPane.test.tsx \
  src/renderer/src/components/settings/AgentPermissionsSetting.test.tsx \
  src/renderer/src/components/onboarding/AgentStep.test.tsx \
  src/renderer/src/components/onboarding/OnboardingFlow.test.tsx \
  src/renderer/src/components/onboarding/use-onboarding-flow-persistence.test.ts \
  src/renderer/src/components/terminal-pane/codex-auto-approval-notification-suppression.test.ts \
  src/main/runtime/rpc/methods/client-permission-projection.test.ts \
  src/shared/remote-runtime-client.test.ts \
  src/shared/remote-runtime-request-connection.test.ts \
  src/shared/remote-runtime-shared-control-connection.test.ts \
  src/renderer/src/web/web-runtime-client.test.ts \
  src/cli/runtime/websocket-transport.test.ts \
  src/renderer/src/components/settings/agent-permission-save-order.test.tsx \
  src/renderer/src/components/settings/agent-availability-settings.test.ts \
  src/main/persistence-settings-update.test.ts \
  src/main/persistence/applying-settings/terminal-settings-migrations.test.ts \
  src/shared/protocol-compat.test.ts \
  src/renderer/src/components/onboarding/use-onboarding-flow.test.ts

ORCA_BACKGROUND_LAUNCH=1 pnpm --dir mobile test \
  src/transport/mobile-runtime-client-capabilities.test.ts \
  src/transport/mobile-runtime-capability-negotiation.test.ts \
  src/transport/protocol-compat.test.ts \
  src/transport/mobile-e2ee-legacy-fixtures.test.ts \
  src/transport/rpc-client-request-deadline.test.ts

Manual review steps

  1. In Settings → Agents, select Auto from a standard Yolo profile. Check Claude/Codex arguments and confirm an unsupported harness uses Manual.
  2. Expand an installed agent’s launch settings and select Manual. Confirm other agents retain their settings and the global profile is shown as custom.
  3. Enter custom arguments, then apply global Auto. Confirm the custom string is preserved and the individual control explains why presets are disabled.
  4. Reopen onboarding with a mixed profile and continue without selecting a permission preset. Confirm the permission maps are unchanged.
  5. Explicitly choose Auto in onboarding and continue. Confirm the supported arguments and unsupported Manual fallbacks are saved.

Readiness review and correctness fixes

Reviewed against $readiness-checklist, including persistence/mobile compatibility, remoting, retries, security, performance, and platform scope. No counsel-validated P0/P1 findings. Three independent reviewers completed findings validation and blind peer ratings; Grok hit its weekly usage limit and produced no report. All completed reviewers classified the save-order issue as P2. They confirmed the underlying global Manual/Yolo race predates this PR; the fix addresses that existing path too.

  • Preserve custom arguments across blur → preset clicks. Previously, a field blur and immediate preset click could both construct whole-map updates from the same render snapshot, so the preset discarded the just-typed value. Argument/environment edits and per-agent/global presets now wait for the preceding save and derive their updates from the latest reconciled settings. The existing availability queue now reuses the same serialization primitive.
  • Keep errors visible and retries possible. Launch-setting saves use the throwing persistence API and show save failures. A rejected write does not poison the next queued action. Queued edits reject if the active server changed before execution. Onboarding also uses throwing persistence, preventing a failed Auto save from advancing the agent step.
  • Match labels to effective launch values. Row and global/onboarding summaries resolve inherited defaults exactly as the launch UI does. Synthetic sparse maps previously showed Manual beside inherited Yolo args. Normal profile migration fills these keys, so counsel treated ordinary production reachability as unproven; this is a defensive consistency fix, not a claimed widespread launch regression.

Expanded validation: 289 desktop tests across 21 files and 13 mobile tests across 5 files pass (302 total). Desktop coverage includes settings persistence/migrations, protocol compatibility, remote request/control and CLI/web transports, onboarding failure/retry, notification behavior, custom-value preservation, and server-switch fencing. Mobile covers capability bounds/negotiation, protocol compatibility, legacy encrypted fixtures, and request deadlines. Full typechecks, changed-code quality, localization catalog/runtime/extraction/coverage, max-lines, and whitespace checks pass. Production Electron bundling passes.

Rendered regression proof: in a hidden macOS Electron renderer, inject 750 ms latency into each real settings save, type --model readiness-proof for Claude, and click global Auto directly from the focused field. The saved Claude value survives, Codex becomes --approve-for-me, and the UI correctly displays a custom global profile. This exercises rendered controls and persistence, with no live agent task launched.

Delayed save preserves custom Claude args while Codex switches to Auto

Remaining limits: no physical SSH network-failure drill, native Windows/Linux/mobile UI, or signed installer validation. The change adds no polling, background subprocesses, dependencies, serialized setting fields, or new network sink. Concurrent edits from separate clients retain existing whole-map last-write-wins semantics; the new queue protects actions within this settings pane.

Review and limits

  • Rendered verification was performed on macOS, in light and dark themes. Screenshots were directly inspected.
  • Unit tests exercise macOS/Linux/Windows launch planning and local/remote flags. Native Windows/Linux UI, a live SSH host, and mobile-device UI were not exercised in this run.
  • No live agent task was run for every vendor/account. Support is based on documented flags and available local CLI help. Older CLI versions or restricted accounts may reject a mode; Orca does not silently retry with bypass.
  • New clients can send these existing args/env fields to older hosts, but an older host cannot enforce the new legacy-client write protection against another concurrent old client. Upgrade the host for that protection.
  • Production Electron bundling (pnpm run build:electron-vite) passes. Full repository pnpm lint, full pnpm test, and complete desktop packaging/signing were not run; normal CI and packaging gates remain required.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer source or artifacts are copied or translated.

Checklist

  • Explained the problem, behavior, and harness-specific differences.
  • Before/after screenshots attached, with fallback and custom-state evidence.
  • Self-reviewed permission preservation and older-client behavior.
  • Cross-platform, SSH/remote, and folder workspace impact considered.
  • Targeted tests, typechecks, code-quality, and localization checks pass.
  • Full CI / production packaging verification complete.

@nwparker
nwparker force-pushed the nwparker/redo-auto-perms branch from 79871e3 to 93f5477 Compare September 7, 2026 22:21
@drvitalaraujo

Copy link
Copy Markdown

Hi @nwparker, thanks for the work on this. Do you have an update on what remains before this PR is ready for review? I noticed it’s still a draft and has merge conflicts. Is anything blocking progress, or is there a part where I could help?

@nwparker

nwparker commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Related active implementation for cross-review: #30677 (agent settings and terminal Auto), with #30853 stacked on it for native-chat defaults. Refs #13081 and #25559.

#30677 exposes Auto only beside Claude, Claude Agent Teams, and Codex, with no global Auto action. #30853 adds per-agent defaults for new native chats; existing chats retain their own modes. Native synchronization requires an explicit mutation opt-in and separate host capability so older clients and hosts retain terminal-only behavior.

The changes overlap AgentCatalogRow, AgentsPane, and tui-agent-permissions. Reconcile global presets versus scoped choices, older-peer handling, and native-chat default seeding before merging both implementations. #14745 is also active for Claude’s live permission-mode picker.

@nwparker

Copy link
Copy Markdown
Contributor Author

Superseded by merged #30677 (the revised global Auto control, Other agents fallback, and per-agent exceptions) and #30853 (native-chat permission defaults). Closing this alternative implementation to avoid duplicate work on #13081. The merged design intentionally limits Auto to Claude, Claude Agent Teams, and Codex; additional harness mappings would be separate follow-up work.

@nwparker nwparker closed this Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support the intermediate permission modes — Claude Code "Auto" mode and Codex "Approve for me"

2 participants