Skip to content

feat: add file-path scoping to restrict agent write access#706

Merged
geoffjay merged 2 commits intofeature/autonomous-pipelinefrom
issue-642
Mar 23, 2026
Merged

feat: add file-path scoping to restrict agent write access#706
geoffjay merged 2 commits intofeature/autonomous-pipelinefrom
issue-642

Conversation

@geoffjay
Copy link
Owner

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)

  • 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

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
@geoffjay geoffjay added the review-agent Used to invoke a review by an agent tracking this label label Mar 22, 2026
@geoffjay
Copy link
Owner Author

This change is part of the following stack:

Change managed by git-spice.

@geoffjay geoffjay merged commit da9717b into feature/autonomous-pipeline Mar 23, 2026
@geoffjay geoffjay deleted the issue-642 branch March 23, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-agent Used to invoke a review by an agent tracking this label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant