Skip to content

chore(tools): Suppress noisy/sensitive paths from fs tool results - #884

Merged
JeanMertz merged 6 commits into
mainfrom
fs-tool-ignore
Jul 27, 2026
Merged

chore(tools): Suppress noisy/sensitive paths from fs tool results#884
JeanMertz merged 6 commits into
mainfrom
fs-tool-ignore

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

The fs_list_files, fs_grep_files, and fs_read_file tools gain an options.suppress list of .ignore-style patterns for paths they may read but must never hand back to the model. .git/ and **/target/ are suppressed by default across all of them, so a search or listing no longer floods the model with build output or exposes repository internals it has no business seeing. Read access to those paths is unaffected: access.fs still governs what the tool process may touch, which is why fs_modify_file can keep running git status against a suppressed .git to check for uncommitted work.

A path skipped for suppression, or because the access policy denies read, is no longer silently dropped from listings and searches. The result now names what was skipped and why, and points at asking the user for the content instead of letting an empty result read as evidence the content does not exist. Explicitly naming a path (e.g. fs_read_file on an exact file) still reaches it even when a .ignore rule would otherwise prune it from an unscoped listing; only suppress and the access policy can withhold an explicitly named path.

fs_list_files and fs_grep_files also correctly handle a prefix naming a file directly, and a prefix naming a directory whose pruning rule lives below the workspace root (e.g. a nested .ignore), by walking that subtree as its own root instead of silently returning nothing.

Access-denial error messages from the fs tools now list only the paths that grant the specific denied capability, rather than every configured grant path, and point the model at asking the user for access rather than leaving the refusal as a dead end.

The `fs_list_files`, `fs_grep_files`, and `fs_read_file` tools gain an
`options.suppress` list of `.ignore`-style patterns for paths they may
read but must never hand back to the model. `.git/` and `**/target/`
are suppressed by default across all of them, so a search or listing
no longer floods the model with build output or exposes repository
internals it has no business seeing. Read access to those paths is
unaffected: `access.fs` still governs what the tool process may touch,
which is why `fs_modify_file` can keep running `git status` against a
suppressed `.git` to check for uncommitted work.

A path skipped for suppression, or because the access policy denies
read, is no longer silently dropped from listings and searches. The
result now names what was skipped and why, and points at asking the
user for the content instead of letting an empty result read as
evidence the content does not exist. Explicitly naming a path (e.g.
`fs_read_file` on an exact file) still reaches it even when a `.ignore`
rule would otherwise prune it from an unscoped listing; only
`suppress` and the access policy can withhold an explicitly named
path.

`fs_list_files` and `fs_grep_files` also correctly handle a prefix
naming a file directly, and a prefix naming a directory whose pruning
rule lives below the workspace root (e.g. a nested `.ignore`), by
walking that subtree as its own root instead of silently returning
nothing.

Access-denial error messages from the fs tools now list only the paths
that grant the specific denied capability, rather than every
configured grant path, and point the model at asking the user for
access rather than leaving the refusal as a dead end.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz
JeanMertz merged commit e5c87c2 into main Jul 27, 2026
16 checks passed
@JeanMertz
JeanMertz deleted the fs-tool-ignore branch July 27, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant