Writing · Drafted in 2025
Build the preview-environment lane before you hand agents the keys
Coding agents make small changes cheap. A deploy lane with a preview per pull request is what makes those changes safe to review.
If you give a coding agent access to your GitHub repo, here is what you want to happen: an issue becomes a scoped plan, the plan becomes a small pull request, the PR gets a preview link, a review pass suggests edits, a person approves, and it merges and ships.
Without previews and a smooth PR-to-deploy path, you lose most of that. The agent can propose changes, but nothing can check them quickly or keep a bad one contained. Review turns into reading diffs and guessing.
Why previews come first
The teams that benefit most from agents are not the ones that generate the most code. They are the ones with a path for small, safe, frequent changes. DORA has long tied delivery speed and stability to practices like continuous integration and small batches.1 Agents send more, smaller PRs, so any friction in that path costs more.
Shared staging is the usual failure. When every change lands in one environment, changes collide, nobody knows who owns the current state, rollbacks are messy, and you batch changes to reduce the pain. With agents opening many PRs, that becomes the ceiling on your speed.
What the loop looks like for a static site
- Someone writes an issue describing the change.
- The agent creates a branch, makes a scoped edit, and opens a PR.
- CI runs lint, type checks, unit tests, and a production build.
- The host posts a preview URL on the PR (Vercel, Netlify, and Cloudflare Pages all do this).
- An AI reviewer comments on the PR, and the agent can push fixes.
- A person reviews on the preview and approves. Merge on green.
- Merging to main deploys to production and runs a smoke check.
For a static site you can set this up in an afternoon.
Keep a person in the loop
- Require one human approval before merge.
- Keep PRs small and single-purpose.
- Use preview links for acceptance testing, not shared staging.
- Run smoke and accessibility checks in CI.
- Have the agent respond to review comments in the PR thread.
When it’s harder: services and databases
Stateful systems are harder, but the goal is the same: one environment per PR. Common pieces are a namespace or stack per PR defined in Terraform or Pulumi, Helm or Kustomize overlays for the services that PR needs, short-lived databases with seeded or masked data, and automatic teardown when the PR closes. These take longer to build, and I would still do them first.
The short version
Agents make small changes cheap. Previews make those changes cheap to check. If you are about to give agents access to your codebase, build the deploy lane first.