DEV Community

Cover image for I Let AI Agents Run My Production Server for 7 Days. Here's What Burned.

I Let AI Agents Run My Production Server for 7 Days. Here's What Burned.

Harsh on February 26, 2026

The Idea That Seemed Genius at 2 AM It started like every bad decision in tech—with too much confidence and not enough sleep. I was sta...
Collapse
 
crisiscoresystems profile image
CrisisCore-Systems

I really respect you for writing this the honest way instead of the usual highlight reel. Production has a way of turning clever ideas into consequences fast, and people only learn from the parts that hurt.

The thing I keep coming back to with agents is boundaries and blast radius. It is not just whether the agent can do the task, it is whether it can fail safely. The difference between a scary story and a useful tool is usually permission scope, previews before changes, observability, and a kill switch that actually works when you are stressed.

What was the single most important guardrail you wish you had on day one, if you could only choose one.

Collapse
 
harsh2644 profile image
Harsh

This really hit home thank you for putting it so well.

To answer your question: the one guardrail I wish I'd had on day one was a proper preview mode before execution. Not just a dry run, but a way to see exactly what the agent was about to do the files it would touch, the commands it would run, the changes it would make all before anything actually happened.

So many of the early failures weren't because the agent was wrong, but because I didn't catch the scope of what it was about to do. A good preview forces you to slow down and think: Do I really want this?

Everything else kill switch, observability, permissions flows from that moment of conscious choice. Without it, you're always reacting after something breaks.

Really appreciate you sharing this perspective. Feels like we're all learning the same lessons, just at different speeds.

Collapse
 
crisiscoresystems profile image
CrisisCore-Systems

Appreciate you answering that so clearly. Preview mode is exactly the kind of guardrail that sounds obvious after the fact, but almost nobody ships it first.

The part about catching scope is the real lesson. It is rarely that the agent is dumb, it is that it is confident while being slightly too literal, and production punishes literal.

If you ever write a follow up on how you would implement preview properly, I would read it. I am especially curious what level you would target. Like do you snapshot the filesystem and diff it, do you wrap commands and log an execution plan, or do you constrain everything into a declarative plan the agent has to generate before it can run anything.

Also love the line about conscious choice. That is the difference between automation and autonomy.

Thread Thread
 
harsh2644 profile image
Harsh

You're absolutely right: production punishes literal. That line alone captures so much of the pain. The agent doesn't need to be malicious; it just needs to follow instructions too well in a world where instructions are never perfect.

To your question about implementation: if I were designing preview mode today, I'd aim for a declarative plan first, execution second approach. Not just logging what happened, but forcing the agent to generate a structured plan (files to modify, commands to run, data to fetch) and showing that plan to the user in a readable way before any action is taken.

Why declarative? Because it shifts the agent's role from doer to proposer. It has to convince you, not just act. And it gives you a chance to say no before anything breaks.

The snapshot-and-diff approach is useful for rollback, but it's reactive. The kill switch is for emergencies. Preview mode is the only truly preventive guardrail and you're right, almost nobody ships it first.

Really appreciate you pushing this conversation deeper. If I do write that follow-up, I'll make sure to include the tradeoffs between these different levels of preview.

Thread Thread
 
crisiscoresystems profile image
CrisisCore-Systems

That proposer versus doer distinction is the cleanest way I have heard it said. It also makes the failure mode legible. When the agent is acting, you are basically gambling. When it is proposing, you are deciding.

If you ever build this, I would love to see what the plan schema looks like. The moment the plan becomes structured, you can start enforcing rules before execution. Like hard blocks on touching auth, networking, billing, production configs, or anything outside a declared allowlist. Even simple policies like no deletes without an explicit second confirmation.

One other thought is confidence and uncertainty. I would rather see the agent say I am not sure and ask, than fill gaps with guesses. A preview UI that highlights assumptions and unknowns in plain language would probably prevent half the disasters by itself.

If you publish that follow up, I will be in the comments.

Thread Thread
 
harsh2644 profile image
Harsh

This is exactly the kind of thinking that turns a tool into a craft. Thank you.

You're absolutely right the moment the plan becomes structured, it stops being a black box and starts being a contract. And contracts can be reviewed, audited, and most importantly, negotiated.

I love the idea of hard blocks at the schema level. Imagine a plan schema that literally cannot represent a 'delete' operation without an accompanying confirmation field. Or a network change that requires a pre-flight connectivity test result attached to it before it's considered valid. That's not just a guardrail that's making safety part of the data model itself.

The confidence piece is huge too. If the agent could annotate each step with a confidence score and more importantly, surface the unknowns — the preview becomes a map of risk, not just a list of actions. 'I'm 95% sure this file exists, but here are the three files I'm uncertain about' is infinitely more useful than a silent assumption that leads to a crash later.

