Experiment/h4 security - #29
Merged
Merged
Conversation
Calls real agents (anote-code, claude-code via Anthropic; codex via OpenAI) on all 10 SAMPLE_TASKS with 8 rollouts each. Evaluates generated code for functional correctness (5 tests/task) and security_score, then computes Kendall τ between reliability@5 and security_adjusted_reliability@5 rankings. Saves raw results to data/h4_results.json and generates figures/fig5. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
240 real API calls (anote-code + claude-code via Anthropic, codex via OpenAI). All agents scored security_score = 1.0 — no insecure patterns in generated code for algorithmic tasks. Kendall τ = 1.000: rankings unchanged after security adjustment, a convergence result consistent with the design doc's risk table. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… results
Replaces the 10 algorithmic SAMPLE_TASKS (all score security=1.0) with a
mixed set: 5 algorithmic + 5 security-sensitive tasks (evaluate_expression,
execute_python_snippet, run_shell_command, load_yaml_config, import_module).
Security-sensitive tasks naturally elicit eval/exec/os.system/__import__ patterns.
Also fixes placeholder detection in extract_code to handle {source_code} responses.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each run now saves fig5_h4_security_leaderboard_v{N}.png and
h4_results_v{N}.json so old outputs are never overwritten.
h4_results.json still updated as the canonical --plot source.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
240 API calls on mixed task set (5 algorithmic + 5 security-sensitive). Safety-trained models consistently chose secure implementations — eval(), exec(), os.system() avoided in favour of ast, subprocess without shell=True, importlib. All agents scored security_score = 1.0, yielding Kendall τ = 1.000. Rankings: codex (1.000) > anote-code (0.988) > claude-code (0.793). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.
No description provided.