fix(permissions): fail closed on unreadable or invalid settings - #254
Merged
Merged
Conversation
CrazyBoyM
marked this pull request as ready for review
November 2, 2026 17:44
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.
Closes #253.
A settings read/parse failure used to look like an absent file, dropping that source's deny/ask rules and potentially selecting an older
.claudepolicy. Settings now returnnullonly for genuinely missing files and throw a sanitizedSettingsFileErrorfor unreadable files, invalid JSON/root objects, or malformed permission fields. Valid settings, empty policies, unknown keys, and fallback/migration from an absent primary remain supported.CLI and MCP startup validate policy before execution; permission checks also initialize missing contexts before auto-approval. ACP validates before connecting session dependencies. Web session failures return an error, and a failed new-session request closes the socket so queued messages cannot use the old policy. No dependencies or release versions are changed.
Validation:
6ae6f73: Linux full suite 880 pass / 13 conditional skips / 0 fail; Windows focused suite 107 pass / 18 conditional skips / 0 fail; macOS focused suite 142 pass / 12 conditional skips / 0 fail. Format, architecture, typecheck, all three builds, and dependency regression audit passed. The macOS job was retried once after GitHub could not allocate a hosted runner; the retry passed.ed1cfe1and blocked initialization on this branch; no model API was used.ed1cfe1; the lockfile is unchanged. Local sandbox-specific indicator/wrapper/project-root failures also reproduce on base, while the hosted Linux full suite is green.