Skip to content
syntaqx

Development, chapter 10 of 10

Autonomous Engineering

Changes that merge and ship with no person in the loop: the safety net first, risk tiers set by policy, agents that escalate, and people deciding what exists.

By 19 min readUpdated

A change can merge and ship with nobody reading it. That's been true since the first bot auto-merged a patch release, and it's safe for the same reason every time: something other than a person would catch it if it were wrong. Coding agents widen the kinds of change that can flow that way, from a version bump to a bug fix to a feature behind a flag. They don't change the principle. The question for any unattended change is never "did a human read it?" but "what would catch it, and how fast would it undo itself?"

"No human in the loop" is also never quite true. People move out of the merge and into four other places: they decide what the product should do, they write and own the policy that decides what may merge unattended, they answer the escalations, and they read the numbers that widen or narrow it. This page is about building those four places well.

It Starts Before Agents#

The first rung is pre-agent and most teams already stand on it. Dependabot opens a pull request for a patch release, a workflow checks that it's a patch and turns on auto-merge, and it lands when the required checks pass. Nobody reads the lockfile diff, and that's fine: Dependencies & Upgrades explains why a person skimming it catches almost nothing the tests don't. A canary that rolls itself back when its error rate diverges is the same idea on the other side of the merge.

At larger scale the pattern is older still: Google's tooling for large-scale changes splits one generated change into shards along ownership boundaries, tests each shard in CI, and sends most of them to a "global approver" rather than to every local owner, keeping owner review for the shards where it adds context (Software Engineering at Google, ch. 22).

Those work because three things hold at once: the kind of change is narrow and known, the net under it is good, and undoing it is cheap. Every rung above keeps all three. Agents make the first one wider; the other two have to grow with it.

TICKET CHANGE AGENT OR BOT PR POLICY PATHS, SIZE, DEPS, TESTS REQUIRED CHECKS TESTS, PREVIEW, MERGE QUEUE CANARY AUTOMATED VERDICT TIER 0 · UNATTENDED TIER 1 · SECOND MODEL TIER 2 · A PERSON AN AGENT CAN RAISE ITS OWN TIER, NEVER LOWER IT ROLLED BACK DIVERGES THE UNATTENDED PATH THE AUTOMATIC EXIT A change, from an agent or a bot, flows into a policy box that reads paths, size, dependencies and tests, and fans out to three tiers: tier 0 unattended, which is accented, tier 1 second model, and tier 2 a person. A ticket, drawn as a stored record, feeds the change from above. A note under the tiers says an agent can raise its own tier, never lower it. All three tiers join into required checks (tests, preview, merge queue) and then a canary with an automated verdict; a dashed exit labeled diverges drops from the canary to rolled back. The accented path runs change, policy, tier 0, required checks, canary.
Every tier shares the same net. The tier only decides who else looks before the checks run; what catches a bad change after merge is the same for all of them.

The Net Comes First#

Autonomy is capped by the weakest part of the net under it. Before anything merges unattended in an area, that area needs:

  • Required checks that mean something. Tests, types and lint as required status checks, plus checks for your own conventions. Coverage isn't the measure; whether the tests fail on a wrong change is, which is what mutation testing shows.
  • A preview environment per change with a smoke test run against it, so "it builds" becomes "it starts and serves the critical paths" (Environments).
  • A merge queue, so each change is tested against the main it will actually land on, not the main it branched from. Two green changes that break each other are the classic unattended failure.
  • Continuous deployment with an automated verdict. Small changes, one per deploy, behind a progressive rollout that rolls back on its own.
  • Flags and kill switches for anything a customer could see (Feature Flags).
  • Monitoring that pages without being watched, with SLOs and an error budget, so a slow regression gets noticed even when no single deploy tripped the canary.
  • Migrations that stay backward compatible (Zero-Downtime Migrations), so a rollback never needs a person to reverse the schema.
  • An audit trail of who or what wrote, reviewed and merged each change, and under which version of the policy.

