fix(settings): default permission mode is 'default', not 'bypass' (fail-closed) - #261
Merged
Merged
Conversation
…il-closed) Flip DEFAULT_PERMISSION_MODE from bypass to default. A spawn that doesn't specify a permissionMode now asks before each privileged action instead of skipping all prompts. The bypass default proved fragile — it emits --dangerously-skip-permissions (refused by claude under CI/root) and silently granted full autonomy to any spawn that forgot a mode. Migration of EXISTING records is unchanged (autonomousMode:true still → bypass), so configured installs keep their behavior; only fresh/unspecified spawns get the safe default. The built-in dispatcher/team-lead/feature-worker templates follow the new default (ask-first) per Terry. Reverts the now-unneeded integration-test permissionMode pins; updates MCP descriptions + schema default; ADR-045 update note. See ADR-045 (Update 2026-06-26). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UYB9dBo9Ap9ViBYKERneu7
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UYB9dBo9Ap9ViBYKERneu7
aterrylu
enabled auto-merge (squash)
June 27, 2026 06:13
nox-0x
approved these changes
Jun 27, 2026
nox-0x
left a comment
Collaborator
There was a problem hiding this comment.
Approving — fail-closed default flip is the right call, migration of existing records is preserved, and the four integration-test pins reverting to the implicit default double as a regression guard against re-flipping to bypass.
Verified end-to-end:
DEFAULT_PERMISSION_MODEflips to"default";permission-modes.test.tsandstore-migration.test.tsassertions pin the new value, including the "missing both fields" and "malformed string" fallback paths (packages/server/src/__tests__/store-migration.test.ts:83,91).permissionModeFromLegacyis untouched, so existingautonomousMode:truerecords still map tobypass(no silent demotion on upgrade). Dashboard persistmerge()keeps a savedbypassfor existing local installs (packages/dashboard/src/store.ts:2046-2057).- Built-in templates seed
permissionMode: DEFAULT_PERMISSION_MODE, so fresh installs adopt the safe default while pre-seeded~/.autonomos/templates/*.jsonfiles keep their values (seed only runs when the dir is empty —templates.ts:142). routes/agents.tsinvalid-mode comment correctly updated to "template/default" — the resolution chain (isPermissionMode(body) ? body : tmpl?.permissionMode ?? DEFAULT_PERMISSION_MODE) matches the new wording.channel-server/dist.mjsregenerated to matchmcp/tools.ts(bothTOOL_CREATE_AGENTdefault +TOOL_CREATE_TEMPLATEdescription).CreateAgentPanel.dom.test.tsxexpectation flip is consistent with the actual code path: auto-default setsselectedTemplatebut not the mode (onlyselectTemplate()readstmpl.permissionMode), so the global default flows through — verified atCreateAgentPanel.tsx:85-95vs:129-137.
No silent failure modes, no API contract breaks, no missing coverage. Senior-engineer bar cleared.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fast-follow to #257 (ADR-045): flip
DEFAULT_PERMISSION_MODEfrombypasstodefault(fail-closed). A spawn that doesn't specify apermissionModenow asks before each privileged action instead of skipping all permission prompts.Why
The original ADR-045 cut shipped
bypassas the default to mirror the old pervasiveautonomousMode ?? true. That proved fragile — and the #257 babysit run proved it concretely:bypassemits--dangerously-skip-permissions, which the real Claude Code binary refuses under CI / root — it broke 3RUN_INTEGRATION-gated suites that localmake checkcan't see.A safe default matters more than mirroring the old autonomy. Callers that want autonomy set
bypassexplicitly (Settings/Create-Agent UI, MCP, templates all still offer it).Scope
DEFAULT_PERMISSION_MODE: "bypass" → "default"(core).permissionModepins added during the feat(settings): per-provider permission modes (replaces autonomousMode) #257 CI saga — they now spawn via the real default (CI-safe), and double as a guard: if anyone flips the default back tobypass, these break in CI, auto-surfacing the lesson.defaultfield; flipped the DEFAULT-derived test assertions; regeneratedchannel-server/dist.mjs.dispatcher/team-lead/feature-workertemplates follow the new default (ask-first) — confirmed with Terry.Backward compat (unchanged)
Migration of existing records is untouched:
permissionModeFromLegacystill maps oldautonomousMode: true → bypass,false → default. Already-configured installs keep their behavior; only fresh/unspecified spawns get the safe default. An autonomous template (autonomousMode: true) still migrates tobypass, not silently demoted.Testing
make checkgreen: 610 server + 31 dashboard test files.default→ no flag → CI-safe end-to-end.Also
Claude
defaultmode emits no flag (the redundant--permission-mode defaultwas perturbing interactive-TUI startup timing) — carried over from the #257 fix, documented here.🤖 Generated with Claude Code
https://claude.ai/code/session_01UYB9dBo9Ap9ViBYKERneu7