acceptodds
Under review as a conference paper at ICLR 2027

Secure Agentic Coding through Counterexample-Grounded Feedback

Abstract

As coding models and agent harnesses become more capable, reliable security verification is becoming a central bottleneck. Improving secure code generation requires a signal whose reported progress remains aligned with actual program behavior under optimization; otherwise, an optimizer can improve the signal's verdict without removing the underlying vulnerability. Existing model-based approaches require models to either infer program behavior from source code or specify correct outcomes for adversarial tests, placing substantial reasoning demands on the security signal. We introduce FALCON, a counterexample-grounded verification framework that separates attack exploration from behavioral verification and connects them through execution traces of the program under test. In test-time repair, FALCON yields substantially stronger held-out functional-security gains than alternative security signals across secure code generation benchmarks, while preserving or improving functionality. As an RL reward, FALCON also outperforms static-analysis and learned rewards on held-out functional-security, even when all policies successfully optimize their respective training rewards. Combining FALCON with either proxy reward further improves held-out performance, suggesting that execution-grounded feedback can mitigate reward overoptimization while preserving useful guidance from existing security signals.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
secure code generation, vulnerability detection, reinforcement learning

Reviews

Among:
Shape:
1234this paper, Top 32%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.50 over 2 reviews, above 68% of the others.
Reviewer_LBjAOpenReview ↗
Rating
3(+1)
Confidence
3
Informativeness
3(+1)
Presentation
3
Soundness
2
Read review
Paper summary

This paper addresses the challenge of ensuring that AI-generated code meets functional requirements while remaining free of security vulnerabilities. The authors note that existing security assessment methods can suffer from a discrepancy where scores improve without a genuine enhancement in security. To tackle this, the paper introduces FALCON: an attacker component generates scripts to attempt to trigger vulnerabilities, while a verifier checks the code's actual execution results to detect security violations and feeds specific attack inputs and execution evidence back to the model. The system also verifies that the evidence originates from the target code itself, preventing the attack scripts from artificially manufacturing violations. Experiments demonstrate that FALCON can be used for post-generation code repair and as a reinforcement learning reward to increase the rate at which code passes both functional and security tests; performance improves further when combined with existing security rewards. However, the approach may still be limited by attack coverage; the absence of detected vulnerabilities does not guarantee that the code is absolutely secure.

Critical strengths
  • The paper addresses an important question: whether higher security scores lead to safer code. It offers a clear approach by separating attack exploration from behavioral verification.
  • The experiments are clearly presented and directly address the research questions. The paper is coherent and easy to follow.
Critical weaknesses
  • The RL component reuses fixed attack scripts and assigns full security rewards to uncertain or no-evidence outcomes. This may give high rewards to code that is not effectively tested, weakening the interpretation of genuine security gains.
  • Although the paper includes verifier-stage and attack-budget ablations, it remains unclear how much evidence filtering and counterexample feedback contribute to the final improvements.
Questions for authors
  1. How is the accuracy of the faithfulness check verified?
  2. The authors argue that FALCON constrains the over-optimization of proxy rewards while preserving their effective guidance. Could you further analyze how this mechanism leads to the combined benefits shown in Figure 5?
  3. How does FALCON perform across different CWE types, particularly those not covered by existing detection rules?
8 comments

Dear Reviewer LBjA, thank you for your thoughtful review and constructive feedback. We address your concerns point by point below, providing additional experimental results and clarifications.

Weakness 1: The RL component reuses fixed attack scripts and assigns full security rewards to uncertain or no-evidence outcomes. This may give high rewards to code that is not effectively tested, weakening the interpretation of genuine security gains.

Answer-W1:

Fixed vs. adaptive probes. To examine the effect of probe reuse, we compare fixed probes with adaptive probes regenerated every KK training steps by Qwen3-8B, while the trained model is Qwen2.5-Coder-3B. All other settings remain unchanged. We report held-out Func-Sec@1 and total GPU-hours, including RL training and attack-probe generation.

Probe settingFunc-Sec@1Total GPU-hours
Fixed49.2798.77
Adaptive (K=20K=20)48.87110.12
Adaptive (K=10K=10)51.61123.98

Adaptive probe generation with K=10K=10 improves Func-Sec@1 by 2.34 points over fixed probes, but increases GPU cost by 25.5%. In contrast, K=20K=20 slightly underperforms fixed probes despite higher computational cost. These results suggest that more frequent probe regeneration can improve security performance, but the gains are not consistent across regeneration frequencies and come with additional computational overhead. We therefore use fixed probes in our main experiments for better computational efficiency.

