Add weakness-specific negative tests, deterministic scanners and human disposition to pull requests containing AI-generated code.
What the October research actually changes
Veracode released its Fall 2026 GenAI code-security update on October 29. The company reports testing 18 models across Python, C#, JavaScript and Java against four weakness categories: SQL injection, cryptographic weaknesses, cross-site scripting and log injection. It reported an average pass rate of 62%, with most improvement concentrated in cross-site scripting.
Those are vendor research results, not a prediction for your repository. The test set, prompts, languages and surrounding controls may differ from production. Independent coverage on October 30 nevertheless created a useful current signal: security teams want a workflow that verifies generated code by weakness class rather than trusting syntax quality or a model name.
This guide is for AppSec engineers, platform teams and development leads already using AI coding assistants. It does not require Veracode and does not claim that any scanner can prove code safe.

- Problem: generated code can be correct-looking while failing security properties.
- Tools: existing CI, a SAST scanner, dependency checks, test framework and optional approved AI assistant.
- Output: a pull-request scorecard with test evidence, open findings, owner and disposition.
Declare the AI contribution and risk surface
Start the gate at the pull-request template. Ask the author to identify which files were generated or materially transformed, the intended behavior, security-sensitive data flows and the human reviewer. Do not collect private prompts if that would expose secrets; record the tool and workflow version instead.
Map changed code to likely weakness classes. A database query path should trigger SQL-injection negative tests; cryptographic changes should require approved primitives and key-handling review; rendered user input should trigger context-aware output tests; logging changes should test newline and delimiter handling.
The mapping is a routing decision, not a vulnerability finding. Keep a small, versioned ruleset that owners can inspect and change.
- Mark authentication, authorization, secrets, parsing and data-storage changes as high review.
- Require threat assumptions and expected failure behavior.
- Reject generated tests that only reproduce the happy path.
- Keep the generator separate from the final security decision.
Build deterministic checks before AI explanation
Run unit and integration tests, SAST, dependency analysis and targeted negative tests before asking another model to review the results. Deterministic tools produce stable artifacts that a reviewer can reproduce. Configure the merge gate on severity, asset sensitivity and exploit preconditions rather than a single vendor score.
A bounded explanation prompt can reduce review time: “Using only the attached scanner findings, diff and test output, group findings by CWE. For each item, cite the file, line or test ID; explain the violated security property; propose the smallest remediation; and list uncertainty. Do not mark a finding fixed and do not invent runtime behavior.”
The expected AI output is a cited explanation and remediation draft. It must not suppress findings, change scanner configuration or approve the pull request.
Review the weakness, not the model's confidence
Assign each blocking finding to a person who can reproduce it. The reviewer should confirm the tainted source, sensitive sink, security property and test that fails before accepting a fix. A confident model explanation without a reproducible path is not evidence.
When a finding is a false positive, preserve the justification and the exact rule version. When risk is accepted, record the business owner, expiration date and compensating control. Never let the coding assistant waive the control that evaluates its own output.
For high-risk code, ask a second human or an independent analysis path to review the fix. Independence matters more than adding another generative opinion.

Pilot with local metrics and explicit limits
Pilot the gate on a small set of repositories for two or three sprints. Track security-test coverage by weakness class, time to disposition, reopened findings, escaped defects found later and the share of changes requiring manual fixes. Compare AI-assisted and non-AI changes only when the code and risk mix are similar.
The cited report does not show that every AI-generated change has a 38% failure probability, nor that one model will behave the same in your stack. Four weakness classes are useful but incomplete. Business-logic authorization, unsafe defaults, concurrency and infrastructure misconfiguration need additional controls.
Store the final scorecard with the pull request. Over time, it becomes evidence for which generators, languages and code paths need tighter review in your environment.
Put the insight into practice.
Deep Security helps organizations assess risk, validate controls, and build a practical plan to strengthen their defenses.
Talk with Deep Security
