CI when AI agents write the code: what changes and how to set it up
Coding agents open more pull requests, run CI far more often and read every failure. What that does to runners and secrets, and to spend, the GitHub guidance that applies, and a setup that keeps agent-written changes fast to check and safe to run.
How do AI coding agents change CI?#
When AI agents write the code, CI changes in three ways. It runs more often, because agents push, read the failure and push again. It runs untrusted changes, because the author is a model that anything it read could have steered. And it gains a new reader: the agent itself, which waits on every result. The setup that holds up gives agent-written runs their own disposable runners, hands them the narrowest token and no deploy secrets, keeps feedback fast with warm environments, and caps both the number of jobs and what they may cost. Merging stays behind a human or a policy.
Agents now write a large share of the changes#
This is no longer a fringe case. Stack Overflow's 2026 Developer Survey, published on 6 October 2026, found that 66% of developers who use AI work with coding agents, and that 73% of those using AI coding assistants or agents use them every day. The two most used agents were Claude Code, at 66%, and GitHub Copilot, at 59%. Copilot, GitHub's own agent, runs inside GitHub Actions: "Copilot has access to its own ephemeral development environment, powered by GitHub Actions."
The arithmetic follows. A person might push a branch a few times a day. An agent working through a task pushes after each attempt, and a team running several agents at once multiplies that again. CI that was sized for people starts queueing, and a queue is now a cost the agent pays on every step.
What changes in CI#
Volume and bursts#
Agent work arrives in bursts. Ten agents started on a backlog in the morning will all hit CI within minutes of each other, then go quiet. Fixed fleets of runners handle that badly: sized for the burst, they sit idle most of the day; sized for the average, the burst waits in line. Runners that are created per job and billed for the seconds they run match the shape better, as long as there is a limit on how many can start.
Trust#
A pull request from an agent should be treated like one from a stranger, even when the agent works for you. Its content came from a model, and the model read issue text, web pages and dependency code on the way. GitHub's security guidance is blunt about what follows from running such code with privileges. Workflows triggered by pull_request_target that check out untrusted code "can be exploited to take over a repository." Untrusted input pasted into a shell command is a script injection waiting to happen. And "self-hosted runners should almost never be used for public repositories on GitHub", because a runner that one job compromised stays compromised for the next.
Secrets#
The same guidance contains a line every team running agents should reread: "Any user with write access to your repository has read access to all secrets configured in your repository." Give an agent write access, and you have given it the repository's secrets. That is fine for a test database password. It is a problem for production keys.
The agent as the reader#
People skim CI output and open the one failing log. Agents read all of it, every time, and act on what they find. Output that is clear for a person is not always clear for a model, and a flaky test costs an agent more than it costs a person, because the agent will try to fix it. Fast, deterministic checks with readable failures become worth real engineering time.
A setup that holds up#
Give agent runs their own runners#
Run agent-authored jobs on ephemeral runners that exist for one job and are deleted after it. The recommendation GitHub gives for its own agent is the same: "only use Copilot cloud agent with ephemeral, single-use runners that are not reused for multiple jobs." A runner that never outlives its job cannot carry one job's damage into the next.
Hand out the least privilege#
Set the GITHUB_TOKEN permissions per workflow to the minimum, as GitHub advises. Keep deploy credentials in protected environments that require a person's approval, so an agent's branch can run the tests but never reach production keys. Never combine pull_request_target with a checkout of the pull request's code.
Keep feedback fast#
The agent waits on every run. Warm dependency caches and prepared build environments shorten each run from minutes to seconds for the same check, and that saving repeats on every attempt in every task. Splitting a slow suite so the agent gets the relevant tests first helps more than a faster machine for the whole suite.
Cap jobs and spend#
Put a limit on concurrent agent jobs, so a burst cannot starve the people on the team. Then cap what each job may cost. A loop that keeps failing and retrying overnight is the classic way an agent runs up a bill, and a cap per job stops it at the job.
Bill by the second#
Short jobs are where billing rounding hurts. A platform that rounds every job up to the whole minute charges a fifteen-second lint as a minute, and agents run a lot of short jobs. The billing rules on GitHub are worth knowing too: "GitHub Actions usage is free for self-hosted runners and for public repositories that use standard GitHub-hosted runners", so jobs on runners you bring are billed by whoever provides them. Our CI runner comparison covers the billing units of the main options.
Keep merging behind a gate#
Agents can open pull requests freely. Merging should need a person's review, or a policy that requires specific checks to pass and specific files to stay untouched. The agent's own tests are evidence, not a verdict, since the agent can edit them.
Where Promigence fits#
Promigence runners give each GitHub Actions or GitLab CI job its own fresh sandbox, which fits the first rule above without a fleet to manage. The change in the workflow is one line, runs-on: promigence, and the size is picked in the label. Every job is billed for the seconds it runs, and with the runner command --cap sets the most one job may cost, while --max limits how many sandboxes run at once. The runner guide sets it up in two lines.
FAQ#
How do AI coding agents change CI?#
They push more often, in bursts, and every push is an untrusted change from a model. They also wait on every CI result, so slow or flaky checks cost them more than they cost people.
Should AI agents get repository secrets?#
Not deploy secrets. GitHub's guidance notes that anyone with write access to a repository can read all of its secrets, so an agent with write access can too. Keep production keys in protected environments that need a person's approval.
Is it safe to run agent pull requests on self-hosted runners?#
Only on ephemeral runners that are created for one job and deleted after it. GitHub recommends single-use runners for its own coding agent and warns against self-hosted runners on public repositories.
How do I stop AI agents from running up CI costs?#
Limit how many agent jobs run at once, cap what each job may cost, and prefer billing by the second, since agents run many short jobs that per-minute rounding inflates.
Sources#
| Source | What it supports | Read |
|---|---|---|
| Stack Overflow: the 2026 Developer Survey results (6 Oct 2026) | agent use, daily use, the top agents | 25 Oct 2026 |
| GitHub Docs: customize the Copilot cloud agent environment | the Actions-powered environment; single-use runners | 25 Oct 2026 |
| GitHub Docs: secure use reference | token permissions, secrets and write access, pull_request_target, script injection, self-hosted runners | 25 Oct 2026 |
| GitHub Docs: billing for GitHub Actions | usage free on self-hosted runners | 25 Oct 2026 |
| Promigence runner guide | the one-line change, per-second billing, --cap and --max | 25 Oct 2026 |