Reward assignment for uncertain / no-evidence outcomes. We assign rsec=1r_{\text{sec}}=1 to uncertain and no-evidence outcomes because the absence of observed violations does not necessarily imply that the generated code is insecure. Assigning lower rewards to these outcomes may incorrectly discourage secure solutions and encourage overly defensive behavior that compromises functionality. To examine this design choice, we reduce their reward from 1.0 to 0.5 while keeping all other settings unchanged. The table reports held-out Func-Sec@1.

Reward for uncertain / no-evidenceQwen2.5-Coder-3BQwen2.5-Coder-7B
1.0 (original)49.2768.70
0.545.8266.41

Reducing the reward decreases Func-Sec@1 by 3.45 and 2.29 points for the 3B and 7B models, respectively. This suggests that assigning lower rewards to inconclusive outcomes can harm held-out performance, although it does not establish that all positively rewarded outcomes are secure.

Frequency of uncertain / no-evidence outcomes during RL training. We further track the proportion of positive security rewards attributed to uncertain and no-evidence verdicts throughout training.

Step3B: Uncertain3B: No-evidence7B: Uncertain7B: No-evidence
111.4%9.8%12.9%9.3%
5012.8%9.2%12.3%10.4%
1009.4%11.0%7.2%9.9%
20010.0%4.7%8.7%6.3%
3008.0%7.8%9.1%8.5%
4009.7%7.8%8.1%5.8%
4998.0%9.4%7.2%8.6%

The combined proportion of uncertain and no-evidence outcomes fluctuates throughout training, decreasing from 21.2% to 17.4% for the 3B model and from 22.2% to 15.8% for the 7B model between the first and final recorded steps. These results provide no evidence that the policy increasingly exploits inconclusive verdicts to obtain positive security rewards. Together, these analyses support the current design while leaving attack coverage as a limitation.

We have added these RL control experiments and the training outcome frequencies to Appendix C.12 of the revised paper.

Weakness 2: Although the paper includes verifier-stage and attack-budget ablations, it remains unclear how much evidence filtering and counterexample feedback contribute to the final improvements.

Answer-W2:

To assess the contributions of evidence filtering and counterexample feedback to final repair performance, we conduct controlled ablations under the same repair protocol (GPT-5.4-mini, five rounds), using identical initial programs across all configurations. Specifically, we separately remove the faithfulness check, counterexample feedback, and Stage 3 LLM trace judge while keeping all other settings unchanged.

MethodFunc@1Sec@1Func-Sec@1
GPT-5.4-mini (round 1, no repair)83.1965.5561.34
FALCON (full)88.2489.9286.55
w/o faithfulness check87.3982.3578.99
w/o counterexample feedback (verdict only)84.8775.6371.43
w/o Stage 3 (trace LLM judge)87.3985.7182.35

Removing faithfulness checks, counterexample feedback, and Stage 3 decreases Func-Sec@1 by 7.56, 15.12, and 4.20 points, respectively. Counterexample feedback has the largest impact, highlighting the importance of providing concrete execution evidence for repair rather than verdicts alone. The remaining ablations further demonstrate the contributions of faithfulness filtering and LLM-based trace verification. These results support the complementary roles of FALCON's components in improving functional correctness and security.

We have added these controlled component ablations to Appendix C.9 of the revised paper.


Question 1. How is the accuracy of the faithfulness check verified?

Answer-Q1:

We acknowledge that establishing faithfulness-checker accuracy through autonomous evaluation is challenging. To address this concern, we evaluate 150 probes using two external agent judges: Claude Opus 5.5 with Claude Code and GPT-6.1-sol with Codex. Each judge inspects the target code, probe, and available execution trace to assess whether the probe exercises the actual target and whether its evidence originates from that target. For each configuration, we randomly sample 25 probes from each of FALCON's three decision categories. The table below reports agreement with each judge.

ConfigurationFALCON decision#Probes#SampledAgreement w/ Opus 5.5 (%)Agreement w/ GPT-6.1-sol (%)
SWE-agent / GPT-5.4Admitted47652592.088.0
Rejected by FstatF_{\text{stat}}672584.088.0
Rejected by FattF_{\text{att}}3772596.092.0
Overall (weighted)52097592.1988.29
SWE-agent / DeepSeek-V4-ProAdmitted232125100.0100.0
Rejected by FstatF_{\text{stat}}1172588.084.0
Rejected by FattF_{\text{att}}2992596.088.0
Overall (weighted)27377599.0598.01

Both judges agree with most FALCON decisions across all three categories, with lower agreement on static rejections. These results provide external corroboration of the faithfulness checker's decisions, although agreement with external judges does not establish ground-truth accuracy. The ablation in Answer-W2 further shows that removing faithfulness filtering reduces final Func-Sec@1 by 7.56 points.

We have added this external evaluation of the faithfulness checks to Appendix C.8 of the revised paper.