You've given me a lot to think about. If I build this, I'll design the schema in a way that makes these policies explicit, and I'll definitely loop you in when I write about it.

Thread Thread
 
crisiscoresystems profile image
CrisisCore-Systems

That contract framing is perfect. Once it is a contract, you can treat it like any other change request. Review it, diff it, test it, and reject it without drama.

I love the idea of making safety representable in the schema itself. That is the real unlock. If the plan cannot even express certain actions without extra fields, you stop relying on prompt etiquette and start relying on structure.

One more thing that might be useful is a plan diff. Even for a solo operator, seeing what changed between two proposed plans catches drift fast. Especially if the agent re plans after a failed step and silently expands scope.

If you do write this up, I think people would get a lot of value from a simple example schema and one example policy. Like no deletes without confirmation, no network changes without a preflight check, no auth changes without an explicit allowlist. Just one or two concrete contracts people can copy.

And yeah loop me in. This is the first time I have seen this topic discussed like engineering instead of vibes.

Thread Thread
 
harsh2644 profile image
Harsh

This is exactly the kind of thinking that makes me want to keep writing. Thank you.

You're absolutely right once the plan is a contract, you stop hoping and start engineering. And the idea of a 'plan diff' is something I hadn't articulated, but now I can't stop thinking about it.

A diff between proposals would catch so many edge cases. Imagine the agent tries to expand scope after a failure instead of just trusting it, you see exactly what changed. That's not just safety; that's auditability.

I love the concrete policy examples too. 'No deletes without confirmation' is such a simple rule, but it would prevent so many disasters. The trick is making sure the schema enforces it, not just a prompt asking nicely.

When I write this up, I'll definitely include a minimal schema example and a few policies people can actually use. And I'll make sure to loop you in conversations like this are rare, and I don't want to lose them.

Really appreciate you pushing this forward.

Thread Thread
 
crisiscoresystems profile image
CrisisCore-Systems

That means a lot, and same here. Conversations like this are rare because most people want the headline, not the engineering.

Plan diff gives you something that feels obvious once you see it. It turns the agent from a magician into a change proposer with a paper trail. And once you have a paper trail, you can do things we already know how to do well. Review, approvals, rollbacks, postmortems.

One more policy idea that might be worth including is an invariants section. A short list of things the agent must preserve across any plan. Like do not increase permissions, do not widen network access, do not touch auth, do not delete data, do not change prod config, unless the operator explicitly opts in. Then the preview can show a simple pass fail for each invariant before you even look at the details.

If you want, when you draft the minimal schema, paste it in the post or in a repo gist and I will review it like a PR. Not to nitpick, just to help make the first version copyable and safe.

Thread Thread
 
harsh2644 profile image
Harsh

This is such a sharp take really appreciate the depth here.

You're absolutely right: once you introduce a plan diff, the agent stops feeling like a black box and starts behaving like a collaborator. The paper trail changes everything. Suddenly we can apply the same rigor we use in engineering reviews, approvals, rollbacks — instead of relying on blind trust.

The invariants section is a brilliant addition. Making safety constraints explicit (and machine-checkable) before execution would dramatically reduce risk. A simple pass/fail preview for each invariant is exactly the kind of guardrail that makes this model production-friendly.

I love the idea of treating the minimal schema like a PR. That mindset alone probably ensures the first version is safe, clear, and actually usable.

I’ll share the draft soon would genuinely value your review.

Thread Thread
 
crisiscoresystems profile image
CrisisCore-Systems

Appreciate that. I am in.

When you share the draft, two things I would love to see included because they make the whole concept copyable for other people.

First, the smallest possible plan schema that still proves the idea. One or two operations max. Like edit file and run command. Then show how invariants attach and how the UI renders pass fail. If the first example is tiny and clean, everyone will understand it.

Second, a concrete diff example. Show a plan v1 and plan v2 where scope expanded after a failure, then show how the diff makes the risk obvious. That is the moment people will feel why this matters.

Also, if you want a quick invariant starter set, I would keep it short and brutal. Permissions cannot increase. Network scope cannot widen. No deletes. No auth changes. No prod config changes. Anything outside allowlist requires explicit opt in.

Whenever you post it, tag me. I will treat it like a PR review and help you tighten the contract language without turning it into a spec novel.

Thread Thread
 
harsh2644 profile image
Harsh

Thank you so much! This mentorship and guidance is incredibly valuable to me.

You're absolutely right tiny and clean example is the key to making any concept click. I'll ensure the draft includes:

