fix: redact keras h5 lambda previews#1435
Conversation
|
@codex review |
Performance BenchmarksCompared
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8084b686d0
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 640bc88cc9
ℹ️ 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".
…ras-h5-lambda-preview-redaction-c032 # Conflicts: # modelaudit/scanners/keras_h5_scanner.py # modelaudit/scanners/keras_utils.py # tests/scanners/test_keras_h5_scanner.py
…ras-h5-lambda-preview-redaction-c032
…ras-h5-lambda-preview-redaction-c032
|
Reviewed and updated against current Security QA found one additional output leak beyond the existing preview fixes: the AST-derived Validation:
The legacy helper test is gated off on this host's Python 3.12 reduced lane; its assertion was updated to the same contract directly covered by the passing H5 regression. |
…ras-h5-lambda-preview-redaction-c032
|
Reviewed, synced with current Key QA/fixes:
Focused validation only (no full suite):
|
…ras-h5-lambda-preview-redaction-c032
Normalize qualified Lambda class metadata, redact nested artifact-controlled config context, and avoid case-folding Python builtin names in malformed-source checks.
|
QA follow-up on exact head
Validation:
|
|
Review follow-up pushed in 096bc04. The H5 Lambda module-reference classifier no longer marks safe modules such as math or numpy critical solely because an unresolved attribute is named eval/system (including uppercase near-matches). Unqualified dangerous builtins and risky module roots such as os/subprocess remain flagged. Validation: 17 Keras utility tests passed, 7 focused classifier cases passed, qualified-Lambda evidence redaction probe passed; scoped Ruff, format, mypy, and diff checks are clean. H5-backed integration remains CI-only locally because h5py is unavailable. |
…da-preview-redaction-c032' into mdangelo/codex/audit-pr-1435 # Conflicts: # modelaudit/scanners/keras_h5_scanner.py # tests/scanners/test_keras_h5_scanner.py
|
Audit complete on head |
…-pr-1435-c020 # Conflicts: # modelaudit/scanners/keras_h5_scanner.py
|
Merged current main and resolved the Keras H5 overlap in 46e3c6a. The resolution preserves main’s exact Lambda class allowlist, source/callback allowlists, auxiliary output_shape/mask scanning, nested callable handling, and fail-closed warnings while omitting source-derived code analysis, previews, validation errors, layer names, nested config paths, and module/function evidence. QA also separates generic near-matches such as math.eval and tensorflow.io.system (warning) from real callback bridges such as py_function, PyFunc, and load_op_library (critical). Targeted local validation: 25 passed; H5 integration files were skipped because h5py is unavailable locally; scoped Ruff, format, mypy, and git diff checks are clean. Both existing review threads remain resolved. |
…ras-h5-lambda-preview-redaction-c032
|
Adversarial QA follow-up pushed at Fixed two remaining issues:
Focused validation: 276 associated tests passed with 33 expected reduced-lane skips; scoped Ruff, mypy, and diff checks are clean. All review threads are resolved and the PR is mergeable/approved. Fresh CI is running; rotating without waiting. |
|
Critical review and remediation complete at Review fixes:
All review threads are addressed and resolved. The stale GitHub conflict state was cleared by merging current Local validation after the merge:
Fresh CI is running on the pushed head and will exercise the H5 end-to-end cases. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32f4f5689c
ℹ️ 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".
|
QA follow-up after syncing current main and addressing the remaining review thread:
Pushed as e9595f3; fresh CI is running. |
…ras-h5-lambda-preview-redaction-c032
|
QA refresh after syncing current
Updated head: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 241ad87edd
ℹ️ 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".
|
Review follow-up pushed in The new module-qualified callable finding was valid: Scoped validation: |
Summary
mainhardening for mixed encoded functions, module references, bounded bytecode analysis, and false-positive-resistant pattern matching.Validation
PROMPTFOO_DISABLE_TELEMETRY=1 uv run pytest tests/scanners/test_keras_h5_scanner.py -q(109 passed)PROMPTFOO_DISABLE_TELEMETRY=1 uv run pytest tests/scanners/test_keras_h5_scanner.py tests/scanners/test_keras_utils.py tests/scanners/test_keras_zip_scanner.py -q(359 passed)uv run ruff check modelaudit/ packages/modelaudit-picklescan/src packages/modelaudit-picklescan/tests tests/uv run ruff format --check modelaudit/ packages/modelaudit-picklescan/src packages/modelaudit-picklescan/tests tests/uv run mypy modelaudit/ packages/modelaudit-picklescan/src packages/modelaudit-picklescan/tests tests/(454 source files)git diff --checkScan Finding