Question 2. The authors argue that FALCON constrains the over-optimization of proxy rewards while preserving their effective guidance. Could you further analyze how this mechanism leads to the combined benefits shown in Figure 5?

Answer-Q2: Thank you for this question. We further explain how FALCON complements existing proxy rewards, provide additional experimental evidence supporting this mechanism, and present illustrative training examples to demonstrate how the combined rewards improve secure code generation.

How the rewards complement each other. Existing proxy rewards can be overoptimized: a policy may learn to achieve high proxy scores without improving actual security. FALCON is more resistant to such exploitation because its negative verdicts are grounded in observed security violations from executable probes. When combined, the reward becomes 0.5rfunc+0.25rFALCON+0.25rproxy0.5r_{\text{func}} + 0.25r_{\text{FALCON}} + 0.25r_{\text{proxy}}. If the policy exploits weaknesses in the proxy reward but retains vulnerabilities detected by FALCON, it cannot obtain the corresponding FALCON reward, reducing its overall reward. Since GRPO optimizes relative rewards within each prompt group, this encourages the policy to favor solutions that satisfy both signals rather than maximize the proxy alone. Meanwhile, the proxy reward continues to provide useful guidance when FALCON assigns similar scores to different solutions. Thus, the combination can constrain proxy overoptimization while preserving its effective guidance.

Proxy reward versus held-out performance. For each proxy, we compare its final reward when optimized alone and when combined with FALCON. The proxy columns below report only the proxy component, not the combined security reward; Func-Sec@1 is measured on held-out tests.

RunProxy reward (3B)Func-Sec@1 (3B)Proxy reward (7B)Func-Sec@1 (7B)
REAL0.94638.750.96457.13
FALCON + REAL0.83057.250.84970.87
SecCodePRM0.95829.460.94354.50
FALCON + SecCodePRM0.84251.950.85777.26

Proxy-only training achieves near-maximum proxy rewards but much lower held-out Func-Sec@1. With FALCON, the proxy scores remain high (0.830 to 0.857), while Func-Sec@1 improves by 18.50 and 22.49 points at 3B, and by 13.74 and 22.76 points at 7B, for REAL and SecCodePRM, respectively. Thus, the combined policy still satisfies much of the proxy's guidance while transferring better to independently tested outcomes.

Illustrative rollouts from RL training. To better illustrate this mechanism, we present four examples from Qwen2.5-Coder-3B training on the same task. In Example 1, REAL gives full reward to code that parses and compiles the user's script before executing it without restrictions. Example 2 shows a similar failure for SecCodePRM: near-maximum reward for unrestricted exec wrapped in error handling. In Examples 3 and 4, the code generated with FALCON + REAL and FALCON + SecCodePRM still receives high rewards, but now uses execution restrictions that block the tested attacks. Together, these examples illustrate how FALCON can limit proxy exploitation while preserving useful guidance from the proxy rewards.

We have added the proxy-reward analysis and full examples to Appendices C.13 and C.14 of the revised paper, respectively.

Reviewer_samVOpenReview ↗
Rating
2
Confidence
3
Informativeness
1
Presentation
3
Soundness
2
Read review
Paper summary

This paper proposes FALCON, a security feedback framework for code generation and repair. An attacker generates executable probes without expected outputs, faithfulness checks filter misleading probes, and a verifier evaluates execution traces using deterministic detectors and an optional LLM judge. The full verifier guides iterative repair, while RL uses only the deterministic core. Experiments report improvements on three repair benchmarks, including repository-level coding, and on held-out secure generation after RL.

Critical strengths
  • Strong repair results: FALCON improves held-out functional-security performance across models and benchmarks

  • Useful engineering proof of concept: The paper integrates probe generation, sandboxed execution, evidence checks, and security feedback into a working pipeline. Applying the same feedback framework to both repair and RL is practically useful, and the held-out results provide evidence that the approach works. This may provide some level of insightz to the community.

Critical weaknesses
  • Limited methodological novelty: The main ingredients have close precedents. AutoSafeCoder (2024) already uses generated fuzz inputs and execution feedback for code repair. CVE2PoC (2026) combines deterministic checks with an LLM judge for ambiguous executions, while PoC-Gym (2026) studies fabricated PoC success and validates target-sink execution. These works address different settings, but FALCON’s contribution appears mainly to be engineering integration and evaluation. The paper should explain more clearly what is technically new.

  • The added value of the verification components is unclear: Table 2 shows 97.54% accuracy with deterministic verification and 98.68% after adding the LLM judge; RL does not use the judge. The attacker-only baseline also changes the probes into tests with expected outputs, so it does not isolate the verifier’s contribution. Repair experiments using the same probes, with and without Stage 3 and the faithfulness checks, would show which components drive the gains.

  • The RL reward still rewards missing evidence: Section 3.6 assigns a positive security reward to uncertain and no-evidence outcomes, including cases where no probe survives the checks. Since RL also reuses a fixed probe set, a policy could receive a high reward without being meaningfully tested. The held-out gains are encouraging, but the paper should report how often these outcomes occur during training and whether their frequency increases.

  • Verifier accuracy does not establish end-to-end reliability: The 98.68% accuracy in Table 2 is measured on CWEval inputs with known labels, rather than attacker-generated probes. This isolates the verifier but leaves the reliability of the complete pipeline unclear. Appendix C.1 reports how many probes the faithfulness checks reject, but does not establish whether those rejections are correct or how much they improve final repair performance.

