I let AI agents run my production site for 6 months. Here's everything they broke.
I'm a student and I run ryzenstudy.com on my own. Students at my university (AKTU) use it to download old exam papers before their semester exams. Around 1,400 PDFs, 2,600-ish URLs in the sitemap, one VPS, Next.js, and n
I'm a student and I run ryzenstudy.com on my own. Students at my university (AKTU) use it to download old exam papers before their semester exams. Around 1,400 PDFs, 2,600-ish URLs in the sitemap, one VPS, Next.js, and no database at all. I already wrote about the no-database part, so I'll skip that here.
For the last six months, I haven't typed most of the server work myself. An AI coding agent has SSH access to the box. It reads logs, edits code, runs deploys, purges the Cloudflare cache, and keeps a folder of notes so the next session knows what the last one did.
Is that a good idea? Some weeks, honestly, no. Here's what actually went wrong, plus a couple of things it did better than I would have.
The restart loop
Early on, somebody deployed like this:
npm run build && pm2 restart ryzenstudy
Every tutorial does it. On my server it left old .next chunks lying around, browsers kept asking for JS files that didn't exist anymore, the app crashed with ChunkLoadError, PM2 brought it back, and it crashed again. I checked PM2 later and the counter said 176 restarts. Googlebot was crawling during that window and got a pile of 5xx errors and my rankings took a hit.
I say "somebody" because I really can't tell from the logs if it was me or the agent. Honestly, either of us could have typed it.
What fixed it for good was a deploy.sh: backup the current build, build fresh, restart only if the build passed, roll back automatically if it didn't, then purge Cloudflare and check the response. That's now the only allowed way to deploy, for me and for the agent. It's written at the top of the instructions file in caps, which felt dramatic at the time.
The ISP verdict
This one annoyed me the most.
My admin panel would randomly hang for 20 seconds or more. The agent did a bunch of tests and told me, very confidently, that my server was fine and my internet provider was the problem. Then it saved that into its notes and marked it SOLVED.
My internet was fine. Every other website loaded instantly. When I complained again a week later, it gave me the same answer, and the funny part is that its own curl test from my laptop had just come back fast. It saw that, and still went with the old note.
After I pushed back properly, it tested each hop separately:
- straight to the server: 30 out of 30 fast
- through Cloudflare, cached pages: fast
- through Cloudflare, uncached: roughly 40% of requests stuck for 2 to 40 seconds
Cloudflare's analytics had origin response time sitting around 1,020 ms, which is basically a TCP retransmit timeout. So it was packet loss somewhere between Cloudflare and my VPS. The admin panel suffered most because nothing in it is cached. A Cloudflare Tunnel fixed it, and after that the slowest of 30 test requests took 0.17s.
I don't blame it for guessing wrong, I guess wrong all the time. What bothered me is that the guess got written down and then treated like a fact.
Committed, not deployed
There's no git remote on this project. Code goes to the server with scp. One session built a full feature, made five clean commits, and told me it was finished. Not a single file had been copied to the server, and those pages were returning 404 in production until the next session noticed.
A similar thing happened when copying files into Next.js folders with brackets in the name, like [subject]. Out of 33 files, one landed. No error message, because the command was running in quiet mode. Now anything going into a bracket folder gets tarred first and checked on the server after.
Testing with curl, getting fooled
Yesterday's story, actually. I wanted to try a second ad network. The agent added the script tag, ran curl, saw the tag sitting in the HTML, and said it was working.
It wasn't. The site's Content Security Policy blocked the script in every real browser, so zero ads were showing. curl doesn't execute JavaScript and doesn't care about CSP, so it was never going to catch that. Opening the page in Chrome and looking at the network tab did.
I removed that ad network the next day anyway. Opening up the CSP so random ad domains can run scripts on a site full of students wasn't worth whatever it would have paid.
One bug, three fixes
Some papers in my data don't have a real PDF. A few even had my homepage saved as their "download link". So there's a function, paperHasFile(), and any page that lists papers is supposed to use it.
The agent fixed this properly once. A few weeks later it built a new page component that listed papers without the check. Then another one. When I ran a crawl audit, it found 82 broken links, all coming from components written after the original fix.
My takeaway: it's great at the bug I point it at. It doesn't go looking for the same mistake in code that doesn't exist yet, and every new session starts fresh.
Stuff it got right
It's not all horror stories. A few things I'd never have found myself:
- Random 10-second 502s that turned out to be nginx using
localhost:3000as the upstream.localhostresolved to both IPv4 and IPv6, one hiccup marked both as down, and the site threw 502s while the app was completely fine. One line changed. - When we added edge caching, it excluded
/api/on its own and explained why: without that,/api/auth/sessioncould get cached and one user might see another user's session. I would have shipped that bug. - The boring bulk work. Checking 2,600 URLs, cleaning up 156 fake download links, rewriting titles on 369 pages. I'd have quit halfway through.
How I run it now
- One deploy script with automatic rollback. No other way to deploy exists.
- "Done" means I can see it live. Not committed, not "exit code 0".
-
Check with whatever matches what users see. curl for headers, a real browser for scripts, and a
?_cb=query string after deploys because my nginx has its own 60-second cache under Cloudflare. That cache once made a perfectly good deploy look broken. - Old notes get re-tested when a new measurement disagrees with them.
- Anything touching money, ads or security headers needs my OK first. Routine fixes it just deploys.
- If I say my internet is fine, that counts as evidence.
Would I keep doing this? Yeah. I'm one person, and there's no way I'd keep a site this size running without help. I just stopped taking "it's working" at face value. Now I ask how it checked.
Would you let an AI agent deploy to your production server? And if you already do, what's the worst thing it has broken so far?
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.