Files
gemini-cli/packages/core
Spencer 38ca55a8eb fix(policy): update comments for escapeRegex usage in pattern builders
- Reverted the removal of `escapeRegex` around `JSON.stringify()` in `buildFilePathArgsPattern` and `buildPatternArgsPattern`. As pointed out in PR review #20361, `escapeRegex` is required to prevent Regular Expression control characters (like `.` or `+` in filenames) from acting as regex wildcards, which could allow overly broad policy matches (e.g. `foo.ts` matching `fooXts`).
- Removed the old comment documenting LLM generation.
- Added explanatory comments explaining exactly why `escapeRegex` is necessary for safety when matching literal stringified arguments.
2026-03-10 23:03:19 +00:00
..