An area with no end-to-end coverage doesn't get unattended UI changes, however good the agent is. Fix the net first; the autonomy follows.

Scoring a Change#

Risk isn't one number, and the dangerous mistake is averaging it. Five questions, answered from the diff:

Factor Low High
Blast radius One module, or code behind a flag that's off Every request, every tenant, money, auth
Reversibility A revert and a redeploy undo it completely Data deleted, an email sent, a column dropped, an API published, money moved
Detectability A test that failed first, a metric the canary watches Nothing would notice until a customer did
Novelty The same kind of change has merged here many times A new dependency, a new pattern, the first change in an area
Intent Behavior unchanged, or matches what an existing test already asserts Changes what the product is supposed to do

The highest factor sets the tier. A one-line change that's trivially detectable but irreversible is an irreversible change. This is the one-way door distinction, applied per pull request.

Policy scores the change, not the agent. The tier is computed by code from things the agent can't argue with: which paths changed, how many lines, whether a manifest gained a dependency, whether a test file's assertions changed, whether a migration exists. An agent's own read on its risk is a useful extra signal, and it only ever moves the change toward a person.

Tiers#

Tier Who looks before merge Typical changes
0: Unattended Nobody; required checks and the policy Patch and minor dependency updates past a minimum release age, lockfile maintenance, formatter and lint autofixes, regenerated code (API clients from a spec), codemods the library's authors published
1: Second model A different model, in a different session, grades correctness, tier and fit with the product; unsure goes to a person A reproduced bug fixed with a test that failed first, in a module the policy allows; a major upgrade's breaking changes fixed in a non-critical area; a refactor that leaves every test file untouched; internal tools and docs
2: A person A person reads the diff, like a teammate's Anything on a one-way-door path (billing, auth, permissions, data deletion, migrations, public APIs); any change to a test assertion; a new dependency; infrastructure and IAM; customer-visible behavior that isn't behind a flag that's off

Above all three sits intent: whether the thing should exist at all. That's decided by a person before anything merges, covered below.

Tiers are per area, not per repository. The same agent may merge tier 1 bug fixes in the reporting module and need a person for everything in billing. Each area starts with everything at tier 2 and moves categories down one at a time, from the track record AI-Assisted Development describes: change failure rate, reverts, escaped defects and how often a person caught something the reviewing model missed. When those numbers turn, the policy tightens on its own, without waiting for a meeting.

Tier 1's second model is there because two instances of the same model share the same blind spots, and a reviewer that shares the writer's context has already been talked into the change. It's the same reason nobody approves their own pull request.

What Never Drops a Tier

  • New dependencies. A model that invents package names hands an attacker a name to register; see Plausible but Wrong. A person vets every one.
  • Changes to the tests' assertions. The assertions are the spec. An agent that can edit the check its own work is judged by has no check. Adding tests is fine at any tier; changing what an existing test expects is tier 2, always. AI-Assisted Testing holds self-healing tests to the same rule.
  • The policy itself, the CODEOWNERS file, workflow files and branch rules. Whatever decides what may merge unattended can't be changed unattended.
  • Anything irreversible, whatever the diff size.

Customer-Visible Changes Ship Dark#

A change a customer will see is a product decision, but that doesn't mean a person has to sit in every merge. Split it the way continuous deployment already does: deploy is not release.

  1. A person approves the plan: the problem statement, what changes for the customer and how it will be measured. An agent may have attempted it already; the attempt waits for the plan before it merges.
  2. The agent builds it behind a flag that's off, and the code merges at whatever tier its paths allow. Dark code changes nothing anyone sees, so it carries an engineering risk, not a product one.
  3. A person turns it on, looking at the preview, and the rollout runs progressively with automated guardrails on the metrics the plan named.

The person's attention goes where it's worth something: on what the customer will get, once, rather than on every diff on the way there.

