Writing
Agentic Engineering Requires One More Shift Left
Security shifted left into CI a decade ago. The authoring moved into the agent harness, and the gates are following.
Ask an engineering org where its quality gates live. You get a confident answer: CI. The scanners wait on the pull request. That answer is a year late.
Pipelines aren’t the first line of defense
A decade ago we moved the gates left into the pipeline. Humans wrote the code, humans opened the PR, and CI was the first machine checkpoint. Right answer for that world. Flickr’s ten-plus deploys a day in 2009 made the pipeline the place work became real.
It is the wrong first answer now. The pipeline still runs. It just is not where the writing starts. The control plane moved with the author.
Waterfall’s gate was a gantt chart. DevOps made it a code pipeline. Agents make it the dev environment.
The first machine to touch your code is writing it
A growing share of new code now gets written by agents inside harnesses. Google reports more than 30 percent of its new code is AI-generated. Microsoft says 20 to 30 percent of code in its repos. One Complexity Science Hub classifier, trained on over 30 million commits, put US Python functions at 29 percent by the end of 2024. The figures measure code volume in adopter populations, and the methods are unpublished. Humans still write the large majority everywhere measured.
For a growing share of changes, the pull request is no longer where a machine first sees the file. The harness already wrote it. CI sees the artifact after that process has finished.
The finding is already in the file
Apiiro’s Fortune 50 analysis is observational vendor research. Privilege-escalation paths rose 322 percent in AI-assisted code. Shallow classes fell in the same data. That 322 percent is an undefined relative increase. The one windowed figure is a tenfold rise in monthly findings over six months. Commits ran three to four times higher, packed into fewer, larger PRs.
GitClear tracked 211 million changed lines from 2020 through 2024. Refactoring fell from 25 percent of changed lines to under 10. Copy-paste rose from 8.3 to 12.3 percent. GitClear’s CEO has said the research does not measure which code was AI-authored. Read it as a composition trend.
Three controlled studies put insecurity in the artifact as written. Perry’s team found assistant users wrote less secure code, and were more likely to believe it was secure. Shukla’s team saw critical vulnerabilities rise 37.6 percent after five in-loop iterations, before review exists. Veracode’s 2025 GenAI Code Security Report found 45 percent of generation tasks flawed in raw output.
NIST Planning Report 02-3 timed a bug found in coding at 2.4 hours to fix, and 13.1 after release. The study used waterfall stages. Nobody has measured the harness-versus-CI interval for these classes. That number has to come from your repo.
Use cheap gates where the agents write
Prompt-level rules are context. Anthropic’s own docs say so, and send you to hooks for anything that must happen. Cursor’s hooks can block. They also fail open. The cheap checks belong in the loop: lint, types, format, the tests the change touches, hooks that refuse an IAM wildcard or a cloned block.
CI keeps the audit job. Full suite, whole-system scans, the attestations Executive Order 14028 pushed into federal contracts. Formative checks run in the harness. CI confirms those checks held.
Do not import Fortune-50 percentages as your baseline. Instrument first: first-run CI failures, duplication, churn, escalation paths, attributed by writer. If your numbers look like the population tables, build the harness gates on that evidence.
Move the pipeline into the harness
Take this question to engineering: have you tried to shift the pipeline left into the agent environment? If the first machine that touches the code is writing it, the first machine that can stop a finding has to live there too. A green pull request is the wrong scoreboard.