AI Coding Agents Need Their Own Safe Place to Break Things
One of the most useful things we give software developers is permission to fail safely.
Create a branch.
Change something.
Run it.
Break it.
Fix it.
Try again.
Production doesn't care until we're ready.
AI coding agents need exactly the same thing.
Actually, they probably need it even more.
Cloudflare recently introduced Worker Previews, which create an isolated, production-like environment for every Git branch.
On the surface, that sounds like a developer-experience improvement.
I think it represents something larger.
The infrastructure around software development is beginning to evolve specifically for autonomous coding agents.
A Code Sandbox Isn't Enough
Most coding agents already have some form of filesystem or command sandbox.
That's useful.
But modern applications are more than source code.
They depend on configuration.
Secrets.
Databases.
Persistent state.
Authentication callbacks.
APIs.
Queues.
Caches.
Runtime behavior.
Observability.
A coding agent can write code that looks perfect inside a repository and still fail spectacularly once it encounters the real application environment.
That's why production-like previews matter.
They allow the agent to interact with a running system rather than merely reason about files.
Branches Should Isolate More Than Code
Git gave us a great isolation model for source code.
Create a branch and you can make changes without changing main.
But application infrastructure hasn't always followed the same model.
A branch might still point to the shared staging database.
It might use shared Durable Objects.
It may share credentials.
It could call production dependencies.
Suddenly the branch is isolated in Git but not isolated operationally.
Cloudflare's approach is interesting because each Worker Preview can have its own configuration, URL, observability and state.
A bad schema migration can stay inside the branch.
A broken session doesn't affect another developer.
An agent can test something destructive without modifying production resources.
That's a much stronger boundary.
Agents Need Feedback Loops
The biggest opportunity in agentic development isn't code generation.
It's iteration.
Imagine telling an agent:
"Implement this feature."
The useful workflow isn't:
Generate code → Done.
It's closer to:
Generate code.
Deploy preview.
Exercise the application.
Inspect the result.
Review logs.
Find the failure.
Modify the code.
Redeploy.
Verify the fix.
Only then ask for human review.
That feedback loop starts to resemble the way an experienced developer actually works.
And it requires infrastructure.
Observability Becomes Part of the Agent's Senses
We usually think of observability as something humans use after deployment.
Metrics tell us something slowed down.
Logs tell us what failed.
Traces tell us how a request moved through a distributed system.
For an autonomous development agent, observability becomes something else.
It becomes sensory input.
If the agent can deploy a preview and then inspect traces, logs and runtime errors, it can evaluate whether its implementation actually works.
That means observability systems will increasingly serve two audiences:
Humans operating software.
And agents modifying software.
That has interesting implications for telemetry design.
Structured logs matter more.
Clear error messages matter more.
Trace relationships matter more.
Consistent environment metadata matters more.
The better a system explains itself, the easier it becomes for both developers and agents to diagnose.
Stateful Applications Are Where This Gets Hard
Stateless preview environments are relatively easy.
Deploy another copy of the application and give it a temporary URL.
State changes everything.
What happens if the preview writes to the same database as production?
What if it changes a session object?
What if a migration modifies a shared schema?
What if two agent sessions operate on the same test state?
True preview isolation requires separating the application's state as well as its code.
That's one of the more interesting aspects of Cloudflare's implementation: Durable Objects and Containers can be isolated per Preview.
The larger architectural principle applies regardless of cloud provider:
Test environments aren't truly isolated if their state isn't isolated.
Human Review Gets Better Too
This isn't only about AI.
A production-like URL for every proposed change also makes human review more useful.
A reviewer can open the application.
Exercise the feature.
Observe its behavior.
Inspect traces.
Compare implementations.
That is better than reviewing a pull request purely as text.
AI may be accelerating the need for these environments, but humans benefit from them too.
That's common with good infrastructure.
Tools built to make automation safer usually make engineering safer in general.
Autonomous Development Needs Boundaries
There's an understandable temptation to measure coding agents by autonomy.
How long can the agent work without human intervention?
How many issues can it resolve?
Can it build an entire application?
Those are interesting metrics.
But autonomy without containment is risky.
I'd rather have an agent that can work autonomously for two hours inside a carefully isolated environment than one capable of working for two days with unrestricted access to production resources.
Safe autonomy requires boundaries.
Filesystem boundaries.
Credential boundaries.
Network boundaries.
State boundaries.
Deployment boundaries.
The more powerful the agent becomes, the more important those boundaries become.
My Take
I think we're beginning to see the emergence of a real Agent Development Lifecycle.
It won't simply be today's CI/CD pipeline with an LLM added to it.
The surrounding infrastructure will evolve.
Agents will receive isolated workspaces.
Branches will create isolated application environments.
Observability systems will become machine-readable feedback.
Automated browsers will verify behavior.
Security policies will constrain tools and credentials.
Humans will review evidence instead of manually performing every step.
The agent won't just write the code.
It will increasingly be able to prove that the code works.
That's a much more interesting future than code generation alone.
But to get there safely, we need to give our agents the same thing we've always needed as developers:
A place where it's okay to break something.
Comments
Post a Comment