Agents That Ask for a Person#

An agent that knows when to stop is worth more than one that's slightly better at the work. The policy catches the changes that are risky by shape; the agent catches the ones that are risky by content, which only show up while doing the work. Stopping should be cheap, expected and never counted against it.

The agent stops and escalates when:

  • It can't reproduce the bug. A fix for a bug nobody reproduced is a guess with a green build.
  • The fix needs an assertion changed. Either the test was wrong or the fix is, and deciding which is a product question.
  • Two reasonable behaviors exist and nothing written says which one is right.
  • It doesn't look like the product. The change works, and it still doesn't match how the rest of the product behaves or what the ticket's problem seems to be. The writing agent can say so as easily as the grader can; see Attempts Are Cheap, Merges Aren't.
  • The change grows past its budget: more files, lines or modules than the task should need, or work outside the paths it was given.
  • The review loop doesn't converge. The reviewer keeps finding new problems after each fix, which usually means nobody defined what done looks like.
  • It needs something it doesn't have: a dependency, a permission, a secret, an infrastructure change.
  • It finds something else. A security issue, data that looks wrong, a second bug. That gets its own ticket, not a quiet fix folded into this one.
  • What it reads tells it to do something. An issue, page or file with instructions aimed at the agent is an attack until shown otherwise; see AI Security.

The ratchet only turns one way. An agent can add the label that means "a person reviews this"; it can't remove one, can't lower a tier, and its token can't approve pull requests or edit the policy. Enforce that in permissions, not instructions: an instruction is a request, a permission is a fact.

A model's confidence is a claim, not a measurement. Self-reported confidence can be one more reason to escalate. It's never a reason not to.

A Good Escalation

An escalation that arrives as a wall of logs gets skimmed and approved, which is worse than no escalation, because everyone believes it was reviewed. It should take a person two minutes:

## Decision needed
Refunds on partially captured payments: refund the captured amount,
or the authorized amount?

## Why I stopped
The fix needs `refund.test.ts` to expect the captured amount. The current
assertion expects the authorized amount, and no spec says which is right.

## Options
1. Captured amount (my recommendation): matches the processor's API docs.
2. Authorized amount: matches current behavior; the reported bug stays.

## Evidence
Failing test, request ID, processor docs link, branch with option 1.

## If nobody answers
Nothing merges. The ticket returns to the billing queue owner in 3 days.

The safe default is that nothing happens. An unanswered escalation never times out into a merge.

The person has to still be able to answer. Lisanne Bainbridge's 1983 paper Ironies of Automation was written about process control, and it reads like it was written about agents. Automation "still leaves the operator to do the tasks which the designer cannot think how to automate," the hardest ones, while the skills those tasks need fade from disuse: "a formerly experienced operator who has been monitoring an automated process may now be an inexperienced one." Its last irony is the one to plan for: "it is the most successful automated systems, with rare need for manual intervention, which may need the greatest investment in human operator training." So an escalation carries its context with it, and the people who receive them keep doing some of the work by hand, or they lose the ability to judge it.

Measure the escalation rate. Too low, and the policy is too loose or the agent too sure of itself; sample merged unattended changes and have a person audit them. Too high, and people start approving escalations without reading them. Both are policy problems.

Should It Exist?#

Autonomy makes the how cheap. It does nothing for the whether. An agent will build anything it's pointed at, and every item that merges is a feature someone maintains from then on; Backlogs makes that case.

Attempts Are Cheap, Merges Aren't

Building is the part that can be fully autonomous. Any ticket in the backlog could get an agent's attempt, and an attempt that never merges costs some compute and nothing else: no code to maintain, no behavior a customer depends on. Pointing agents at everything isn't usually the best use of anyone's money or review attention, but it isn't dangerous, as long as the attempt runs sandboxed with no write access to anything but its own branch. The decision that matters moved: from "should anyone work on this?" to "should this merge?"