Questions for authors

Please see Weaknesses above

6 comments

Dear Reviewer samV, thank you for your thoughtful review and constructive feedback. Below, we address your concerns with additional experiments and clarifications.

Weakness 1: Limited methodological novelty: The main ingredients have close precedents. AutoSafeCoder (2024) already uses generated fuzz inputs and execution feedback for code repair. CVE2PoC (2026) combines deterministic checks with an LLM judge for ambiguous executions, while PoC-Gym (2026) studies fabricated PoC success and validates target-sink execution. These works address different settings, but FALCON’s contribution appears mainly to be engineering integration and evaluation. The paper should explain more clearly what is technically new.

Answer-W1: Our focus is whether higher security scores translate into better independently tested security. Figure 3 and our RL results show that feedback scores and held-out outcomes can diverge under optimization. CVE2PoC [2] and PoC-Gym [3] target known vulnerabilities, whereas FALCON must also avoid falsely penalizing secure candidates. This makes faithfulness essential when attack evidence is used for repair or training. Unlike AutoSafeCoder's fuzzing agent [1], FALCON can identify security violations even when the program runs without crashing. FALCON differs from CVE2PoC by explicitly checking that the reported violation comes from the target program itself before using it to guide repair or training. PoC-Gym asks generated PoCs to implement their own success checks, alongside an external check for sink reachability. FALCON instead reduces the attacker's reasoning demands by asking it only to generate probes, while a separate verifier judges whether the observed behavior is unsafe. Our main contribution is a verification framework that reduces the reasoning demands of security assessment by separating attack discovery from judgment of observed program behavior. This simpler judgment task helps the verifier reach more accurate verdicts at lower cost, as supported by the comparison with source-code judging in Table 2. The resulting feedback provides execution counterexamples for repair and a deterministic security reward for RL.

To further evaluate FALCON's effectiveness, we compare it with two additional baselines, AutoSafeCoder [1] and BlueCodeAgent [4], under the repair protocol in Section 4.2.1 (GPT-5.4-mini, five rounds, held-out tests hidden). Since AutoSafeCoder supports only Python, we restrict this comparison to Python tasks. We use its released implementation with GPT-5.4-mini and the same initial solutions as FALCON. For BlueCodeAgent, we adapt its vulnerability-detection pipeline using GPT-5.4-mini and use its security findings as feedback in the same five-round repair loop. The table below reports Func-Sec@1 and costs per instance.

MethodInput generation (tokens)Execution (s)Verification (tokens)Total (tokens / s)Func-Sec@1
GPT-5.4-mini (no repair)N/AN/AN/AN/A64.00
AutoSafeCoder4.8k3.02.0k6.8k / 3.0 s68.00
BlueCodeAgent0.2k0.44.2k4.4k / 0.4 s80.00
FALCON4.8k1.80.9k (+ 0.004 s rules)5.7k / 1.8 s92.00

FALCON improves Func-Sec@1 by 28.00 points over the initial solutions, outperforming AutoSafeCoder and BlueCodeAgent by 24.00 and 12.00 points, respectively. Compared with AutoSafeCoder, FALCON also reduces assessment token consumption by 16.2% and execution time by 40.0%. These results provide empirical support for the proposed feedback design under the same coding model and five-round repair budget.

We have clarified these methodological differences in Section 2 and added the baseline comparison and costs per instance to Appendix C.10 of the revised paper.

Weakness 2: The added value of the verification components is unclear: Table 2 shows 97.54% accuracy with deterministic verification and 98.68% after adding the LLM judge; RL does not use the judge. The attacker-only baseline also changes the probes into tests with expected outputs, so it does not isolate the verifier’s contribution. Repair experiments using the same probes, with and without Stage 3 and the faithfulness checks, would show which components drive the gains.

Answer-W2:

To isolate the contribution of each component, we conduct ablations under the same repair protocol (GPT-5.4-mini, five rounds), using identical initial programs and the same attacker-generated probes in round 1 across all configurations. In subsequent rounds, the attacker generates new probes for each configuration's current code, since the repaired programs may differ. We separately remove the faithfulness check, counterexample feedback, and Stage 3 LLM trace judge, while keeping all other settings unchanged.

