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.
When an engineer wrote code by hand, they tested ideas as they typed. The loop between typing a line and noticing an error took seconds. If a security issue slipped into the draft, static analysis in CI caught it twenty minutes later. That delay was fine when an engineer opened one pull request a day.
With agents generating multi-file diffs in seconds, that delay breaks the authoring flow. The agent moves to the next prompt, discarding the context window that produced the code. By the time a central pipeline flags an unescaped query or an injection flaw, re-running the agent requires rebuilding the prompt context from scratch. The feedback arrives too late to guide the model.
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.
Building cheap gates means giving the agent local evaluation boundaries that run before files reach git. If a harness allows an agent to mutate code without immediate feedback, the model hallucinates through errors until its context window runs dry.
A modern harness wraps model execution in deterministic validation commands. When an agent edits a file, local pre-tool hooks run fast syntax checks and targeted test cases in under two seconds. If the edit introduces an unescaped query or breaks an API interface, the harness catches the defect instantly and injects the compiler error directly into the agent loop. The agent fixes its own mistake while the generation context is still fresh.
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
Shifting into the harness changes what platform teams build. For ten years, platform engineering focused on central cluster capacity and pipeline speed. They optimized worker nodes so a pull request could build in six minutes instead of twelve.
That work still matters, but it solves yesterday’s constraint. Today’s platform impact lives in the developer environment: packaging hermetic configuration files, distributing fast local linters, and wiring test execution into agent runtimes. Platform engineers become environment designers who define the guardrails agents operate within.
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.