potentialpaper

Secure Agentic Coding through Counterexample-Grounded Feedback

Anonymous authors

ICLR 2027

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. FALCON separates attack exploration from verification to provide reliable security feedback for code repair and reinforcement learning.

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.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
17 Sep 2026ICLR 2027submittedICLR 2027Under reviewreviews ↓[1]PDF[1]
Missing a version?

ICLR 2027

Under review · 3 reviews · OpenReview

Updated 25 Nov 2026, 10:38 UTC.

Reviewer LBjAOpenReview ↗
Rating
3/4(+1)
Confidence
3/4
Soundness
2/3
Presentation
3/3
Informativeness
3/3(+1)
Read review
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.

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.
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 the 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
Authors · CommentOpenReview ↗

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 setting Func-Sec@1 Total GPU-hours
Fixed 49.27 98.77
Adaptive (K=20K=20) 48.87 110.12
Adaptive (K=10K=10) 51.61 123.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-evidence Qwen2.5-Coder-3B Qwen2.5-Coder-7B
1.0 (original) 49.27 68.70
0.5 45.82 66.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.

Step 3B: Uncertain 3B: No-evidence 7B: Uncertain 7B: No-evidence
1 11.4% 9.8% 12.9% 9.3%
50 12.8% 9.2% 12.3% 10.4%
100 9.4% 11.0% 7.2% 9.9%
200 10.0% 4.7% 8.7% 6.3%
300 8.0% 7.8% 9.1% 8.5%
400 9.7% 7.8% 8.1% 5.8%
499 8.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.

Authors · CommentOpenReview ↗

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.

Method Func@1 Sec@1 Func-Sec@1
GPT-5.4-mini (round 1, no repair) 83.19 65.55 61.34
FALCON (full) 88.24 89.92 86.55
w/o faithfulness check 87.39 82.35 78.99
w/o counterexample feedback (verdict only) 84.87 75.63 71.43
w/o Stage 3 (trace LLM judge) 87.39 85.71 82.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.

Configuration FALCON decision #Probes #Sampled Agreement w/ Opus 5.5 (%) Agreement w/ GPT-6.1-sol (%)
SWE-agent / GPT-5.4 Admitted 4765 25 92.0 88.0
Rejected by FstatF_{\text{stat}} 67 25 84.0 88.0
Rejected by FattF_{\text{att}} 377 25 96.0 92.0
Overall (weighted) 5209 75 92.19 88.29
SWE-agent / DeepSeek-V4-Pro Admitted 2321 25 100.0 100.0
Rejected by FstatF_{\text{stat}} 117 25 88.0 84.0
Rejected by FattF_{\text{att}} 299 25 96.0 88.0
Overall (weighted) 2737 75 99.05 98.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.

Authors · CommentOpenReview ↗

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.

Run Proxy reward (3B) Func-Sec@1 (3B) Proxy reward (7B) Func-Sec@1 (7B)
REAL 0.946 38.75 0.964 57.13
FALCON + REAL 0.830 57.25 0.849 70.87
SecCodePRM 0.958 29.46 0.943 54.50
FALCON + SecCodePRM 0.842 51.95 0.857 77.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/4
Confidence
3/4
Soundness
2/3
Presentation
3/3
Informativeness
1/3
Read review
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.

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.

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 the authors

Please see Weaknesses above

6 comments
Authors · CommentOpenReview ↗

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.

Method Input generation (tokens) Execution (s) Verification (tokens) Total (tokens / s) Func-Sec@1
GPT-5.4-mini (no repair) N/A N/A N/A N/A 64.00
AutoSafeCoder 4.8k 3.0 2.0k 6.8k / 3.0 s 68.00
BlueCodeAgent 0.2k 0.4 4.2k 4.4k / 0.4 s 80.00
FALCON 4.8k 1.8 0.9k (+ 0.004 s rules) 5.7k / 1.8 s 92.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.

Authors · CommentOpenReview ↗

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.

Method Func@1 Sec@1 Func-Sec@1
GPT-5.4-mini (round 1, no repair) 83.19 65.55 61.34
FALCON (full) 88.24 89.92 86.55
w/o faithfulness check 87.39 82.35 78.99
w/o counterexample feedback (verdict only) 84.87 75.63 71.43
w/o Stage 3 (trace LLM judge) 87.39 85.71 82.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-evidence Qwen2.5-Coder-3B Qwen2.5-Coder-7B
1.0 (original) 49.27 68.70
0.5 45.82 66.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.

