test(picklescan): stabilize benign nested constructor checks - #1789
test(picklescan): stabilize benign nested constructor checks#1789mldangelo-oai wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR stabilizes modelaudit-picklescan’s benign nested-constructor scan tests by explicitly modeling and asserting the “fail-closed” behavior when the shared call-graph source snapshot changes mid-analysis (an observed flaky condition in Windows/Python 3.11 nightly runs).
Changes:
- Expands the benign nested-constructor test matrix to include a forced “hex + source changed” scenario via
monkeypatchon_ensure_shared_source_snapshot_stable. - Updates assertions to accept only the explicit call-graph source-stability failure mode as
INCONCLUSIVE/UNKNOWN, while keeping the clean path asCOMPLETE/CLEAN. - Keeps the original expectations around “no findings” and presence of the correct nested-payload notice across all benign constructor shapes and encodings.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Performance BenchmarksCompared
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9c18a9594b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| assert report.verdict == SafetyVerdict.CLEAN | ||
| if source_changes: | ||
| assert report.status == ScanStatus.INCONCLUSIVE | ||
| if report.status == ScanStatus.INCONCLUSIVE: |
There was a problem hiding this comment.
Preserve clean assertions for normal constructor cases
When source_changes is false, this branch allows every ordinary raw/base64/hex case to return INCONCLUSIVE/UNKNOWN; therefore, a regression that makes nested-constructor source tracking consistently report instability would pass instead of detecting that benign inputs no longer scan cleanly. The explicit source_changes=True cases already cover the fail-closed outcome, so keep the normal cases deterministic—mock a stable snapshot if necessary—and require COMPLETE/CLEAN.
AGENTS.md reference: AGENTS.md:L124-L124
Useful? React with 👍 / 👎.
|
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. |
Summary
Validation
Nightly failure: https://github.com/promptfoo/modelaudit/actions/runs/30423861843