Repository navigation
governance: pattern-based Ask rules and a layered permissions.toml - #192
Merged
Merged
Conversation
Add tool(pattern) rules that narrow an already-gated call (command prefix for shell tools, path glob for file tools, host for fetch-style tools) between Hitl and Allow. Deny still wins first, unconditionally, and a pattern rule can never turn a call into Deny — it's strictly a narrowing of the space between "always ask" and "never ask". Rules are backed by a layered permissions.toml: a personal file under the user config directory and a repo-committed .forge/permissions.toml. The repo file's `allow` entries are never honored — a checked-out repository can't grant itself a wider blast radius than a human approved locally, mirroring the existing restriction on project-discovered MCP config. Its `deny` entries are always honored, since narrowing approval is safe regardless of source. Wired into forge-cli's startup so Governance is actually configured from the merged file at launch. Phase 2 of the HITL/permission-model redesign in docs/hitl-permission-model-research.md.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
…oml (#192) Add tool(pattern) rules that narrow an already-gated call (command prefix for shell tools, path glob for file tools, host for fetch-style tools) between Hitl and Allow. Deny still wins first, unconditionally, and a pattern rule can never turn a call into Deny — it's strictly a narrowing of the space between "always ask" and "never ask". Rules are backed by a layered permissions.toml: a personal file under the user config directory and a repo-committed .forge/permissions.toml. The repo file's `allow` entries are never honored — a checked-out repository can't grant itself a wider blast radius than a human approved locally, mirroring the existing restriction on project-discovered MCP config. Its `deny` entries are always honored, since narrowing approval is safe regardless of source. Wired into forge-cli's startup so Governance is actually configured from the merged file at launch. Phase 2 of the HITL/permission-model redesign in docs/hitl-permission-model-research.md.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
…oml (#192) Add tool(pattern) rules that narrow an already-gated call (command prefix for shell tools, path glob for file tools, host for fetch-style tools) between Hitl and Allow. Deny still wins first, unconditionally, and a pattern rule can never turn a call into Deny — it's strictly a narrowing of the space between "always ask" and "never ask". Rules are backed by a layered permissions.toml: a personal file under the user config directory and a repo-committed .forge/permissions.toml. The repo file's `allow` entries are never honored — a checked-out repository can't grant itself a wider blast radius than a human approved locally, mirroring the existing restriction on project-discovered MCP config. Its `deny` entries are always honored, since narrowing approval is safe regardless of source. Wired into forge-cli's startup so Governance is actually configured from the merged file at launch. Phase 2 of the HITL/permission-model redesign in docs/hitl-permission-model-research.md.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
…oml (#192) Add tool(pattern) rules that narrow an already-gated call (command prefix for shell tools, path glob for file tools, host for fetch-style tools) between Hitl and Allow. Deny still wins first, unconditionally, and a pattern rule can never turn a call into Deny — it's strictly a narrowing of the space between "always ask" and "never ask". Rules are backed by a layered permissions.toml: a personal file under the user config directory and a repo-committed .forge/permissions.toml. The repo file's `allow` entries are never honored — a checked-out repository can't grant itself a wider blast radius than a human approved locally, mirroring the existing restriction on project-discovered MCP config. Its `deny` entries are always honored, since narrowing approval is safe regardless of source. Wired into forge-cli's startup so Governance is actually configured from the merged file at launch. Phase 2 of the HITL/permission-model redesign in docs/hitl-permission-model-research.md.
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
docs/hitl-permission-model-research.md).tool(pattern)pattern rules (crates/forge-governance/src/pattern.rs) matched against the actual call — command prefix for shell tools, path glob for file tools, host for fetch-style tools (e.g.bash(cargo test *),write_file(src/**),fetch(*.example.com)).HitlandAllow.AclPolicydeny still wins first, unconditionally — a pattern rule can never turn a call intoDeny, and has no effect on a tool that wasn't gated in the first place.pattern_denylets a narrower rule carve an exception out of a broaderpattern_allow(e.g. allowcargo *but keep asking forcargo publish).permissions.toml(crates/forge-config/src/permissions.rs): a personal file under the user config directory, and a repo-committed.forge/permissions.toml.allowentries are always ignored (with a diagnostic explaining why) — a checked-out, possibly-untrusted repo shouldn't be able to grant itself a wider blast radius than a human approved personally. This mirrors the README's existing restriction on project-discovered MCP server config. The repo file'sdenyentries are always honored, since tightening approval is safe regardless of source.forge-cli's startup (open_session) soGovernanceis actually built from the merged file at launch, not just parsed and discarded.README.mddocuments the new file and precedence under a new "Permission rules" section.Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo test --workspace --all-targets --locked(0 failures across all 18 crates)forge-governance/src/pattern.rs),authorize()narrowing/deny-carve-out/no-op-on-ungated-tool/cannot-override-ACL-deny (forge-governance/src/lib.rs), file loading/merging/repo-allow-rejection/append-dedup (forge-config/src/permissions.rs), and an end-to-end wiring test inforge-cli/src/main.rs.