That puts the weight on the grader. The reviewing model in tier 1 doesn't only check that the code is correct; it answers three questions:

  1. Is it right? The tests failed first and pass now, the diff does what the ticket asked and nothing else, the conventions hold.
  2. Is it in its tier? Nothing in the diff should have sent it to a person: no edited assertion, no new package, no path outside the policy.
  3. Is it what the product is meant to do? Checked against the problem statement, the existing behavior and tests, the docs and the design system.

The third question is where "I don't know" has to be a valid answer. A grader that says "this works, but it doesn't feel like it matches the intended product" has done its job, and that verdict sends the change to a person, never to a merge. The failure to design against is the grader that's never unsure, because then every confident, well-tested change to what the product does ships on its own. So the grader has three outcomes, not two: pass, fail back to the agent with the reasons, and unsure, which goes to a person with the question written down. Track how often it says unsure; a grader that hasn't in a month isn't grading intent.

An attempt that doesn't merge is closed with its reason and costs nothing more. A ticket whose attempts keep failing the third question is a ticket nobody has decided yet, which is a product conversation, not a job for another agent run.

The Line That Stays Human

  • Intent. What the product should do is decided by a person: a problem statement before a feature, triage before a bug fix, the person who answers when the grader says unsure.
  • Each queue has an allowlist of ticket types an agent may attempt on its own and an owner responsible for what comes out of it, and every run has a ticket, so what was asked, what merged and whether it stuck sit on the same ledger as everyone else's work.
  • Priority stays a business decision. Agents can help triage (find duplicates, reproduce, propose a severity), but the order of the work is the product owner's call, the same as in Defects & Triage.

Bug or Product Problem?

A bug report is a claim that the product doesn't do what it should. Sometimes it does exactly what it was built to do, and that's the problem. An agent will happily "fix" that by changing the behavior, and the build will be green, because nothing tests what the product should have been. Defects & Triage lists the signs. For an agent the rule is mechanical: if the fix would change what an existing test asserts, or there's nothing to assert against, it's a product question. The agent writes up what it found and routes it to the product owner instead of fixing it.

Implementing It on GitHub#

The same structure works on any forge; the names here are GitHub's.

The policy lives in the repository, owned in CODEOWNERS by a small group and protected from unattended change. Its format is yours; what matters is that it's code, versioned and readable by the workflows that enforce it:

# .github/autonomy.yml: what may merge without a person, per area
default: person
areas:
  - paths: ["package.json", "package-lock.json"]
    change: dependency-update
    max_update: minor
    tier: unattended
  - paths: ["src/reports/**"]
    change: bug-fix
    requires: [failing-test-first, no-assertion-changes]
    max_lines: 200
    tier: second-model
  - paths: ["src/billing/**", "src/auth/**", "migrations/**", ".github/**"]
    tier: person
kill_switch: vars.AUTONOMY_ENABLED

Branch rules do the enforcing. A ruleset on main requires the status checks and a merge queue, which GitHub says "will ensure the pull request's changes pass all required status checks when applied to the latest version of the target branch and any pull requests already in the queue." Keep the bypass list empty; an actor that can bypass the rules is an actor the policy doesn't cover. Two more pieces carry the tiers:

  • Tier 2 is CODEOWNERS. Require code owner review rather than a blanket approval count, and list the tier 2 paths (billing, auth, migrations, .github/, the policy file) with their owning teams. GitHub applies code owner review to "any pull request that modifies content with a code owner," so a change that touches those paths waits for a person, and the policy check catches the tier 2 changes that paths can't see, like an edited assertion or a new package. Test the setup on a throwaway pull request before trusting it. See Code Ownership.
  • Tier 1 is a required check, not an approval. The reviewing model runs as a job that passes or fails, so its verdict sits beside the tests instead of pretending to be a person's approval. Whether a bot's approval counts toward required reviews is a setting that has changed over the years; a check doesn't depend on it.

