Skip to content

feat(security/tools): 为 file/grep/glob 接入统一结果安全过滤#156

Closed
Cai-Tang-www wants to merge 4 commits into
1024XEngineer:mainfrom
Cai-Tang-www:codex/issue-151-result-filter
Closed

feat(security/tools): 为 file/grep/glob 接入统一结果安全过滤#156
Cai-Tang-www wants to merge 4 commits into
1024XEngineer:mainfrom
Cai-Tang-www:codex/issue-151-result-filter

Conversation

@Cai-Tang-www

Copy link
Copy Markdown
Collaborator

Summary

  • file / grep / glob 引入统一路径结果过滤器,集中处理工作区边界、敏感路径、符号链接逃逸检查。
  • read_file 在读取前接入同源过滤规则,命中策略时返回结构化阻断错误。
  • grepglob 在候选结果阶段统一过滤,并补充统计元数据:matched_countfiltered_countreturned_countfiltered_reasons
  • 新增与增强测试覆盖:敏感路径过滤、symlink escape 过滤、原因码与统计元数据断言。

Test

  • go test ./internal/tools/filesystem/...
  • go test ./...

Closes #151
Refs #98

@codecov

codecov Bot commented Apr 5, 2026

Copy link
Copy Markdown

@Cai-Tang-www Cai-Tang-www deleted the codex/issue-151-result-filter branch April 5, 2026 03:24
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.

feat(security/tools): 为 file / grep / glob 工具接入统一安全检查

1 participant