MethodFunc@1Sec@1Func-Sec@1
GPT-5.4-mini (round 1, no repair)83.1965.5561.34
FALCON (full)88.2489.9286.55
w/o faithfulness check87.3982.3578.99
w/o counterexample feedback (verdict only)84.8775.6371.43
w/o Stage 3 (trace LLM judge)87.3985.7182.35

Removing faithfulness checks, counterexample feedback, and Stage 3 decreases Func-Sec@1 by 7.56, 15.12, and 4.20 points, respectively. Counterexample feedback has the largest impact, highlighting the importance of providing concrete execution evidence for repair rather than verdicts alone. The remaining ablations further demonstrate the contributions of faithfulness filtering and LLM-based trace verification. These results support the complementary roles of FALCON's components in improving functional correctness and security.

We have added these controlled component ablations to Appendix C.9 of the revised paper.


Weakness 3: The RL reward still rewards missing evidence: Section 3.6 assigns a positive security reward to uncertain and no-evidence outcomes, including cases where no probe survives the checks. Since RL also reuses a fixed probe set, a policy could receive a high reward without being meaningfully tested. The held-out gains are encouraging, but the paper should report how often these outcomes occur during training and whether their frequency increases.

Answer-W3:

Reward assignment for uncertain / no-evidence outcomes. We assign rsec=1r_{\text{sec}}=1 to uncertain and no-evidence outcomes because the absence of observed violations does not necessarily imply that the generated code is insecure. Assigning lower rewards to these outcomes may incorrectly discourage secure solutions and encourage overly defensive behavior that compromises functionality. To examine this design choice, we reduce their reward from 1.0 to 0.5 while keeping all other settings unchanged. The table reports held-out Func-Sec@1.

Reward for uncertain / no-evidenceQwen2.5-Coder-3BQwen2.5-Coder-7B
1.0 (original)49.2768.70
0.545.8266.41

Reducing the reward decreases Func-Sec@1 by 3.45 and 2.29 points for the 3B and 7B models, respectively. This suggests that assigning lower rewards to inconclusive outcomes can harm held-out performance, although it does not establish that all positively rewarded outcomes are secure.

Frequency of uncertain / no-evidence outcomes during RL training. We further track the proportion of positive security rewards attributed to uncertain and no-evidence verdicts throughout training.

Step3B: Uncertain3B: No-evidence7B: Uncertain7B: No-evidence
111.4%9.8%12.9%9.3%
5012.8%9.2%12.3%10.4%
1009.4%11.0%7.2%9.9%
20010.0%4.7%8.7%6.3%
3008.0%7.8%9.1%8.5%
4009.7%7.8%8.1%5.8%
4998.0%9.4%7.2%8.6%

The combined proportion of uncertain and no-evidence outcomes fluctuates throughout training, decreasing from 21.2% to 17.4% for the 3B model and from 22.2% to 15.8% for the 7B model between the first and final recorded steps. These results provide no evidence that the policy increasingly exploits inconclusive verdicts to obtain positive security rewards.

We have added the reward ablation and training outcome frequencies to Appendix C.12 of the revised paper.

Weakness 4: Verifier accuracy does not establish end-to-end reliability: The 98.68% accuracy in Table 2 is measured on CWEval inputs with known labels, rather than attacker-generated probes. This isolates the verifier but leaves the reliability of the complete pipeline unclear. Appendix C.1 reports how many probes the faithfulness checks reject, but does not establish whether those rejections are correct or how much they improve final repair performance.

Answer-W4:

End-to-end reliability on generated probes. We evaluate the verifier on benchmark-provided inputs in Table 2 because these inputs have ground-truth labels. For attacker-generated probes, the benchmark verdict cannot directly establish whether a reported violation is correct: when FALCON flags a program that passes CWEval's security tests, the difference may come from either a verifier error or a vulnerability that the tests do not cover. Appendix C.2, in turn, characterizes attack exploration and reports attack success using FALCON's own verdicts.

To further assess end-to-end reliability, we compare FALCON's verdicts with CWEval's security-test outcomes across all 119 tasks, using GPT-5.4-mini as both the coding model and attacker. Every insecure verdict includes a replayable counterexample, allowing us to examine disagreements with Claude Opus 5.5 running in Claude Code. Unlike the Stage 3 judge, this external agent has access to the candidate source, probe, and trace, and can execute code to reproduce the reported violation.

We also compare Claude Opus 5.5's judgments with author annotations on 20 randomly sampled tasks. The two agree on verdict correctness for all 20 tasks. The table below summarizes the comparison across all 119 tasks.

CaseFALCON verdictCWEval verdict#Tasks
Ainsecureinsecure42
Binsecuresecure3
Csecure / no-evidenceinsecure4
Dsecure / no-evidencesecure70