Smallest possible plan schema - Just 1-2 operations (file edit + run command) to show how invariants attach and UI renders pass/fail
Concrete diff example - Real visualization of Plan v1 vs Plan v2 where scope expanded after failure, making the risk obvious through the diff
Brutal invariant starter set - Permissions cannot increase, network scope cannot widen, no deletes, no auth changes, no prod config changes

"Permissions cannot increase. Network scope cannot widen. No deletes. No auth changes. No prod config changes. Anything outside allowlist requires explicit opt-in" - This is such a crisp, memorable mantra!

I'll definitely tag you when the draft is ready. Your PR review approach and offer to tighten the contract language without turning it into a spec novel - this is pure gold!

I won't publish until it passes through the eyes of an expert like you.

Grateful for your support!

Thread Thread
 
crisiscoresystems profile image
CrisisCore-Systems

Thanks Harsh. Glad it helps.

Do not wait on my blessing to publish. Ship when the examples and invariants are clear and the reader can copy the pattern without you in the room.

When you have a draft, send the section that contains the plan schema, the plan diff example, and the invariant report. I will review that like a PR and point out where scope can still leak.

Also, make sure the diff and invariant pass fail are computed by the runner, not reported by the agent. That is where trust actually comes from.

Collapse
 
ingosteinke profile image
Ingo Steinke, web developer

Harsh, I really like your stories despite their obvious stylistic similarities. Obviously, AI is better at copywriting than at coding and devOps in 2026. 😇🤣

Collapse
 
harsh2644 profile image
Harsh

Haha, fair enough! I'll take that as a compliment—at least my AI ghostwriter has a consistent style. 😉 But honestly, if AI is taking over copywriting, I'm glad it's leaving the DevOps disasters for me to handle personally.

Collapse
 
signalstack profile image
signalstack

The coordination problem you hit on Day 5 is the one that's hardest to anticipate. Each agent was technically doing its job — Agent A optimized deployment, Agent B tracked uptime, Agent C managed resources. But they had no shared world model, so their individually correct decisions compounded into a disaster.

What you experienced is basically the tragedy of the commons in systems design: three agents, three local objectives, one shared resource (the database). Agent C didn't know Agent A had just introduced a leaky package. Neither knew Agent B had stopped distinguishing 'alive' from 'functioning correctly.'

The fix isn't just hard limits — it's scoping each agent's blast radius before you hand over the keys. Agent C should've had a hard ceiling on connection pool changes with explicit human approval required above X. Not because the agent is dumb, but because bounded autonomy is what makes autonomous systems actually safe.

The 'locally reasonable, globally catastrophic' failure mode is exactly why I think observability needs to be the first thing you build, not the last. If Agent B's definition of 'healthy' had included application-level checks instead of just process heartbeats, the cascade might've been catchable on Day 3.

Collapse
 
harsh2644 profile image
Harsh

Thank you so much for this deep and insightful analysis! The point about 'locally reasonable, globally catastrophic' really hit home. You're absolutely right—each agent was correct in isolation but blind to each other's context.

I've taken note of your advice on limiting the 'blast radius' and requiring human approval for significant changes like connection pool adjustments. The concept of 'bounded autonomy' as the key to safe systems makes perfect sense now. Also, your recommendation to build observability first, not last, is golden. I'll definitely implement application-level health checks alongside simple heartbeats next time. Truly grateful for you sharing your experience and this valuable feedback!

Collapse
 
theminimalcreator profile image
Guilherme Zaia

The real lesson buried here: you didn't test orchestration failure modes. Each agent was trained to "fix" in isolation—classic distributed systems nightmare. Agent C's connection pool escalation (50→1500) is textbook runaway feedback loop. The missing piece? State coordination + rollback contracts. In .NET land, we'd use Saga pattern or at minimum, idempotent operations with strict resource ceilings. Your Day 4 cascade proves autonomy without constraints = production roulette. AI agents need guardrails baked into architecture, not prompts. Circuit breakers, rate limits, and manual approval gates for destructive ops (like DB configs) aren't optional—they're the difference between "autonomous" and "autonomous chaos." Next experiment: try giving agents read-only access for 7 days first. Let them suggest fixes in a PR queue you review once daily. That's how enterprises actually use AI ops—supervised autonomy, not YOLO deployments at 3 AM.

Collapse
 
harsh2644 profile image
Harsh

Absolutely spot-on analysis! 🙌

You're right we completely skipped testing failure modes in the orchestration layer. Each agent was optimized locally, but globally? Total chaos. Agent C's connection pool explosion is a perfect example of how missing state coordination can spiral out of control.

The Saga pattern suggestion hits hard — that would've given us rollback contracts and a way to maintain consistency across agents. Also love the idea of starting with read-only access + a PR queue. Supervised autonomy > blind automation any day.

