Repository navigation
Add hardened Inspect-native CodeGuard SecurityEval harness - #119
Merged
Merged
Conversation
Pin the supported Python runtime, bind Semgrep evidence to the complete locked rules tree, simplify output validity to bounded parseable source, and add focused CI and regression coverage.
aacarter1
approved these changes
Sep 4, 2026
aacarter1
left a comment
Contributor
There was a problem hiding this comment.
Overall, this is a thoughtful and well-hardened foundation. I have two non-blocking concerns before its results are treated as decision-grade:
- The Docker integration tests covering the actual sandbox and Semgrep security boundaries are manual rather than part of required CI. Could we consider an enforced integration gate, or document who owns confirming that manual gate before releases?
- valid_output currently means bounded, non-empty, parseable Python; it does not establish meaningful implementation or interface preservation, and parse-valid stubs are accepted. The README documents this limitation, but the PR summary still claims meaningful, non-stub, interface-preserving validation. Could those claims be reconciled and future published results clearly framed as conditional on parse-valid output?
Neither point necessarily needs to block merging this initial harness, but both matter for how confidently its results can be interpreted publicly.
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
Adds an Inspect-native SecurityEval harness for measuring how CodeGuard affects model-generated Python code across all 121 pinned benchmark cases.
The experiment compares three conditions:
Codex runs inside a hardened, networkless Docker sandbox. The harness captures a bounded
solution.pyin Inspect's per-sample store without rewriting the raw model response, validates that the scaffold was meaningfully implemented while preserving its interface, and scores valid non-stub output with Semgrep through Inspect's normal scoring workflow.Security and reproducibility
solution.pythrough a strict wire contract.p/security-auditregistry rules are mutable and fetched for each scanned sample.Validation
uv lock --checkuv run --locked pytest— 212 passed; 4 Docker tests deselecteduv run --locked pytest -m docker— 4 passeduv run --locked python -m compileall -q codeguard_evalsuv run --locked inspect list tasks codeguard_evals/securityevalgit diff --checkThe full 1,089-generation provider matrix is intentionally not part of PR validation because it incurs provider cost; the harness and its real Codex-in-Docker path are covered by the integration suite.
Related