feat: add file-path scoping to restrict agent write access#706
Merged
geoffjay merged 2 commits intofeature/autonomous-pipelinefrom Mar 23, 2026
Merged
feat: add file-path scoping to restrict agent write access#706geoffjay merged 2 commits intofeature/autonomous-pipelinefrom
geoffjay merged 2 commits intofeature/autonomous-pipelinefrom
Conversation
Extend ToolPolicy to enforce file-path restrictions per agent type so that specialist agents cannot write outside their designated scope. ## Orchestrator changes (types.rs) - Extend `match_tool` to check the `file_path` input field (in addition to `command`) when evaluating parenthesized patterns for file tools (Write, Edit, Read, MultiEdit, NotebookEdit) - Add `match_path_pattern` + `match_path_segments` + `match_path_segment` helpers that implement glob matching with `*` (single segment) and `**` (zero-or-more segments) for file paths - Add 7 unit tests for `match_path_pattern` and 3 integration tests demonstrating deny_list and allow_list policies with path patterns ## Agent YAML changes | Agent | Policy | Scope | |------------|-----------|------------------------------------------------| | tester | allow_list| crates/*/tests/**, .github/workflows/**, reads | | documenter | deny_list | denies Write/Edit to crates/**/*.rs, .agentd/**| | designer | deny_list | denies Write/Edit to crates/**, docs/**, .agentd/**, CLAUDE.md | | security | deny_list | denies Write/Edit to crates/**, ui/**, .agentd/**, docs/** | | refactor | deny_list | denies Write/Edit to .agentd/**, ui/**, docs/**, CLAUDE.md | | conductor | deny_list | denies Write/Edit to crates/**, ui/**, docs/**, .agentd/**, CLAUDE.md | Closes #642
Owner
Author
|
This change is part of the following stack: Change managed by git-spice. |
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.
feat: add file-path scoping to restrict agent write access
feat(orchestrator): add file-path scoping to agent tool policies
Extend ToolPolicy to enforce file-path restrictions per agent type so
that specialist agents cannot write outside their designated scope.
Orchestrator changes (types.rs)
match_toolto check thefile_pathinput field (in additionto
command) when evaluating parenthesized patterns for file tools(Write, Edit, Read, MultiEdit, NotebookEdit)
match_path_pattern+match_path_segments+match_path_segmenthelpers that implement glob matching with
*(single segment) and**(zero-or-more segments) for file paths
match_path_patternand 3 integration testsdemonstrating deny_list and allow_list policies with path patterns
Agent YAML changes
Closes #642