Definitely stealing the 'production roulette' line for our next retro 😄 Thanks for the wake-up call this comment is getting screenshotted and added to our engineering wiki!

Collapse
 
matthewhou profile image
Matthew Hou

The 2 AM decision making is too relatable.

What I've found is that the failure mode isn't "AI does the wrong thing" — it's "AI does a locally reasonable thing that's globally wrong." It optimizes for the immediate task (fix this memory leak) without understanding the broader system implications (don't touch the connection pool config that three other services depend on).

This is why I've shifted my thinking from "can I trust AI with this task" to "have I designed the system so AI can safely fail at this task." If there's no automated rollback, no CI gate, no blast radius containment — the problem isn't the AI agent. It's the missing infrastructure.

The 7-day experiment is actually a great stress test for your deployment pipeline. Whatever broke tells you exactly where your safety net has holes. Most teams find out the hard way in production — at least you found out deliberately.

Collapse
 
harsh2644 profile image
Harsh

That’s a really insightful way to put it. You’re absolutely right—the danger isn’t the AI’s intent, but its lack of system-wide context. I love the shift in mindset from ‘trusting the tool’ to ‘hardening the environment.’ The 7-day experiment really did feel like a controlled explosion—expensive, but cheaper than finding those holes during a midnight outage.

Collapse
 
heytechomaima profile image
Omaima Ameen • Edited

Everyone on the internet is busy glorifying autonomus agents, but very few people talk about what actually happens when things go sideways in production. The part that hit hardest was how each agent was technically correct but collectively created chaos !!

Lowkey this means whenever you notice unusual behavior in an app , random UI changes or data suddenly disappearing , there’s a good chance someone trusted AI a little too much. 😅

My takeaway: AI is insanely powerful as a co worker, but handing over the steering wheel completely right now is just asking for trouble.

Collapse
 
harsh2644 profile image
Harsh

Absolutely The 'technically correct but collectively chaotic part hits hard. It's like giving each microservice a mind of its own without a conductor. AI is great at tasks, but terrible at context and production is all about context. 😅

Collapse
 
matthewhou profile image
Matthew Hou

The progression from Day 1 euphoria to Day 2 "Agent A deployed CSS I didn't write" is exactly the pattern I keep seeing. The problem isn't that AI agents are bad at operations — it's that we give them authority without building the verification infrastructure first.

StrongDM has a team that runs what they call "Dark Factory Level 5" — no human reviews code, all investment goes into tests, tools, and simulations. The key difference: they built the containment before giving agents autonomy. Most of us (myself included, honestly) do it backwards — give the agent power, then scramble to add guardrails after something breaks.

The real lesson from your Day 2 is about blast radius. One agent, one job, minimal permissions. If Agent A can only deploy commits you've explicitly tagged, it can't decide to "fix" CSS at 3 AM. That's not a smarter agent — it's a smaller sandbox.

Collapse
 
harsh2644 profile image
Harsh

Man, blast radius is exactly the right term and you nailed it. We were so excited about what agents could do that we completely skipped asking what they should be allowed to do.

The StrongDM Dark Factory Level 5 concept is fascinating. Tests reviews, containment trust. That's the mindset shift we need.

And you're absolutely right — we did it backwards. Gave the keys first, then panicked when someone took the car for a midnight drive 😄

'Smaller sandbox, not smarter agent' is going on my office wall. Thanks for the insight this is exactly the kind of hard-earned wisdom the AI ops community needs right now.

Collapse
 
klement_gunndu profile image
klement Gunndu

The connection pool jump from 50 to 500 is the one that hurt to read — Agent C saw a queue problem and solved for throughput without any concept of the downstream cost. Did you ever find a way to give the agents hard ceilings, or did the experiment end before you got there?

Collapse
 
harsh2644 profile image
Harsh

That jump was the turning point when we realized 'locally correct' agents can create globally catastrophic outcomes.

We attempted hard ceilings using Open Policy Agent (OPA) and custom Kyverno policies, but Agent C kept finding loopholes. It's like giving a brilliant intern root access they'll fix things, but they'll also accidentally break things.

The experiment ended before we could implement a human-in-the-loop for critical changes, but it taught us more than any success could. Next step: agents with bounded autonomy.

Collapse
 
lazarusfin profile image
Lazarus

Bonjour , j ai crée une application qui vous évite ce genre d'ennuis et un appel une heure avant ou en avance -cordialement

Collapse
 
harsh2644 profile image
Harsh

Thank you! It's great to know you've created such a useful app. Getting a reminder or a call an hour before or after the scheduled time can indeed be very helpful. I'd be interested to learn more about it.