fix(agent): block grep_files from leaking .env secrets - #147
Draft
cursor[bot] wants to merge 2 commits into
Draft
cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
read_file already refused .env/.key/.pem, but grep_files returned raw matching lines from those files and did not redact secret keys in ordinary files. Skip blocked paths before reading and reuse the existing redaction helper. Co-authored-by: EXboy <EXboys@users.noreply.github.com>
Record verification commands, merge readiness, and board status for the sensitive-file grep fix. Co-authored-by: EXboy <EXboys@users.noreply.github.com>
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.
Summary
read_filealready hard-blocks.env/.key/.pemand redacts secret-like keys in other files.grep_filesused the same workspace resolver but skipped both checks.grep_files {"pattern":"API_KEY","path":"."}returned raw.envlines (for exampleAPI_KEY=...) into the model context. A 50-line.envcould also consume the match cap and hide later non-secret hits.Task Linkage
TASK-2026-071tasks/TASK-2026-071-block-grep-sensitive-files/Injected Specs
spec/architecture-boundaries.md(if architecture/layering changed)spec/security-nonnegotiables.md(if sandbox/security changed)spec/testing-policy.md(required for any code change)spec/docs-sync.md(if behavior/docs/env/commands changed)Validation Evidence
python3 scripts/validate_tasks.py— passed (71 task directories)cargo fmt --check— exit 0cargo clippy --all-targets -- -D warnings— exit 0cargo test -p skilllite-agent grep_files— 10 passed, 0 failedcargo test— all workspace crates ok, 0 failed (skilllite-agent250 passed)test_grep_files_blocks_direct_sensitive_pathpassedtest_grep_files_skips_dotenv_during_workspace_walkpassedtest_grep_files_redacts_sensitive_keys_in_normal_filespassedRegression Scope
grep_filesbuiltinskilllite-fs::grep_directoryoptional skip-file callback#143)write_fileclobber (#144/#146)#132)#114)Docs Sync (EN/ZH)
docs/en/ARCHITECTURE.mddocs/zh/ARCHITECTURE.mdReview Checklist
tasks/TASK-2026-071-block-grep-sensitive-files/TASK.mdsatisfied (or explicitly deferred)tasks/TASK-2026-071-block-grep-sensitive-files/STATUS.mdupdated with latest progresstasks/TASK-2026-071-block-grep-sensitive-files/REVIEW.mdincludes merge readiness decisiontasks/board.mdstatus is up to date