Skip to content

Experiment/h4 security - #29

Merged
sharonxz merged 5 commits into
mainfrom
experiment/h4-security
Jul 8, 2026
Merged

Experiment/h4 security#29
sharonxz merged 5 commits into
mainfrom
experiment/h4-security

Conversation

@sharonxz

@sharonxz sharonxz commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

sharonxz and others added 5 commits July 7, 2026 12:39
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>
@sharonxz
sharonxz merged commit 2fda24f into main Jul 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant