Contact Us
Contact Us
DevOps & Platforms

Preparing Your Platform for AI Coding Agents: CI/CD Guardrails, Pipelines and Review

Coding agents produce changes faster than most pipelines can check them. The identity, merge, testing and rollback controls to put in place first.

JRC Software Team
7 min read
Preparing Your Platform for AI Coding Agents: CI/CD Guardrails, Pipelines and Review

An agent opens a pull request that touches 38 files. The unit tests pass, the diff looks tidy, and a busy reviewer approves it in six minutes. What nobody spotted: the migration drops a column that a nightly reporting job still reads. You find out at 2am.

It's a made-up example, but every part of it is ordinary, and it's exactly what AI coding agents CI/CD controls exist to catch. Pull requests arrive faster and bigger, and reviewers skim diffs they didn't write. Meanwhile the pipeline runs the same unit tests it ran two years ago.

That's the gap we see most often: teams adopt AI coding faster than their platform can check the output. Getting it right is less about which agent you pick and more about the controls around it. What can it touch? What has to pass before merge? Who approves? And how quickly can you undo it?

More code, same pipeline

AI use in software teams is close to universal. Google's announcement of the 2025 DORA report says 90% of survey respondents use AI at work. It also found that AI adoption continues to have a negative relationship with software delivery stability, and that 30% of respondents report little or no trust in AI-generated code.

The 2024 research put numbers on it. According to the 2024 DORA report announcement, a 25% increase in AI adoption was associated with an estimated 7.2% reduction in delivery stability and a 1.5% decrease in delivery throughput, even as documentation quality, code quality and review speed improved. DORA is careful to call these associations, not proven causes, and points to basics like small batch sizes and solid testing as the missing link.

DORA's platform engineering guide explains the mechanism. AI is an amplifier: individual coding gains get lost in slow testing, security review and deployment. A good platform is what governs AI-generated code on its way to production. Without one, more code just means more risk.

Agents aren't autocomplete

An autocomplete suggestion goes through a human before it lands. An agent reads the repository, runs commands, edits many files and opens pull requests by itself. That changes the risk in three ways.

First, excessive agency. OWASP's LLM06:2025 Excessive Agency entry covers damage caused when a model has more functionality, permissions or autonomy than its task needs. It lists indirect prompt injection as a common trigger: an agent with broad cloud credentials can be steered by instructions hidden in an issue, a README in a dependency, or a web page it reads.

Second, volume. Bigger, more frequent pull requests swamp human review, and reviewers start approving on trust.

Third, plausible but wrong code. Changes compile and pass shallow tests, yet mishandle edge cases, security or data. GitHub's own Copilot documentation says Copilot can produce incorrect or suboptimal code, including code with security vulnerabilities, and tells you to review and test it before production.

An AI coding agents CI/CD guardrail checklist

These apply whichever agent you use, roughly cheapest first.

  1. Its own identity, least privilege. Each agent gets a dedicated identity that can write to feature branches only. No production credentials, and no permission to edit pipeline definitions.
  2. Protected main branch. Branch protection rules can require pull requests, a set number of approvals and passing status checks, and can dismiss stale approvals when new commits change the diff.
  3. Code owners on sensitive paths. Require code owner review for auth, payments, data access, infrastructure and .github/workflows.
  4. Someone else approves. GitHub can require the most recent push to be approved by someone other than the person who pushed it. The engineer who prompted the agent shouldn't be the only approver.
  5. No secrets until reviewed. Agent-authored changes shouldn't trigger pipelines with production secrets until a human has looked at them.
  6. Required checks that block. Build, unit and integration tests, lint, type checks, static analysis, dependency scanning and secret scanning, all as required status checks.
  7. Coverage on changed lines. Require tests for new code, not just a global coverage figure that hides untested additions.
  8. Size limits. Flag or split very large diffs. Small batches are easier to review and to roll back.
  9. Network and tool limits. Restrict what the agent can reach on the internet and which commands it can run.
  10. Audit trail. Label agent-authored commits and pull requests so you can trace them later.

GitHub's risks and mitigations page for its cloud agent shows several of these built in: the agent pushes only to its own copilot/ branch, can't approve or merge pull requests, the person who asked for the change can't approve it, workflows don't run until someone clicks "Approve and run workflows", and internet access goes through a firewall. Whatever tool you use, check for equivalent controls and enforce them in the platform, not in each developer's editor settings.

