From Patch Generation to Evidence: Building Trust in AI-Generated Code
Ela Avrahami (Founder, AI & Software Advisor · Knostic)
[un]prompted II 2026 — The AI Security Practitioner Conference · Day 3 · Stage 2
Overview
In an era where Artificial Intelligence is increasingly capable of generating complex code, the critical challenge shifts from mere generation to establishing trust in AI's output. Ela Avrahami, Founder and AI & Software Advisor at Knostic, addressed this crucial concern in her talk at [un]prompted II, presenting an innovative project: an AI-powered security patch generation and trust system called Open Ant Auto Patcher. Avrahami's presentation, delivered shortly after a 15-day silent meditation retreat, underscored the profound belief that building trust in AI systems is paramount for anyone working with this transformative technology.

Key moments
- 2:00 Benchmarks show low trust in AI-generated security patches
- 4:00 Why human review is essential for trusting AI code
- 5:50 Four trust recommendations from the AI patching system
- 8:40 Demonstrating the AI-generated patch and detailed trust report
- 10:40 Lesson 1: Actively challenging AI-generated patches is crucial
- 16:50 Results: One trusted green light, many manual reviews
- 18:20 Key takeaway: What evidence justifies acting on AI outputs?
From Patch Generation to Evidence: Building Trust in AI-Generated Code
Speakers: Ela Avrahami (Founder, AI & Software Advisor, Knostic)
Conference: [un]prompted II
YouTube: https://www.youtube.com/watch?v=WCexTevGH7E
Overview
In an era where Artificial Intelligence is increasingly capable of generating complex code, the critical challenge shifts from mere generation to establishing trust in AI's output. Ela Avrahami, Founder and AI & Software Advisor at Knostic, addressed this crucial concern in her talk at [un]prompted II, presenting an innovative project: an AI-powered security patch generation and trust system called Open Ant Auto Patcher. Avrahami's presentation, delivered shortly after a 15-day silent meditation retreat, underscored the profound belief that building trust in AI systems is paramount for anyone working with this transformative technology.
The core of the talk revolved around a fundamental problem: while AI can now produce plausible code fixes for vulnerabilities, having sufficient evidence to trust these fixes remains a significant hurdle. Avrahami highlighted that automated evaluation often misses the nuanced understanding that human reviewers bring, such as grasping the root cause, ensuring repository fit, and assessing potential risks. Knostic's project aims to bridge this gap by not just generating patches, but by accompanying them with a comprehensive trust report that provides structured evidence and clear recommendations, moving the industry closer to a future where AI-generated code can be deployed with confidence.
This article delves into the technical intricacies of Open Ant Auto Patcher, exploring its design philosophy, key components, and the lessons learned during its development. It examines how the system seeks to emulate human review processes, focusing on adversarial validation, explicit handling of uncertainty, and meticulous context management, ultimately providing a framework for building verifiable trust in AI-generated security solutions.
Background
▶ Watch: Benchmarks show low trust in AI-generated security patches (2:00)
The increasing sophistication of Large Language Models (LLMs) has led to remarkable advancements in code generation, with security patch generation being a prominent application. However, as Avrahami meticulously detailed, the journey from a plausible fix to a deployable, trustworthy solution is fraught with challenges. Benchmarks illustrate this disparity:
- Patch Evolve Verified reported that 84% of their generated patches passed basic security and functionality tests, a seemingly impressive figure.
- Meta's Auto Patch Bench Light benchmark presented a more sobering reality. While 65% of generated patches could be built and caused no crashes, only 11% survived rigorous fuzzing and differential testing. After a final human review, a mere 4% of all initial patches were deemed acceptable.
These numbers, despite varying metrics, consistently point to the same conclusion: generating a plausible fix and generating a trustworthy fix backed by sufficient evidence are fundamentally different problems.
The discrepancy arises from the different lenses through which automated systems and human experts evaluate code. Automated evaluation typically focuses on direct questions: "Does it fix the vulnerability?" "Do tests still pass?" "Does it survive automated validation?" While essential, these signals are often insufficient. Human reviewers, in contrast, adopt a holistic perspective. They investigate the root cause of the vulnerability, assess the repository fit (adhering to conventions, code style, and maintainer preferences), and, crucially, demand evidence to mitigate the risk of regressions or the introduction of new issues. Maintainers, in particular, prioritize code quality and integration before approving any changes. This gap between automated efficiency and human-level scrutiny underscores the need for systems that can provide the kind of comprehensive evidence required for building trust in AI-generated security patches.
Key Findings
▶ Watch: Four trust recommendations from the AI patching system (5:50)
The central contribution of Avrahami's talk is the introduction of Open Ant Auto Patcher, an AI-powered security patching system designed to generate not just code, but also a trust report that justifies its recommendations. This system represents a significant shift in mindset, prioritizing evidence and verifiability over raw generation capability.
The system's final recommendation falls into one of four categories:
- Green Light (Deploy after Validation): The strongest recommendation, indicating high confidence, though human validation is still advised.
- Manual Review Required: An orange light, suggesting further human inspection is necessary due to remaining concerns.
- Do Not Apply: A red light, issued if mechanical issues or critical flaws are detected.
- No Patch Produced: If insufficient evidence prevents the generation of a reliable patch.
Through the development of Open Ant Auto Patcher, Knostic gleaned three critical lessons for building trustworthy AI systems:
- Try to Prove the Patch Wrong: Initially, the focus was on verifying that a patch worked and closed the vulnerability. However, passing basic verification is insufficient, as residual vulnerabilities or unseen failure paths might exist. To address this, a dedicated Challenger unit was introduced. This separate, adversarial component actively scrutinizes the generated patch and the repository, searching for residual vulnerabilities or missing evidence. This shifts the core question from "Does it work?" to "How could it still be wrong?", fostering a more robust validation process.
- Give Uncertainty Its Own State: LLMs, when faced with a lack of information, tend to guess rather than admit uncertainty. This leads to inconsistent and unreliable outcomes. Open Ant Auto Patcher explicitly addresses this by introducing a specific state for "insufficient evidence." This ensures that if the system cannot definitively answer a question or lacks the necessary context, it transparently communicates this uncertainty, preventing false confidence and ensuring that missing evidence remains acknowledged as missing.
- Control What Context Is Staged and Hurts: The management of context fed to LLMs is crucial. Initial attempts either provided too little context, leading to guessing, or too much, which inadvertently biased the model. Over-sharing context caused the model's internal concerns to become "facts" rather than hypotheses to be checked. The refined approach ensures that only relevant context—grounded in facts, code, and direct evidence—is passed between the different stages of the patching process. This separation prevents premature conclusions and assumptions from biasing the model's output.
The efficacy of Open Ant Auto Patcher was evaluated against 50 real-world CVEs. The results highlighted the system's conservative yet reliable approach:
- 2% (1 case) received a "Green Light" recommendation.
- 68% were marked "Manual Review Required."
- 0% received a "Do Not Apply" recommendation.
- 30% resulted in "No Patch Produced."
While 2% might seem low, the most significant finding was the trustworthiness of the Green Light. The single "Green Light" recommendation was thoroughly justified and found to be equivalent to the upstream fix provided by maintainers. Further sanity checks on the 35 generated patches revealed that 40% were equivalent or substantially aligned with upstream fixes, 20% were partial, and 34% diverged. Crucially, all 19 "bad patches" (partial or divergent) correctly received an "orange light" for manual review, demonstrating the system's ability to flag problematic fixes. The remaining 13 "good patches" that were not "Green Light" still received "orange," indicating room for improvement in reducing false negatives, but affirming the reliability of the highest confidence recommendations. This demonstrates that prioritizing the trustworthiness of high-confidence outputs is a critical first step towards autonomous AI-driven security.
Technical Deep Dive
▶ Watch: Demonstrating the AI-generated patch and detailed trust report (8:40)
The Open Ant Auto Patcher is an AI-powered security patching system developed as part of the open-source Open Ant project. Its primary function is to automate the generation and validation of security patches for known vulnerabilities, providing a trust report to guide human decision-making.
The system's pipeline is initiated by providing a CVE ID and the target repository. From there, it orchestrates a series of stages:
- Investigation: The system first analyzes the repository, identifying relevant files, functions, and classes (symbols) related to the vulnerability described by the CVE.
- Remediation Plan Generation: Based on the investigation, it formulates a plan for how the vulnerability might be addressed.
- Context Preparation: This stage generates the specific code and factual context necessary for the patch generation, adhering to the principle of providing only relevant information to prevent bias.
- Patch Generation: Using an LLM (the speaker noted they tried various "strongest" models, implying flexibility in LLM choice), the system generates a code patch based on the prepared context and remediation plan.
- Validation and Challenge: This is a critical stage involving an adversarial review by the Challenger unit. This unit is a separate, independent component designed to actively seek out residual vulnerabilities, edge cases, or missing evidence that the generated patch might overlook. It essentially tries to "break" the patch or find reasons why it might still be wrong.
The culmination of this pipeline is the trust report, a structured document designed to provide comprehensive evidence for the generated patch and its associated recommendation. The demo showcased a report for a URL Libs 3 CVE concerning a missing cookie in headers. Key elements of the trust report include:
- Recommendation: One of the four states (Green Light, Manual Review Required, Do Not Apply, No Patch Produced).
- Vulnerability Summary: A concise explanation of the CVE.
- Proposed Patch: The actual code changes generated by the system (e.g., adding a
cookieheader). - Trust Signals: A crucial section detailing specific checks and their outcomes. These signals include:
- Does the patch apply cleanly?
- Does it address the vulnerability?
- Are there any unresolved concerns? (The demo showed three unresolved concerns, leading to a "Manual Review Required" recommendation).
- Do relevant tests already exist?
- Is the deployment risk low?
- Was the edited content verified against the repository?
- Were there any new failures in tests?
- Explanations: Detailed justifications for the trust signals, outlining specific concerns, what validation actions a human should take, and why certain issues remain unresolved.
The system's architecture explicitly incorporates the "lessons learned." The Challenger unit embodies the principle of "proving the patch wrong," providing an independent, adversarial perspective. The explicit state for "insufficient evidence" prevents the LLM from fabricating answers when data is lacking, enhancing transparency and reliability. Finally, meticulous context management ensures that each stage operates on a clean, factual basis, preventing biases from propagating through the pipeline. While the system does not currently include fuzzing in its immediate pipeline, the adversarial review by the Challenger unit serves a similar purpose of robustly testing the patch's integrity.
Demo / Proof of Concept
▶ Watch: Results: One trusted green light, many manual reviews (16:50)
Ela Avrahami attempted a live demonstration of the Open Ant Auto Patcher, but due to anticipated network instability, she quickly transitioned to a pre-recorded video of the process. This allowed for a smooth walkthrough of the system's functionality.
The demo focused on a relatively simple, yet illustrative, vulnerability: a CVE in URL Libs 3 related to a missing cookie in HTTP headers. The command line invocation shown was open ant patch -c <CVE_ID> -r <repo_path> -o <output_path>, specifying the CVE, the local repository directory, and an output directory for the patch and report.
The video demonstrated the step-by-step execution of the Open Ant Auto Patcher pipeline:
- Repository Analysis: The system began by analyzing the target repository, identifying and logging symbols such as files, functions, and classes relevant to the vulnerability context.
- Remediation Plan Creation: Once the analysis was complete, a remediation plan was formulated and verified.
- Context Generation: The system then prepared the precise context required for patch generation, ensuring that only relevant information was staged.
- Patch Generation: With the context ready, the actual code patch was generated.
- Validation (Adversarial Review): The crucial validation phase commenced, including an adversarial review by the Challenger unit. During this stage, the system identified "some remaining concern," indicating potential issues or missing evidence.
Ultimately, the system's final recommendation for this specific CVE was "Manual Review Required" (orange light). Avrahami then walked through the generated trust report, highlighting its key sections:
- Vulnerability Summary: Briefly described the URL Libs 3 vulnerability related to missing cookies in headers.
- Proposed Patch: Showed the generated code, which involved adding a
cookieheader to address the vulnerability. - Trust Signals: This section was particularly detailed, indicating that while the patch applied cleanly and addressed the vulnerability, there were three unresolved concerns. The report provided explanations for these concerns and specified the validation actions a human reviewer should undertake. For example, it might detail why the deployment risk was not considered low or why certain edited content needed further verification against the repository, even if no new test failures were detected.
The demo effectively illustrated how Open Ant Auto Patcher moves beyond simply providing a patch. It delivers a comprehensive analysis of the patch's trustworthiness, explicitly outlining areas of concern and guiding human experts on where to focus their review efforts. This practical demonstration underscored the system's commitment to transparency and evidence-based recommendations.
Defensive Implications
▶ Watch: Key takeaway: What evidence justifies acting on AI outputs? (18:20)
The Open Ant Auto Patcher, with its emphasis on trust reports and evidence-backed recommendations, offers significant implications for cybersecurity defenders and software development teams. In an increasingly automated landscape, this system provides a crucial bridge between the speed of AI-driven code generation and the stringent security requirements of production environments.
Firstly, the system acts as an intelligent first responder for vulnerability remediation. Instead of security teams manually researching and crafting every patch, Open Ant can rapidly generate initial patch proposals for known CVEs. This significantly accelerates the initial stages of the patching lifecycle, allowing human experts to focus on higher-level strategic tasks rather than foundational coding.
Secondly, and most importantly, the trust report transforms the interaction with AI-generated code. It shifts the defensive posture from blindly validating an AI's output to intelligently auditing its reasoning. Defenders are no longer presented with a black-box solution; instead, they receive a structured breakdown of:
- What the AI believes: The proposed patch and its stated fixes.
- What the AI has verified: The positive trust signals (e.g., clean application, vulnerability addressed, existing tests pass).
- What the AI is uncertain about: The unresolved concerns and reasons for "Manual Review Required" or "No Patch Produced."
This transparency empowers security engineers to make informed decisions. For "Green Light" recommendations, defenders can fast-track the patch to minimal human validation and deployment, confident that the system's adversarial checks have been passed. For "Manual Review Required" patches, the report provides a precise roadmap of what to investigate, highlighting specific risks, missing evidence, or potential regressions, thereby optimizing human review time and effort.
The inclusion of an adversarial Challenger unit is a critical defensive feature. By actively attempting to prove a patch wrong, the system inherently reduces the risk of introducing new vulnerabilities or overlooking edge cases. This proactive "security by design" within the patch generation process itself is a significant advantage. Furthermore, the explicit handling of "insufficient evidence" prevents false positives and overconfidence, crucial in security contexts where mistakes can have severe consequences.
Finally, as an open-source project (Open Ant), the system invites community collaboration, scrutiny, and improvement. This transparency aligns with best practices in security, allowing defenders to understand the underlying mechanisms, contribute to its robustness, and adapt it to specific organizational needs. Ultimately, Open Ant Auto Patcher helps security teams move towards a future where AI augments their capabilities, providing not just answers, but also the verifiable evidence needed to build secure, trustworthy systems.
Key Takeaways
- Trust is Paramount, Not Just Generation: While AI excels at generating code, the critical challenge for security patches lies in building verifiable trust and providing sufficient evidence for safe deployment, moving beyond mere plausible fixes.
- Adversarial Validation is Essential: Robust AI patching systems must include an adversarial component, like the Challenger unit, to actively try and "prove the patch wrong" by searching for residual vulnerabilities or missing evidence, rather than just confirming it "works."
- Uncertainty Must Be Explicitly Stated: AI models should be designed to acknowledge and communicate "insufficient evidence" rather than guessing when context or information is lacking, preventing inconsistent and unreliable outcomes.
- Context Management Prevents Bias: Meticulous control over the context provided to LLMs is crucial; only relevant facts, code, and evidence should be staged between processes to avoid biasing the model and turning assumptions into facts.
- Trust Reports Guide Human Review: Comprehensive trust reports are vital, providing structured evidence, clear recommendations (e.g., Green Light, Manual Review Required), and specific details on unresolved concerns, enabling efficient and targeted human validation.
- Trustworthiness Over Volume (Initially): The primary goal should be to ensure the absolute trustworthiness of the highest-confidence AI-generated recommendations (e.g., "Green Light"), even if they are few, before aiming to increase the overall volume of deployable patches.
About the Speaker(s)
Ela Avrahami is a distinguished founder, currently working on her own ventures while also serving as an advisor to various startups and established companies. Her expertise spans critical domains including Artificial Intelligence, cybersecurity, and software engineering. In this talk, she represented Knostic, showcasing the innovative Open Ant Auto Patcher project, which reflects her commitment to advancing the reliability and trustworthiness of AI systems in practical security applications.
Reviews
→ Top-rated talks at [un]prompted II 2026 — The AI Security Practitioner Conference
All talks from [un]prompted II 2026 — The AI Security Practitioner Conference