Plandex: one-time "Debug in full auto mode" menu choice during a failed apply silently rewrites the server-sid
Summary
In Plandex's CLI, when an executed command fails during plandex apply / plandex tell --auto-continue, the user is offered an emergency menu. Choosing "Debug in full auto mode" — an option that reads like a one-off, this-run escape hatch — actually (1) calls the server UpdatePlanConfig API to permanently set the plan's AutoMode to AutoModeFull, which flips AutoApply, AutoCommit, CanExec, AutoExec and AutoDebug to true in the persisted config, and (2) additionally forces in-session flags (AutoExec, ExecEnabled, AutoApply, AutoCommit) for the current run. Because PlanConfig is stored on the plans row keyed only by planId, the elevated autonomy applies to every branch of the plan and every future session, with no explicit confirmation that the change is persistent and no disclosure of its scope. plandex apply --full performs the same permanent server-side rewrite silently in the background.
The user's decision is thus generalized from "debug this one failure automatically" into "grant standing full autonomy to this plan indefinitely" — a verdict-scope escalation: the approval's effective scope (permanent, plan-wide, including autonomous command execution and auto-commit) far exceeds what the menu label expresses (a recovery action for the current failure).
Affected
Plandex, app + shared modules, commit e2d7720 (e2d772072efadbe41d2946d97d79be55532dbab5, current latest: "link to cloud wind down post"). Verified by static read-only analysis.
Code path
app/cli/plan_exec/apply_exec.go:47— menu option"Debug in full auto mode"offered bygetOnApplyExecFailwhen execution fails (:44-56,:58).app/cli/plan_exec/apply_exec.go:70-85— on selection, the CLI fetches the current plan config and, ifconfig.AutoMode != shared.AutoModeFull, callsconfig.SetAutoMode(shared.AutoModeFull)(:77-78) and persists it server-side viaapi.Client.UpdatePlanConfig(lib.CurrentPlanId, shared.UpdatePlanConfigRequest{Config: config})(:79-85).app/cli/plan_exec/apply_exec.go:89-97— the same branch silently forces the current run's flags:applyFlags.AutoCommit = true(:89),AutoConfirm = true(:90),applyFlags.AutoExec = true(:91),tellFlags.AutoApply = true(:94),tellFlags.ExecEnabled = true(:96).app/cli/plan_exec/apply_exec.go:100-102— the only feedback is a local"✅ Full auto mode enabled"line; nothing states the setting has been written to the server, that it outlives the run, or that it now covers all branches and future sessions of the plan (and no confirmation is asked before persisting).app/shared/plan_config.go:128-145—SetAutoMode(AutoModeFull)setsAutoContinue,AutoBuild,AutoUpdateContext,AutoLoadContext,SmartContext,AutoApply,AutoCommit,CanExec,AutoExec,AutoDebug,AutoDebugTries,AutoRevertOnRewind— i.e. the persisted config now grants autonomous apply + execution + commit.app/cli/cmd/apply.go:20and:34-41—plandex apply --fullcallsresolveAutoModeSilent(config), which performs the identical server-sideUpdatePlanConfigwrite; the spinner-wrapped call gives no explicit persistence prompt (only a post-hoc auto-mode table print viaprintFn()atapply.go:40).app/cli/cmd/plan_start_helpers.go:67-109—resolveAutoModeWithArgs(..., silent = true): maps--fulltoshared.AutoModeFull(:78-79) and, when it differs from the current mode, callsapi.Client.UpdatePlanConfig(lib.CurrentPlanId, ...)(:86-90) with no interactive confirmation.app/server/db/plan_config_helpers.go:11-22, 24-38—GetPlanConfig/StorePlanConfigread/write theplan_configcolumn of theplanstableWHERE id = $1(planId only, no branch scoping): the config is shared by all branches and all later sessions of the plan. Server side:PUT /{prefix}/plans/{planId}/config→UpdatePlanConfigHandler(app/server/routes/routes.go:183,app/server/handlers/plan_config.go:56-89).
Scenario
- A developer runs
plandex applyon a plan; a generated command fails. - Under time pressure they pick "Debug in full auto mode", expecting the agent to retry debugging this failure on its own.
- The CLI quietly issues a permanent config write: the plan (all branches, all future sessions) is now
AutoModeFull— the model can apply changes without approval, execute shell commands without approval, and auto-commit them. - Days later, a collaborator opens a different branch of the same plan and runs an ordinary session; their work is applied, executed and committed automatically with no approval gate, because the emergency choice made earlier is still in force. Nothing in their session tells them why, and
apply --fullkeeps re-asserting the same persistent state.
Impact
- One-time emergency choice becomes standing full authority: a selection whose label promises a recovery action for the current failure silently downgrades the human-approval gate (apply / exec / commit) to permanently-off for the whole plan.
- Cross-branch and cross-session blast radius: because
PlanConfigis keyed byplanIdalone (app/server/db/plan_config_helpers.go:11-38), the elevated autonomy covers every branch and every future session, including those started by other collaborators who never made the choice. - Autonomous code execution + auto-commit:
AutoExec/CanExecplusAutoCommitmean the model's commands run and are committed without per-step confirmation — a materially larger action surface than the user consented to at the menu. - No persistence echo / no revocation hint: the local "✅ Full auto mode enabled" line does not reveal that the state was stored server-side and is plan-wide, so users are unlikely to know they must manually revert it (via config) to restore approval gates.
This is a verdict-scope/consent-lifetime defect rather than an authentication bypass: the user does make a choice, but its recorded meaning is much broader than its expressed meaning.
Suggested fix
Either:
- Make the grant session-scoped — on "Debug in full auto mode", set the full-auto flags only on the in-flight
applyFlags/tellFlagsfor the current recovery run (already done atapply_exec.go:89-97) and do not callUpdatePlanConfig; or - Confirm before persisting, with explicit scope — keep the persistence, but ask an explicit confirmation dialog that states the scope ("Permanently enable full auto mode for this plan? This applies to all branches and future sessions, and lets the agent apply, execute and commit changes without approval."), and print a clear persistent-state notice (
Full auto mode is now saved for this plan — all branches and future sessions) plus a one-shot command/hint to revert it.
Additionally, surface the current persisted AutoMode at session start (e.g. a banner when AutoModeFull is active) so plan-wide autonomy is never invisible to other sessions/branches.
Reported by Chengzhi Yi (GitHub @Tardfyou) — [email protected]. Static read-only analysis of the public repository (commit e2d7720 / e2d772072efadbe41d2946d97d79be55532dbab5, latest); no system was accessed and no request was submitted to any platform.
Source: plandex-ai/plandex