Dependabot is the first workflow, and GitHub documents it for you. This is the auto-merge example from Automating Dependabot with GitHub Actions, as published, saved as .github/workflows/dependabot-automerge.yml:

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Dependabot auto-merge
on: pull_request

permissions:
  contents: write
  pull-requests: write

jobs:
  dependabot:
    runs-on: ubuntu-latest
    if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'owner/my_repo'
    steps:
      - name: Dependabot metadata
        id: metadata
        uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7
        with:
          github-token: "${{ secrets.GITHUB_TOKEN }}"
      - name: Enable auto-merge for Dependabot PRs
        if: contains(steps.metadata.outputs.dependency-names, 'my-dependency') && steps.metadata.outputs.update-type == 'version-update:semver-patch'
        run: gh pr merge --auto --merge "$PR_URL"
        env:
          PR_URL: ${{github.event.pull_request.html_url}}
          GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

The job's if keeps it to Dependabot's pull requests in your repository, not a fork. The step's if is the policy, and GitHub's version is deliberately narrow: patch updates to one named dependency. Widening it is the tier decision, made per area:

  • Drop the dependency-names condition once the suite has earned trust across the board, or keep a list of the dependencies that have.
  • Allow minor updates with steps.metadata.outputs.update-type != 'version-update:semver-major', so majors always wait for a person.
  • Add the kill switch to the step's if: && vars.AUTONOMY_ENABLED == 'true'.
  • Match your merge method: --squash instead of --merge if that's what the repository uses.
  • Pin the action your way: GitHub's example pins a commit; a major tag with a workflow lockfile works too, per Dependencies & Upgrades.

The same page has an auto-approve example that runs gh pr review --approve. With the ruleset above it isn't needed: nothing requires an approval on these paths, and new organizations don't let workflows approve pull requests by default anyway. Approval was never the safety; the checks were.

GitHub's note under the example is the important part: enable required status checks for the branch, which "ensures that pull requests are not merged unless all the required status checks pass." Auto-merge "merges a pull request automatically after all required reviews and status checks pass," so the workflow only states intent; the ruleset decides. Two details bite. Workflows triggered by Dependabot get a read-only token and only Dependabot's own secrets by default (GitHub Docs), which is why the example asks for contents: write; resist reaching for pull_request_target to get more, since it runs with your secrets next to code from the pull request (CI Pipelines). And with a merge queue, GitHub notes the built-in GITHUB_TOKEN "cannot add pull requests to the queue," so the step needs a GitHub App token instead. Renovate does the same job with automerge in its config and won't merge "until it sees passing status checks."

A minimum release age keeps the newest release out until other people have run it. Malicious versions of chalk and debug were live for roughly two hours on September 8, 2025 by Wiz's count, and two weeks later CISA reported a self-replicating worm that had compromised over 500 packages. An unattended merge on release day is exactly the install those attacks wait for. Dependabot's cooldown option sets the wait per semver level, and GitHub's docs say it applies a default of 3 days to version updates even unconfigured, though never to security updates (configuration options). Renovate's minimumReleaseAge opens the pull request right away and holds the auto-merge until the age has passed, with 3 days recommended for npm.

Agents get their own identity. A GitHub App with a scoped token, never a person's credentials: it can push branches and open pull requests, and it can't approve them, bypass the queue, or write to .github/. GitHub's own coding agent ships with that stance by default: the person who asked for its pull request can't be the approver, and workflows don't run on its pushes until someone approves them (GitHub Docs). Loosen defaults like those deliberately, per area, as the policy allows.

