AI-generated code security depends on the controls around the code. Published studies find weaknesses in AI-written code often enough that nothing should merge unscanned and they also show that most files come out clean. An AI SDLC catches the repeatable weaknesses with tests, review and scans that run on every change and it leaves a short list of cases to a named person. This post scores both sides: what the studies measured, which control targets each weakness and what still needs a person. The wider method is covered in What is an agentic SDLC?
01What three studies measured about AI-generated code
Three published studies, each measuring a different weakness, give a clear picture of where the problems sit.
A large-scale analysis of public GitHub repositories ran a code scanner over more than 7,000 files attributed to four AI coding tools. About 12.1% of the files had at least one finding mapped to a known weakness category, which means about 88% had none. The findings with the highest severity scores were SQL injection, OS command injection, code injection and hard-coded credentials. The authors list their own limits: the files were found through attribution comments, the scan is static and cannot see runtime or logic flaws and the results show associations and prove no cause.
A controlled experiment on iterative generation started from ten secure code samples and had a language model revise each one ten times under four kinds of prompt, with no person looking between revisions. The abstract reports a 37.6% rise in critical vulnerabilities after five rounds. Feature-focused prompts produced the most vulnerabilities and security-focused prompts the fewest, as Figure 1 shows. The authors recommend a developer review between revisions and no more than three consecutive AI-only revisions.
A third study, summarised in a 2026 Cloud Security Alliance research note, generated 2.23 million code samples from 16 models and found that 19.7% referenced at least one package that does not exist. Attackers can register those invented names and wait for an agent to install them. The note describes one such name spreading through 237 repositories by way of AI-generated agent skills, with downloads coming from autonomous agents running their own output.
02The scorecard: six weaknesses, the control for each and what stays with a person
Each row pairs a weakness with the control an AI SDLC runs against it and the case that remains with a named person. No control closes a row for good. Each one narrows the odds. The last section says which of these controls Orlian runs today.
03What a missing access rule exposed at Moltbook
On 31 January 2026 the security firm Wiz reported a misconfigured database behind Moltbook, a social network for AI agents whose founder had said publicly that he wrote no code for it. Wiz's report says the site's JavaScript carried the database connection details in plain view. That is safe when the database enforces row-level access rules and here those rules were missing, so anyone holding the public key could read and write the data. The exposure included 1.5 million API authentication tokens and 4,060 private conversations between agents, some holding plaintext third-party credentials. Wiz also edited an existing post as a test, which showed that write access was open too. This is the third row of the scorecard.
From first contact to final fix took about three hours and it took four rounds of fixes because each round exposed more, as Figure 2 shows. Wiz drew conclusions that map onto the scorecard. AI tools that generate such backends should enable the protection by default, deployment platforms should scan for exposed credentials and unsafe configurations and a person should review the configuration before launch.
04How the controls stack in the pipeline
The controls in the scorecard sit at different points between a requirement and a release and each one looks at something different. A weakness that gets past one layer meets the next and the last layer is a person reading the evidence. Figure 3 shows the order.
Two of these layers matter most for an agent that revises its own work. The independent review and the scan on every change stop one AI-only revision from building on the last, which is the drift the iterative study measured. The signed release keeps a person at the end of the chain, a point developed in Autonomous software development with human gates.
05What no control catches yet
The scorecard leaves cases open and a post on AI-generated code security should name them. A scan finds the patterns it knows. It cannot tell that a requirement is wrong and the GitHub analysis lists runtime and logic flaws among the things its static scan could not see. A DAST run reaches only the routes and accounts it is given, so a flaw behind a path that nobody configured stays hidden. A new kind of attack, such as an invented package that an attacker registers first, can appear before any scan has a rule for it. The last control is a person signing at a gate and that signature is only as good as the evidence in front of the person and the time to read it.
A finding that a person accepts stays on the board as a ticket with a name beside the decision, so an accepted risk is a recorded choice. The figures in the studies above also come from specific models and tools at specific dates, which makes them a starting point for measuring a team's own findings over time.
06Where Orlian fits
In Orlian an independent Review agent and a SAST agent check every change inside the test-first AI coding agents wing before it merges and a person reviews the work at a human gate after a short run of AI-only revisions, in line with the iterative study's advice. A DAST agent is designed to attack staging in the AI test automation wing with more than one role, such as a normal user and an admin. The fully automated staging run is still being built as of date. Tests are written from the requirements before the code, production and staging secrets stay in a vault outside the code, agents install packages only from approved registries and named people sign the requirements, the changes to shared code and the release, each with the evidence attached. Findings become tickets on the same board as every other defect. None of this makes the scorecard disappear. It moves the repeatable weaknesses to the front of the pipeline, where they cost least to fix and puts a person where judgment is needed.
At Moltbook a missing access rule reached production with nobody asking who may read and write what. In an AI SDLC that question is a requirement, then a test and then a staging scan before it is a release and the answer has a name beside it.