FALCON's verdict matches CWEval's security tests on 112 of the 119 tasks (94.1%). Of the 45 programs that FALCON marks insecure, 42 also fail CWEval's security tests (93.3%). Claude Opus 5.5 additionally confirms a vulnerability missed by CWEval in one of the three programs in case B, providing program-level support for 43 of the 45 flags (95.6%). FALCON also detects 42 of the 46 programs that fail CWEval's security tests (91.3%). These results provide additional evidence of end-to-end reliability, although they do not independently validate every reported counterexample.

Accuracy of the faithfulness checker. We acknowledge that independently establishing faithfulness-checker accuracy is challenging. To address this concern, we evaluate 150 probes using two external agent judges: Claude Opus 5.5 with Claude Code and GPT-6.1-sol with Codex. Each judge inspects the target code, probe, and available execution trace to determine whether the probe exercises the actual target and whether the observed evidence originates from that target. For each configuration, we randomly sample 25 probes from each of FALCON's three decision categories. The table below reports agreement with each judge.

ConfigurationFALCON decision#Probes#SampledAgreement w/ Opus 5.5 (%)Agreement w/ GPT-6.1-sol (%)
SWE-agent / GPT-5.4Admitted47652592.088.0
Rejected by FstatF_{\text{stat}}672584.088.0
Rejected by FattF_{\text{att}}3772596.092.0
Overall (weighted)52097592.1988.29
SWE-agent / DeepSeek-V4-ProAdmitted232125100.0100.0
Rejected by FstatF_{\text{stat}}1172588.084.0
Rejected by FattF_{\text{att}}2992596.088.0
Overall (weighted)27377599.0598.01

Both judges agree with most FALCON decisions across all three categories, although agreement is lower for static rejections. The weighted agreement rates reach 92.19% and 88.29% for SWE-agent/GPT-5.4, and 99.05% and 98.01% for SWE-agent/DeepSeek-V4-Pro, respectively.

We have added these end-to-end reliability and faithfulness evaluations to Appendices C.7 and C.8 of the revised paper, respectively.

Once again, thank you for your constructive feedback. We hope our additional experiments and clarifications address your concerns and better highlight FALCON's contributions.


References:

[1] Nunez, Ana, et al. "AutoSafeCoder: A Multi-Agent Framework for Securing LLM Code Generation through Static Analysis and Fuzz Testing." arXiv:2409.10737 (2024).

[2] Liu, Bin, et al. "A Dual-Loop Agent Framework for Automated Vulnerability Reproduction." arXiv:2602.05721 (2026).

[3] Gezgin, Derin, et al. "I Can't Believe It's Not a Valid Exploit." arXiv:2602.04165 (2026).

[4] Guo, Chengquan, et al. "BlueCodeAgent: A Blue Teaming Agent Enabled by Automated Red Teaming for CodeGen AI." arXiv preprint arXiv:2510.18131 (2025).

Comments on the paper

6 comments

Dear Reviewer 5QNk, thank you for the detailed review and the concrete suggestions for additional experiments. Below, we respond to all of your concerns with new results and clarifications. To keep our response concise and easy to follow, we address related weaknesses and questions together and refer to them by their original numbers.

1. End-to-end reliability on generated probes (W1, Q1)

We evaluate the verifier on benchmark-provided inputs in Table 2 because these inputs have ground-truth labels. For attacker-generated probes, the benchmark verdict cannot directly establish whether a reported violation is correct because when FALCON flags a program that passes CWEval's security tests, the difference may come from either a verifier error or a vulnerability that the tests do not cover. Appendix C.2, in turn, characterizes attack exploration and reports attack success using FALCON's own verdicts.

To further assess end-to-end reliability, we compare FALCON's verdicts with CWEval's security-test outcomes across all 119 tasks, using GPT-5.4-mini as both the coding model and attacker. Every insecure verdict includes a replayable counterexample, allowing us to examine disagreements with Claude Opus 5.5 running in Claude Code. Unlike the Stage 3 judge, this external agent has access to the candidate source, probe, and trace, and can execute code to reproduce the reported violation.

We also compare Claude Opus 5.5's judgments with author annotations on 20 randomly sampled tasks. The two agree on verdict correctness for all 20 tasks. The table below summarizes the comparison across all 119 tasks.

CaseFALCON verdictCWEval verdict#Tasks
Ainsecureinsecure42
Binsecuresecure3
Csecure / no-evidenceinsecure4
Dsecure / no-evidencesecure70

FALCON's verdict matches CWEval's security tests on 112 of the 119 tasks (94.1%). Of the 45 programs that FALCON marks insecure, 42 also fail CWEval's security tests (93.3%). Claude Opus 5.5 additionally confirms a vulnerability missed by CWEval in one of the three programs in case B, providing program-level support for 43 of the 45 flags (95.6%). FALCON also detects 42 of the 46 programs that fail CWEval's security tests (91.3%).