Designing an AI code review pipeline

Human review still matters, but it should spend its attention on what machines can't judge. We split review into layers.

LayerWhat it catchesWho or what does it
Automated gatesBuild and test failures, lint, known vulnerable dependencies, leaked secretsCI pipeline, required status checks
Automated review assistStyle issues, obvious bugs, missing tests, risky patternsStatic analysis and optional AI review tools, advisory only
Human reviewIntent, design, business rules, security and privacy impactAn engineer who knows the area, plus code owners
Post-merge verificationRegressions under real traffic, latency, error ratesProgressive delivery, monitoring and alerts

Treat AI review tools as a second opinion, never the approver. OWASP recommends implementing authorisation in downstream systems rather than relying on the model to decide whether an action is allowed. Merges work the same way: branch protection decides, not the agent.

Watch the tests, too. Agents happily write tests that confirm their own mistakes, or "fix" a failing test by changing the assertion. Our article on testing AI-generated code goes deeper on coverage, review rules and security checks.

Rollback: plan for the change that gets through

Some bad changes will reach production. Make them cheap to undo.

  • Ship small and often. Small releases limit the blast radius of any one change.
  • Put agent-built features behind flags so you can turn them off without a redeploy.
  • Release progressively with canary or blue/green deployments and automatic rollback on error rate or latency alerts.
  • Rehearse rollback. Reverting a release should be a routine, scripted action, not an emergency procedure someone looks up.
  • Watch the right numbers. DORA's software delivery metrics include change fail rate, deployment rework rate and failed deployment recovery time. Track them separately for agent-authored changes if you can.

Good observability is what makes this work. Our guide to observability and SRE for small teams covers alerts and service level objectives that catch regressions early.

How JRC Software prepares platforms for AI coding agents

We start with a readiness review of your repositories, pipelines and cloud access. In week one we look at who and what can push to main, which checks actually block a merge (versus which just post a comment), how secrets reach the pipeline, what the agent's token can do, and how long a rollback really takes. You get a short, prioritised list of gaps.

Then we implement the guardrails: agent identities with least privilege, branch protection and code owners, required test and security gates, pull request size checks, and progressive delivery with automatic rollback. If you already have golden paths, we bake the controls into the templates so every new service starts agent-ready, as described in our piece on golden paths.

We'll also tell you what not to do. Don't give an agent a personal access token copied from a senior engineer, don't let it modify workflow files, and don't count an AI reviewer's approval towards required reviews. Humans stay in charge of intent and design; automation handles the repetition. More on our platform engineering and DevOps services.

If your team already uses coding agents, or plans to, talk to us about platform readiness before the volume of changes outruns your ability to check them.

Frequently asked questions

Can AI coding agents be trusted to merge their own pull requests?

No, we don't recommend it. Agents can produce plausible code that's subtly wrong or insecure, and prompt injection can mislead them. Keep merge authority with branch protection rules and human reviewers. At least one approver should be someone other than the person who requested the change, and sensitive areas should need code owner approval.

What checks should run on AI-generated code in CI/CD?

At minimum: a full build, unit and integration tests, lint and type checks, static analysis, dependency vulnerability scanning and secret scanning. Add coverage requirements on changed lines so new code can't land untested. Make all of these required status checks that block the merge, not advisory reports reviewers can skip under time pressure.

Do AI coding agents make software delivery faster?

They speed up individual work, but the delivery evidence is mixed. DORA's 2024 research associated more AI adoption with lower delivery stability and slightly lower throughput, and its 2025 research still found a negative relationship with stability. The surrounding system decides the outcome: small batches, strong automated testing and a good internal platform turn faster coding into faster, safer delivery.

How should coding agents access secrets and cloud accounts?

As little as possible. Give each agent a dedicated identity with access only to the repositories and branches it needs, and no production credentials. Pipelines that need secrets should run only after a human reviews agent-authored changes. Restrict the agent's network access and tools, and log what it does so you can audit it.

DevOps & Platforms

Talk to us about platform readiness

Tell us where you're stuck and we'll come back with practical next steps.

Get in touch

Sources