Dev Tool Experiences
All articles

· 8 min read

How to Roll Out an AI Coding Agent Without Turning It Into Shadow Infrastructure

By Q. Davis

  • tools

Roll out an AI coding agent in rings, not with an all-engineering announcement and 2,000 assigned seats. Give a small group a real task boundary, preserve every existing CI and review gate, and expand only when you can show where the tool saves time—and where it creates review work instead.

The mistake is treating an agent rollout as a procurement event. It’s an operating-model change: it alters who can create code, how much code reaches review, what gets pasted into terminals, and which repositories quietly become training grounds for a new workflow. Your first useful artifact isn’t a policy PDF. It’s a pilot scorecard and a kill switch.

Pick a pilot that can fail safely

Choose 30 to 75 developers across three kinds of work: a service team with solid tests, a developer-platform team that owns internal tooling, and a maintenance-heavy team with a backlog of bounded bugs. Do not make security engineering, production infrastructure, or the team carrying a deadline your proving ground. They will either ban the tool after one bad run or bypass the controls to make the deadline.

Give the pilot a six-week window. That is long enough for people to get past autocomplete novelty and short enough that a weak result does not become a permanent license line. Ask each team to nominate one repo where the agent may open pull requests, one where it may only work locally, and one explicitly excluded repo. The exclusions are as important as the permissions: credentials tooling, incident automation, payment paths, and repositories with fragile or expensive integration environments usually deserve a slower start.

Define the work in terms an engineer can accept or reject: upgrade a library within one service, add regression tests for a known bug, split a module along an already-approved design, or repair failing CI after a dependency update. “Make our platform better” gives you a pile of plausible diffs and no way to assess whether any of them helped.

Put the controls in place before you enable agent write access

An agent should not get a merge exception because it has a bot name. Require pull requests, required checks, code-owner review where it already applies, and secret and code scanning just as you do for human-authored changes. GitHub rulesets can require pull requests, status checks, deployments, reviews, and resolved security findings before merging; use evaluate mode first if you are changing rules across a large set of repositories.

Keep the agent’s initial permission boundary narrow: it can create a branch, edit a working tree, run an approved test command, and open a pull request. It cannot merge, alter repository rules, rotate credentials, change CI secrets, or deploy. If a vendor’s agent needs a broad token to perform ordinary work, treat that as a product limitation to solve—not a security review detail to waive.

Content exclusion is useful, but it is not a universal data-loss-prevention control. For example, GitHub documents exclusions by path, while also documenting that IDE agent mode does not support those exclusions and that semantic information can sometimes still arrive indirectly through an IDE. Test exclusions against the exact editor, CLI, and agent mode you intend to approve. A control that works in chat but not in the mode that edits files is not the control you think you bought.

Make repositories teach the agent the boring parts

Most agent failures in mature codebases are not model failures. They are missing local instructions: the agent runs the wrong test suite, uses a deprecated package, changes generated code, or expands a two-file bug fix into a refactor. Put the answer in the repository where humans can review it.

Start with a short instruction file, then add detail only after a repeated failure. GitHub Copilot supports repository-wide instructions in .github/copilot-instructions.md and agent instructions in AGENTS.md; other tools increasingly recognize one or both conventions. Keep the file operational, not aspirational.

# AGENTS.md

- Use `pnpm test --filter @acme/billing` before opening a PR.
- Do not edit `packages/api-client/generated/**`.
- Changes under `infra/terraform/**` require an issue link in the PR body.
- Prefer an existing service client over direct HTTP calls.
- Keep behavior changes and formatting-only changes in separate commits.

This is also where platform teams can help without becoming the prompt police. Publish a starter instruction file, a standard test command, and examples for the top five repository archetypes. Let each owning team edit the local version. Central instructions work for security constraints; repository instructions work for how this particular monorepo is held together with string and optimism.

Measure flow, review cost, and incidents—not acceptance rate

A high suggestion-acceptance number can mean the tool is good at boilerplate. It can also mean people stopped reading completions. It tells you little about whether changes shipped faster or review got worse. Use the agent’s telemetry only as adoption context, then pair it with delivery data you already trust.

  • Adoption: weekly active users and the share of pilot users who return after week two.
  • Flow: median time from first commit to merged pull request for comparable maintenance tasks.
  • Review cost: changed lines per pull request, number of review rounds, and reverted or follow-up pull requests within 14 days.
  • Quality: CI failure rate, escaped defects tagged to the changed component, secret-scanning findings, and policy exceptions requested.
  • Spend: assigned seats, actual active users, model or agent-run usage where applicable, and CI minutes consumed by agent-created branches.

Put the data on a weekly review with engineering productivity, security, finance, and two pilot-team representatives. Do not use it to rank individual developers. GitHub’s current usage-metrics API, for example, can provide daily and rolling 28-day enterprise reports, but those reports are a rollout dashboard—not evidence that an individual engineer is or is not productive. Its older Copilot Metrics endpoints were closed on April 2, 2026, so automate against the usage-metrics endpoints rather than copying an old dashboard integration.

Fetch the report on a schedule, store only the aggregate you need, and join it to repository-level delivery metrics rather than prompt text. A real request looks like this:

curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2026-03-10" \
  "https://api.github.com/enterprises/$ENTERPRISE/copilot/metrics/reports/enterprise-28-day/latest"

Expand by capability, not just by headcount

Your rollout rings should be capability tiers. Ring one gets in-editor help and local edits. Ring two gets agent-created branches and pull requests in low-risk repositories. Ring three can run approved commands in isolated development environments. Production actions, credentialed automation, and autonomous merge remain separate decisions with separate evidence. A team can be ready for one tier and absolutely not ready for the next.

At each expansion, write down the stop conditions: a secret exposure, an unauthorized destructive command, a material rise in reverted pull requests, or a cost limit breach pauses the ring. Also name who can revoke access within minutes. Enterprise policies should be owned by a small group, audited regularly, and treated like any other production control. GitHub’s audit log records plan, policy, license, and web-agent activity changes, but not local client prompt sessions; know that observability boundary before promising legal or security that you have a complete record.

The agent will be bad at some of your work. It will overconfidently navigate undocumented architecture, make broad edits when a local fix was wanted, and generate a PR that looks finished before anyone has understood its assumptions. That is not a reason to abandon it. It is a reason to keep the human approval queue, make its work observable, and reserve autonomy for workflows whose failure mode you have already rehearsed.

Sources & citations

  1. [1]GitHub Docs: GitHub Copilot policies for enterprises and organizations
  2. [2]GitHub Docs: Content exclusion for GitHub Copilot
  3. [3]GitHub Docs: Excluding content from GitHub Copilot
  4. [4]GitHub Docs: Available rules for rulesets
  5. [5]GitHub Docs: Troubleshooting rules
  6. [6]GitHub Docs: Adding repository custom instructions for GitHub Copilot in your IDE
  7. [7]GitHub Docs: REST API endpoints for Copilot usage metrics
  8. [8]GitHub Docs: Reviewing audit logs for GitHub Copilot