Step 3B: Uncertain 3B: No-evidence 7B: Uncertain 7B: No-evidence
1 11.4% 9.8% 12.9% 9.3%
50 12.8% 9.2% 12.3% 10.4%
100 9.4% 11.0% 7.2% 9.9%
200 10.0% 4.7% 8.7% 6.3%
300 8.0% 7.8% 9.1% 8.5%
400 9.7% 7.8% 8.1% 5.8%
499 8.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.

Authors · CommentOpenReview ↗

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.

Case FALCON verdict CWEval verdict #Tasks
A insecure insecure 42
B insecure secure 3
C secure / no-evidence insecure 4
D secure / no-evidence secure 70

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.

Configuration FALCON decision #Probes #Sampled Agreement w/ Opus 5.5 (%) Agreement w/ GPT-6.1-sol (%)
SWE-agent / GPT-5.4 Admitted 4765 25 92.0 88.0
Rejected by FstatF_{\text{stat}} 67 25 84.0 88.0
Rejected by FattF_{\text{att}} 377 25 96.0 92.0
Overall (weighted) 5209 75 92.19 88.29
SWE-agent / DeepSeek-V4-Pro Admitted 2321 25 100.0 100.0
Rejected by FstatF_{\text{stat}} 117 25 88.0 84.0
Rejected by FattF_{\text{att}} 299 25 96.0 88.0
Overall (weighted) 2737 75 99.05 98.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).

Reviewer 5QNkOpenReview ↗
Rating
3/4(+1)
Confidence
4/4
Soundness
2/3
Presentation
3/3
Informativeness
2/3
Read review
Summary

The paper introduces FALCON, a security-feedback framework that separates adversarial probe generation from verification of observed program behavior. Faithfulness checks reject probes that replace the target or fabricate evidence, while a staged verifier combines crash detection, deterministic CWE rules, and an LLM trace judge. FALCON supports both iterative code repair and reinforcement learning. Experiments report approximately 22–25 % point improvements in joint functional-security performance on CWEval and SecCodeBench-V2, smaller consistent security gains across three repository-level agent harnesses on SusVibes, and stronger held-out RL performance than static-analysis or learned security rewards.

Strengths
  1. Evaluation measures whether security feedback transfers to actual task outcomes. On CWEval, FALCON improves held-out Func-Sec@1 from 61.34% to 86.55%, whereas source-code judging and attacker-generated expected-output tests show little or negative improvement. Evaluating both the optimized signal and independent outcomes directly addresses an important failure mode of automated security feedback.
  2. The framework demonstrates useful breadth. Improvements extend across multiple languages, benchmarks, coding models, repository harnesses, and two RL model sizes, generally preserving functionality. The execution-based counterexamples also provide actionable repair feedback, and the faithfulness checks address a concrete problem: apparent vulnerabilities caused by the probe rather than the target.
Weaknesses
  1. Verifier accuracy does not establish end-to-end reliability on generated probes. Table 2 evaluates traces from benchmark-provided inputs, while Appendix C.2 measures attack success using FALCON's own verdicts. Neither independently establishes the correctness of judgments on attacker-generated probes or the accuracy of faithfulness filtering. This matters especially because RL awards positive security reward to uncertain and no-evidence outcomes while reusing fixed probes (§3.6, Appendix B.2). The authors acknowledge probe reuse as a limitation (§5, Appendix D), and the held-out improvements are encouraging, but this potential route to reward exploitation is not measured.

  2. The experiments insufficiently isolate the distinctive components and their cost. There are no downstream repair/RL ablations removing faithfulness checks or individual verifier stages. Repair signals also start from independently generated solutions, and Table 2 excludes attack-generation and execution overhead; the authors acknowledge execution overhead as a limitation (§5, Appendix D) but do not quantify it. Related systems that already incorporate dynamic testing, such as BlueCodeAgent (Guo et al., 2025) and AutoSafeCoder (Nunez et al., 2024), are cited in §2 but not compared against empirically. Stronger controlled comparisons would clarify FALCON's incremental contribution and practical efficiency.

