fix(network): preserve detections in README environment files - #1790
fix(network): preserve detections in README environment files#1790mldangelo-oai wants to merge 2 commits into
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Performance BenchmarksCompared
|
|
Security review completed. No security issues were found in this pull request. Reviewed commit: ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a network-communication detection regression where README-named environment files (e.g., README.env, README.md.env) were being treated like trusted README documentation for the “official sample image” exception, which could suppress actionable network_library / network_function findings. The change tightens the README image-example context logic so only true README documentation extensions get the exception, and adds regression tests to lock the behavior in.
Changes:
- Remove
.envfrom the README “official sample image” allowlist context so README-named env files remain actionable for network detections. - Add detector- and TextScanner-level regression tests ensuring
network_libraryandnetwork_functionfindings are preserved forREADME*.envfilenames. - Document the user-visible fix in the root changelog under
[Unreleased].
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
modelaudit/detectors/network_comm.py |
Stops treating readme.*.env as a trusted README image-example context so network findings aren’t suppressed. |
tests/detectors/test_network_comm_detector.py |
Adds regression coverage that README*.env contexts preserve network_library/network_function findings. |
tests/scanners/test_text_scanner.py |
Adds end-to-end TextScanner regression coverage for README*.env filenames preserving network findings. |
CHANGELOG.md |
Notes the fix under [Unreleased] bug fixes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
README.env,readme.env,README.ENV, andREADME.md.envas executable environment files instead of trusted README documentation.network_libraryandnetwork_functionfindings at detector and TextScanner layers while keeping legitimate README image examples informational.[Unreleased].Validation
mainbefore the fix.PROMPTFOO_DISABLE_TELEMETRY=1 python -m pytest tests/detectors/test_network_comm_detector.py tests/scanners/test_text_scanner.py -q --maxfail=1: 1,299 passed.