We have added this end-to-end evaluation to Appendix C.7 of the revised paper.

2. Accuracy of the faithfulness checker (W1, Q1)

We acknowledge that establishing faithfulness-checker accuracy through autonomous evaluation is challenging. However, to address this concern, we evaluate 150 probes using two external agent judges: Claude Opus 5.5 with Claude Code and GPT-6.1-sol with Codex. Each judge inspects the target code, probe, and available execution trace to assess whether the probe exercises the actual target and whether its evidence originates from that target. For each configuration, we randomly sample 25 probes from each of FALCON’s three decision categories. Table below reports agreement with each judge.

ConfigurationFALCON decision#Probes#SampledAgreement w/ Opus 5.5 (%)Agreement w/ GPT-6.1-sol (%)
SWE-agent / GPT-5.4Admitted47652592.088.0
Rejected by FstatF_{\text{stat}}672584.088.0
Rejected by FattF_{\text{att}}3772596.092.0
Overall (weighted)52097592.1988.29
SWE-agent / DeepSeek-V4-ProAdmitted232125100.0100.0
Rejected by FstatF_{\text{stat}}1172588.084.0
Rejected by FattF_{\text{att}}2992596.088.0
Overall (weighted)27377599.0598.01

Across configurations and judges, disagreement ranges from 0 to 12% for sampled admissions, indicating possible incorrect acceptance. For sampled static and runtime rejections, disagreement ranges from 12 to 16% and 4 to 12%, respectively, indicating possible incorrect rejection. An incorrectly admitted probe can produce a false violation report, while an incorrectly rejected probe removes useful evidence and may leave a real vulnerability undetected. These results provide external corroboration of the faithfulness checker's decisions, although agreement with external judges does not establish ground-truth accuracy.

We have added this external evaluation of the faithfulness checks to Appendix C.8 of the revised paper.

3. Uncertain and no-evidence outcomes (W1, Q2)

Uncertain handling in Table 2. Thank you for highlighting this concern. In Table 2, the Stage 1 and Stage 1 + 2 rows count uncertain verdicts as secure when computing accuracy, since the deterministic stages flag a trace as insecure only when positive evidence of a violation is observed. This matches the RL reward in Section 3.6, where only an insecure verdict under VcoreV_{\text{core}} gives rsec=0r_{\text{sec}}=0. In the Stage 1 + 2 + 3 rows, uncertain traces are instead passed to the LLM trace judge for a final verdict.

Reward assignment for uncertain / no-evidence outcomes. We assign rsec=1r_{\text{sec}}=1 to uncertain and no-evidence outcomes because the absence of observed violations does not establish that the generated code is insecure. Penalizing these outcomes may incorrectly discourage secure solutions and push the policy toward overly defensive behavior that compromises functionality. To examine this design choice, we reduce their reward from 1.0 to 0.5 while keeping other settings unchanged. The table reports held-out Func-Sec@1.

Reward for uncertain / no-evidenceQwen2.5-Coder-3BQwen2.5-Coder-7B
1.0 (original)49.2768.70
0.545.8266.41

Reducing the reward decreases Func-Sec@1 by 3.45 and 2.29 points for the 3B and 7B models, respectively. This suggests that penalizing inconclusive outcomes can harm overall performance, although it does not establish that all positively rewarded outcomes are secure.

Fraction of positive rewards from uncertain / no-evidence outcomes. To investigate potential reward exploitation, we further track the proportion of positive security rewards attributed to uncertain and no-evidence verdicts throughout RL training.

Step3B: Uncertain3B: No-evidence7B: Uncertain7B: No-evidence
111.4%9.8%12.9%9.3%
5012.8%9.2%12.3%10.4%
1009.4%11.0%7.2%9.9%
20010.0%4.7%8.7%6.3%
3008.0%7.8%9.1%8.5%
4009.7%7.8%8.1%5.8%
4998.0%9.4%7.2%8.6%

The combined proportion of uncertain and no-evidence outcomes fluctuates throughout training, decreasing from 21.2% to 17.4% for the 3B model and from 22.2% to 15.8% for the 7B model between the first and final recorded steps. These results provide no evidence that the policy increasingly exploits inconclusive verdicts to obtain positive security rewards.

We have clarified how uncertain verdicts are counted in Section 4.3 and Table 2, and added these RL analyses to Appendix C.12 of the revised paper.

4. Fixed vs. adaptive probes (W1)