Agentic workflows are where the attempts run. GitHub Agentic Workflows, an open source project from GitHub Next and generally available since October 2026, write agent automation as Markdown with YAML frontmatter in .github/workflows/; gh aw compile turns each one into an ordinary Actions workflow (a .lock.yml) that runs an engine of your choice: GitHub Copilot by default, Claude Code, OpenAI Codex, Google Gemini or Pi (how they work). Its security model is this page's in miniature. Workflows "run with read-only permissions by default." The agent never writes to the repository itself: it requests safe outputs, such as an issue, a comment or a pull request, and separate jobs with their own permissions carry them out, "without giving the agentic portion of the workflow any write permissions." And GitHub's launch post was blunt about merging: "pull requests are never merged automatically, and humans must always review and approve." The docs have since added an experimental merge-pull-request output behind configured gates, and even it states that "merges to the repository default branch are always refused" (pull request safe outputs). That split is the right one: an agentic workflow is a good place for the attempt and for the grader, and the decision to merge stays with the ruleset and the policy above.

A kill switch stops every unattended merge at once: one repository variable, AUTONOMY_ENABLED in the examples above, that every workflow able to merge checks first. Automation's failures are fast and wide; Google's SRE book, which calls consistency "in many ways the primary value of automation," also warns that "a platform also centralizes mistakes," and tells of a decommissioning tool that wiped the disks on every machine in a CDN within minutes (Site Reliability Engineering, ch. 7). Trip the switch automatically when the change failure rate or the rollback count crosses a threshold, and by hand whenever something looks wrong. Turning autonomy off should be cheaper than debating whether to.

Every commit says who did what: a co-author trailer for the agent and model that wrote it, the reviewing model, and the policy tier it merged under. That's the evidence for the next section and the data for widening the policy.

Compliance: the Workflow Is a Review#

SOC 2 and PCI DSS both expect changes to be authorized, tested and approved before they reach production. Neither was written with agents in mind, and neither, read closely, says a person must read every diff.

  • SOC 2's change criterion, CC8.1, asks that the entity "authorizes, designs, develops or acquires, configures, documents, tests, approves, and implements changes." It says changes are approved; it doesn't say by whom or how. The wording here comes from a reproduction; the AICPA's own document sits behind a sign-up.
  • PCI DSS v4.0.1 requirement 6.2.3 requires custom code to be reviewed before release, and its applicability note says "code reviews may be performed using either manual or automated processes, or a combination of both." The stricter rule, 6.2.3.1, applies "if manual code reviews are performed": then the reviewer can't be the author, and management approves before release. Separately, 6.5.1 requires "documented change approval by authorized parties" for changes in production.

An automated policy can be that control. People wrote it, a different person approved it, it changes only through a reviewed pull request, and every change that merges under it carries evidence: the pull request, the checks that ran, the policy version, the rollout. That's a stronger record than an approval click on a diff nobody read.

Whether it satisfies a specific audit is the auditor's or assessor's call, not yours:

  • Describe it as it runs. The system description says which changes merge under a policy and which need a person, with the policy file as evidence. A control written as "every change is approved by a person" while bots merge updates is an exception you manufactured.
  • Walk the auditor through it before the period starts, not during fieldwork.
  • Keep a person on anything in scope if the auditor wants one. The cardholder data environment can stay at tier 2 while the marketing site runs at tier 0.

Who Owns It#

The team that owns the code owns every change that merges into it, however it got there. Who or what typed the diff doesn't matter. What matters is who let it through, and for an unattended change that's the owning team: they chose the tier, wrote the tests the change had to pass, set the canary's thresholds and decided which paths need a person. Those are the levers for predicting a failure before it ships, and they're the team's.

"The agent did it" is no better an answer than "the intern did it." Nobody blames an intern for a bad change that shipped; they ask why the team let an intern's change through without the review it needed. Letting an agent's change merge unattended was the team's decision in exactly the same way, made once, in the policy, instead of once per pull request.

So when one goes wrong, the postmortem asks the escaped-defect question it would ask about anyone's change: which layer should have caught it? The answer is a team lever every time: a test, a check, a threshold or a tighter tier. Blaming the model fixes nothing, and swapping in a better one fixes this mistake without closing the gap that let it through.

References#

Specifications

Reference

In practice