Repository navigation
feat(permission)!: scope path rules to native file tools - #835
Merged
Merged
Conversation
hakula139
force-pushed
the
refactor/native-permission-scope
branch
from
November 7, 2026 14:38
76ae2ca to
f00dae1
Compare
hakula139
force-pushed
the
refactor/native-permission-scope
branch
from
November 7, 2026 14:56
45ff7ad to
89abc8d
Compare
hakula139
force-pushed
the
feat/auto-permission-classifier
branch
from
November 7, 2026 15:11
308192d to
d95e96e
Compare
hakula139
force-pushed
the
feat/auto-permission-classifier
branch
from
November 7, 2026 15:22
4f3fead to
21e8d11
Compare
hakula139
force-pushed
the
refactor/native-permission-scope
branch
from
November 7, 2026 15:25
d00f81b to
b597862
Compare
hakula139
added a commit
that referenced
this pull request
Nov 7, 2026
## Summary Make `auto` the default permission mode and use a configurable Haiku-class model to allow unmatched actions or request user approval. Explicit deny and ask rules, read-only plan mode, and session grants take precedence. Operations confined to session state run after configured deny and ask checks. The classifier uses the existing endpoint and credentials, full validated action input, and user-authored context. Failures and invalid decisions ask for approval. Classifier usage is billed under its own model without changing the main model's context estimate. Remove shipped discretionary rules, protected-name groups, and implicit read or workspace-edit approvals. User configuration gains `permission.auto.model` and `permission.auto.instructions`. This PR implements the classifier and policy defaults. The dependent #835 removes the remaining shell-effect inference and limits Bash matching to explicit exec rules and classification. Refs #131. ## Test plan - The required local checks passed: `cargo fmt --check`, `cargo build`, `cargo clippy --all-targets`, `cargo clippy`, `cargo doc --no-deps`, `cargo llvm-cov`, `pnpm format`, `pnpm lint`, and `pnpm spellcheck`. - On the current head, workspace coverage ran 3,491 passing tests with no failures and 99.24% line coverage. Five existing integration tests remain ignored. Seven classifier regressions were checked with failing mutations. - A live Haiku test before the compaction-context fix, through the configured gateway, emitted an automatic approval reason, executed a fixed-output Bash command, and reported classifier usage. - Mandatory commit and push hooks passed. - Independent review findings are resolved. A full-engine regression retains original and queued user intent after mid-turn compaction while excluding generated context. Restoring the former transcript extraction makes it fail. The required local checks passed again on the current head. - Resuming a compacted session uses visible user text and the new follow-up. Earlier prompts replaced by the summary are unavailable to classification. ## Migration The default mode changes to `auto`. Set `permission.mode = "manual"` to keep manual approval. Removed `permission.defaults` entries must be deleted from existing config. Configure explicit deny, ask, and allow rules for desired fixed policy.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Replace shell filesystem-effect inference with literal command matching for explicit exec rules. Keep simple-command boundaries, leading assignments, quote handling, and deny and ask matching. Unmatched actions use the configured mode and classifier. Native path tools retain their path and search filtering contracts.
hakula139
force-pushed
the
refactor/native-permission-scope
branch
from
November 7, 2026 15:45
c17a46a to
1da81ca
Compare
hakula139
marked this pull request as ready for review
November 7, 2026 15:49
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
Scope read and edit path rules to native file tools and search walks. Bash uses explicit exec rules and the selected permission mode, including the automatic classifier from #833.
Remove reader option grammars, wrapper peeling, nested script analysis, directory tracking, and inferred filesystem effects. Keep literal command words, quote handling, leading assignments, simple-command boundaries, and explicit deny and ask matching. Command-specific allow rules must cover every component. The whole-class exec rule
*permits calls after deny and ask checks.Update the permission guide and security model, including migration guidance for wrapper, assignment, and dynamic exec patterns. Native path matching and file-integrity contracts remain in place. Remove workspace-zone metadata and accept explicitly configured home, filesystem-root, and ancestor anchors. Preserve the separate boundary for automatically loading checkout-supplied config and instruction files.
Uses the classifier from #833. Closes #131. Related to #658 and #664.
Test plan
cargo fmt --check,cargo build,cargo clippy --all-targets,cargo clippy,cargo doc --no-deps,cargo llvm-cov,pnpm format,pnpm lint, andpnpm spellcheck. Workspace coverage ran 3,381 passing tests with no failures and 99.24% line coverage. Five existing integration tests remain ignored.Migration
Native read and edit path rules no longer inspect Bash commands. Configure explicit exec rules for fixed command policy or use auto classification and manual approval. Shell wrappers and literal script arguments match their actual command text without filesystem inference.