To examine the effect of probe reuse, we compare fixed probes with adaptive probes regenerated every KK training steps by Qwen3-8B, while the trained model is Qwen2.5-Coder-3B. All other settings remain unchanged. We report held-out Func-Sec@1 and total GPU-hours, including RL training and attack-probe generation.

Probe settingFunc-Sec@1Total GPU-hours
Fixed49.2798.77
Adaptive (K=20K=20)48.87110.12
Adaptive (K=10K=10)51.61123.98

Adaptive probe generation with K=10K=10 improves Func-Sec@1 by 2.34 points over fixed probes, but increases GPU cost by 25.5%. In contrast, K=20K=20 slightly underperforms fixed probes despite higher computational cost. These results suggest that more frequent probe regeneration can improve security performance, but the gains are not consistent across regeneration frequencies and come with additional computational overhead. We therefore use fixed probes in our main experiments for better computational efficiency.

We have added this comparison of fixed and adaptive probes to Appendix C.12 of the revised paper.

5. Component ablations with identical initial programs (W2, Q3)

To isolate the contribution of each component, we conduct ablations under the same repair protocol (GPT-5.4-mini, five rounds), using identical initial programs across all configurations. We separately remove the faithfulness check, counterexample feedback, and Stage 3 LLM trace judge, while keeping all other settings unchanged.

MethodFunc@1Sec@1Func-Sec@1
GPT-5.4-mini (round 1, no repair)83.1965.5561.34
FALCON (full)88.2489.9286.55
w/o faithfulness check87.3982.3578.99
w/o counterexample feedback (verdict only)84.8775.6371.43
w/o Stage 3 (trace LLM judge)87.3985.7182.35

Removing faithfulness checks, counterexample feedback, and Stage 3 decreases Func-Sec@1 by 7.56, 15.12, and 4.20 points, respectively. Counterexample feedback has the largest impact, highlighting the importance of providing concrete execution evidence for repair rather than verdicts alone. The remaining ablations further demonstrate the contributions of faithfulness filtering and LLM-based trace verification. These results support the complementary roles of FALCON's components in improving functional correctness and security.

We have added these controlled component ablations to Appendix C.9 of the revised paper.

6. Comparison with related baselines and cost breakdown (W2, Q3)

To further evaluate FALCON's effectiveness and computational cost, we compare it with two additional baselines, AutoSafeCoder [1] and BlueCodeAgent [2], under the repair protocol in Section 4.2.1 (GPT-5.4-mini, five rounds, held-out tests hidden). Since AutoSafeCoder supports only Python, we restrict this comparison to Python tasks. For a fair comparison, we use its released implementation with GPT-5.4-mini and the same initial solutions as FALCON. For BlueCodeAgent, we adapt its vulnerability-detection pipeline using GPT-5.4-mini and use its security findings as feedback in the same five-round repair loop. The table below reports Func-Sec@1 and costs per instance.

Method (Python only)Input generation (tokens)Execution (s)Verification (tokens)Total (tokens / s)Func-Sec@1
GPT-5.4-mini (no repair)N/AN/AN/AN/A64.00
AutoSafeCoder4.8k3.02.0k6.8k / 3.0 s68.00
BlueCodeAgent0.2k0.44.2k4.4k / 0.4 s80.00
FALCON4.8k1.80.9k (+ 0.004 s rules)5.7k / 1.8 s92.00

FALCON achieves the highest Func-Sec@1 of 92.00%, outperforming BlueCodeAgent by 12.00 points and AutoSafeCoder by 24.00 points. Compared with AutoSafeCoder, FALCON also reduces assessment token consumption by 16.2% and execution time by 40.0%, demonstrating stronger security performance at lower computational cost.

We additionally report assessment costs per instance for the four security feedback methods evaluated in Section 4.2.1: static analysis (CodeQL), LLM-as-a-Judge, attacker-only, and FALCON, under the same repair protocol (GPT-5.4-mini, five rounds, held-out tests hidden).

MethodInput generation (tokens)Execution (s)Verification (tokens)Total (tokens / s)Func-Sec@1
GPT-5.4-mini (round 1, no repair)N/AN/AN/AN/A61.34
Static analyzer (CodeQL)N/AN/A0 (0.002 s)0 / 0.002 s68.07
LLM-as-a-JudgeN/AN/A9.0k9.0k / 0 s60.50
Attacker-only5.4k3.1N/A5.4k / 3.1 s59.66
FALCON4.9k2.11.0k (+ 0.004 s rules)5.9k / 2.1 s86.55

The weaker performance of LLM-as-a-Judge and attacker-only highlights the importance of combining executable attack probes with reliable evidence-based verification. Overall, FALCON achieves the highest Func-Sec@1 while maintaining competitive assessment costs, demonstrating a favorable balance between security effectiveness and computational efficiency.

We have added these baseline comparisons and costs per instance to Appendix C.10 of the revised paper.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.