Questions for the authors
  1. Can you provide an independently adjudicated evaluation of attacker-generated probes, including verifier errors and incorrect acceptance or rejection by the faithfulness checks?

  2. How are uncertain outcomes handled when computing the deterministic-stage accuracy in Table 2? During RL, what fraction of positive security rewards come from uncertain or no-evidence outcomes rather than cleared traces, and does this fraction increase during training?

  3. Can you quantify the downstream contribution of faithfulness filtering and Stage 3 using identical initial programs, and report total attack-generation, verification, and execution costs?

  4. Can you report a functionality-only baseline (λ = 0) on held-out Func-Sec@1 to establish FALCON’s contribution beyond functional training? Additionally, the combined reward is 0.5r_func + 0.25r_FALCON + 0.25r_proxy, which halves the proxy’s coefficient relative to the standalone baseline. Can you therefore evaluate REAL and SecCodePRM with matched functionality-to-proxy weighting (2:1, equivalent to λ = 1/3 after rescaling), while controlling reward normalization and effective KL regularization? These controls would help distinguish the benefit of FALCON’s security information from the benefit of weakening an overoptimizable proxy reward.

Ethics concerns

None

5 comments
Authors · CommentOpenReview ↗

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.

Case FALCON verdict CWEval verdict #Tasks
A insecure insecure 42
B insecure secure 3
C secure / no-evidence insecure 4
D secure / no-evidence secure 70

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.

Configuration FALCON decision #Probes #Sampled Agreement w/ Opus 5.5 (%) Agreement w/ GPT-6.1-sol (%)
SWE-agent / GPT-5.4 Admitted 4765 25 92.0 88.0
Rejected by FstatF_{\text{stat}} 67 25 84.0 88.0
Rejected by FattF_{\text{att}} 377 25 96.0 92.0
Overall (weighted) 5209 75 92.19 88.29
SWE-agent / DeepSeek-V4-Pro Admitted 2321 25 100.0 100.0
Rejected by FstatF_{\text{stat}} 117 25 88.0 84.0
Rejected by FattF_{\text{att}} 299 25 96.0 88.0
Overall (weighted) 2737 75 99.05 98.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.

Authors · CommentOpenReview ↗

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-evidence Qwen2.5-Coder-3B Qwen2.5-Coder-7B
1.0 (original) 49.27 68.70
0.5 45.82 66.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.

Step 3B: Uncertain 3B: No-evidence 7B: Uncertain 7B: No-evidence
1 11.4% 9.8% 12.9% 9.3%
50 12.8% 9.2% 12.3% 10.4%
100 9.4% 11.0% 7.2% 9.9%
200 10.0% 4.7% 8.7% 6.3%
300 8.0% 7.8% 9.1% 8.5%
400 9.7% 7.8% 8.1% 5.8%
499 8.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 setting Func-Sec@1 Total GPU-hours
Fixed 49.27 98.77
Adaptive (K=20K=20) 48.87 110.12
Adaptive (K=10K=10) 51.61 123.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.

Authors · CommentOpenReview ↗

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.

Method Func@1 Sec@1 Func-Sec@1
GPT-5.4-mini (round 1, no repair) 83.19 65.55 61.34
FALCON (full) 88.24 89.92 86.55
w/o faithfulness check 87.39 82.35 78.99
w/o counterexample feedback (verdict only) 84.87 75.63 71.43
w/o Stage 3 (trace LLM judge) 87.39 85.71 82.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/A N/A N/A N/A 64.00
AutoSafeCoder 4.8k 3.0 2.0k 6.8k / 3.0 s 68.00
BlueCodeAgent 0.2k 0.4 4.2k 4.4k / 0.4 s 80.00
FALCON 4.8k 1.8 0.9k (+ 0.004 s rules) 5.7k / 1.8 s 92.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).

Method Input generation (tokens) Execution (s) Verification (tokens) Total (tokens / s) Func-Sec@1
GPT-5.4-mini (round 1, no repair) N/A N/A N/A N/A 61.34
Static analyzer (CodeQL) N/A N/A 0 (0.002 s) 0 / 0.002 s 68.07
LLM-as-a-Judge N/A N/A 9.0k 9.0k / 0 s 60.50
Attacker-only 5.4k 3.1 N/A 5.4k / 3.1 s 59.66
FALCON 4.9k 2.1 1.0k (+ 0.004 s rules) 5.9k / 2.1 s 86.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.

