Repository navigation
Conversation
When ~/.continue/permissions.yaml exists but cannot be parsed, the CLI previously treated that the same as a missing file and fell through to the permissive headless defaults (Bash/*: allow). A typo or truncated write therefore silently unlocked tools the user had put behind ask. Make the loader tri-state (absent / valid / unreadable). On unreadable, resolvePermissionPrecedence inserts a fail-closed "*": ask policy ahead of defaults, and addPolicyToYaml refuses to rewrite the file from an empty config so remaining rules are not permanently dropped. Fixes continuedev#13461 Signed-off-by: GokayAI <60583610+gokay-ai@users.noreply.github.com>
gokay-ai
requested review from
sestinj
and
a balanced review from Copilot
and removed request for
a team
November 6, 2026 10:30
Signed-off-by: GokayAI <60583610+gokay-ai@users.noreply.github.com>
eslint import/order requires newlines-between builtin and external. Signed-off-by: GokayAI <60583610+gokay-ai@users.noreply.github.com>
3 tasks done
This branch has not been deployed
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.
Description
~/.continue/permissions.yamlis how users mark tools asask/exclude. When that file exists but cannot be parsed (syntax error, wrong value type, unknown key), the loader previously returned the samenullas for a missing file. In headless / CI (cn -p) the remaining defaults then allowBashand*, so a typo silently unlocks tools the user had put behind confirmation.This change makes loading tri-state (
absent/valid/unreadable):resolvePermissionPrecedenceinserts a fail-closed{ tool: "*", permission: "ask" }ahead of defaults (first match wins, so headlessBash/*: allow cannot unlock execution).addPolicyToYamlrefuses to rewrite the file from an empty config when unreadable, so a later "always allow" choice cannot permanently drop the remaining rules.Fixes #13461
Testing
cd extensions/cli npx vitest run src/permissions/permissionsYamlFailClosed.test.ts \ src/permissions/permissionsYamlLoader.test.ts \ src/permissions/precedenceResolver.test.ts \ src/permissions/policyWriter.test.ts36 tests passed (7 new fail-closed cases covering absent / valid / invalid structure / YAML parse error / headless unlock prevention / valid ask still applied / writer refusal).
Checklist