Comments on the paper

1 comment
Authors · CommentOpenReview ↗

General Response to All Reviewers

We thank the reviewers for recognizing the motivation behind FALCON, the strength of its results, and the breadth of our evaluation across models and benchmarks. During the rebuttal, we responded to each question in detail and added the experiments and analyses the reviewers requested, including:

  • Reliability of security judgments (Reviewer 5QNk, Reviewer samV, Reviewer LBjA). FALCON’s verdicts agreed with independent security tests on 94.1% of CWEval tasks. Two external judges also agreed with most of the faithfulness checker’s decisions across 150 sampled probes. These findings support both FALCON’s ability to identify insecure programs and its ability to assess whether the evidence comes from the program under test.

  • Contribution of each FALCON component (Reviewer 5QNk, Reviewer samV, Reviewer LBjA). Starting from identical programs, we found that removing the faithfulness checks, counterexample feedback, or trace judge reduced Func-Sec@1 by 7.56, 15.12, and 4.20 points, respectively. All three components therefore contribute to FALCON, and the largest benefit comes from giving the coding model a concrete example of how its program failed instead of only a verdict.

  • Methodological contribution and comparison with prior methods (Reviewer 5QNk, Reviewer samV). FALCON separates attack generation from the judgment of observed program behavior. Its verifier can flag a violation even when the program does not crash and checks that the evidence comes from the target program before using it as feedback. Under the same Python repair protocol, FALCON achieved 92% Func-Sec@1, compared with 80% for BlueCodeAgent and 68% for AutoSafeCoder. FALCON also used 16.2% fewer assessment tokens and 40% less execution time than AutoSafeCoder, achieving stronger repair performance at a lower assessment cost in this comparison.

  • Reliability of the RL reward (Reviewer 5QNk, Reviewer samV, Reviewer LBjA). On both Qwen2.5-Coder models, giving uncertain and no-evidence outcomes full reward yielded better held-out performance than reducing their reward to 0.5. From the first to the final training step, the share of all positive security rewards assigned to inconclusive rollouts that failed independent safety tests fell from 9.2% to 3.6% for 3B and from 9.1% to 2.6% for 7B. These results support retaining the full reward and provide no indication of increasing exploitation of inconclusive verdicts in either run.

  • Fixed and adaptive probes (Reviewer 5QNk, Reviewer samV, Reviewer LBjA). Regenerating probes every 10 training steps improved held-out Func-Sec@1 by 2.34 points at a 25.5% increase in GPU-hours. Regenerating them every 20 steps cost more than reusing fixed probes and yielded no improvement. These results support our use of fixed probes as an efficient choice while showing that more frequent regeneration can improve performance when additional compute is available.

  • Contribution of FALCON to RL training (Reviewer 5QNk, Reviewer LBjA). Adding FALCON’s security reward improved held-out Func-Sec@1 by 23.66 points over functionality-only training on the Qwen2.5-Coder-3B model. Combining FALCON with REAL or SecCodePRM also outperformed each proxy alone when we matched the relative weights of the functionality and proxy rewards. These controls show that FALCON contributes security information beyond what either proxy captures. The training examples illustrate how execution evidence distinguishes programs that receive similarly high proxy scores.

  • Repair across weakness types (Reviewer LBjA). We observed repair gains on tasks both with and without a matching detection rule. On the 39 tasks without a matching rule, Func-Sec@1 rose from 74.36% to 89.74%, showing that FALCON’s repair feedback remains useful beyond the weakness types its rules explicitly cover.

  • Contribution of the verifier and faithfulness check in RL (Reviewer samV). In response to the reviewer's follow-up, we compared FALCON with direct attacker feedback on Qwen2.5-Coder-3B. Replacing the attacker’s own expected outputs with FALCON’s deterministic verifier improved held-out Func-Sec@1 by 6.10 points, and adding the faithfulness check gave a further 4.76 points. These results show that both independent verification and faithfulness checking contribute to held-out performance in RL, supporting the design of FALCON’s security reward.

The full results are available in Appendices C.6 through C.15 of the revised manuscript. We thank the reviewers again for the suggestions that helped strengthen the paper. We welcome any remaining questions before the discussion period closes.

Best regards,
The Authors

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

Missing a submission?

Loading the discussion…

This paper is under review