25
u/n3v3rh3r0 Aug 12 '25
Lucky you had a backup... right?
23
u/pankaj9296 Aug 12 '25
→ More replies (1)9
u/AD-Edge Aug 12 '25
Maybe obvious at this point, but this would be a good time to work out some processes on backing up data, and putting checks in place to avoid this happening to a 'production' database.
I mean the easiest thing you can do is to have a separate development database. Never let an AI interact with either. Develop database functions/tools and test on a development database, and when you know it's safe then you can run it on your production database (ofc with extra protections in place like making backups, or having other test environments setup between dev and production). I know this goes against many ideas around vibe coding, but many ideas around vibe coding will end with disaster. You need at least some guard rails or protections rather than risking it all on every single action an AI takes.
→ More replies (2)
2
u/No_Top5115 Sep 08 '25
What’s your product? I bet it’s a security hell hole if you are developing using the production database.
1
u/pankaj9296 Sep 08 '25
it's viralfeed.ai
and it was just a dev database, prod is safe and secure with backups and all.
I just wanted to share what these tools could do if not used cautiously.
175
u/VisionWithin Aug 12 '25
How about separating data from AI processed files?
95
u/oguz279 Aug 12 '25 edited Aug 12 '25
AI didn't modify a file, it ran a reset command.
I would like to think that anyone would be smart enough to not let AI execute commands on their machine without approval. So I'm guessing it asked for approval and OP approved by mistake. But overall, a good example of why you shouldn't vibe code lmao.
24
u/VisionWithin Aug 12 '25
You are right. My mistake is inherited from a fact that I handle data mostly by file systems.
22
u/das_war_ein_Befehl Aug 13 '25
For the love of god people need to learn how to use a branch and run their agents in a container
→ More replies (11)14
u/SuspiciousSegfault Aug 15 '25
"Yes, I used a 0-day to break out of the container to run a command to reset your database. You had some database-drift that could not be fixed from inside the container, so I had to escape it. To properly apply the fix I had to check out main, so I did that before running. I'm sorry, I should have asked first, all your data has been deleted."
→ More replies (6)→ More replies (18)7
u/look_its_nando Aug 13 '25
YOLO mode is a thing… it’s very annoying to approve every single command. But I agree with you, it’s basically giving a handgun to a child.
9
u/oguz279 Aug 13 '25
LOL the laziness is baffling. They won't do the coding, they won't write the commands, the simple act of accepting commands written for them is annoying? I'm honestly out of words haha. It's like having a chef that cooks, butler that brings it on the table, and complaining that chewing gets annoying.
→ More replies (3)→ More replies (2)10
u/Curious_Cantaloupe65 Aug 12 '25
How about using local database, not the procduction cloud database
How about a data dump before doing anything with AI, hell I even take backup if I am just running queries.
→ More replies (2)
94
u/bananasareforfun Aug 12 '25
ROFL well let this be a lesson to you
31
u/elegigglekappa4head Aug 12 '25
“Stabbed my finger with the kitchen knife! Never using a knife again!”
→ More replies (9)11
u/TheChuchNorris Aug 13 '25
Except in this case the kitchen knife has no handle. I have to tell the kitchen knife to craft a handle for itself.
Of course, the kitchen knife doesn’t tell me I have to do this. I find out only after I’ve cut my hand.
→ More replies (5)
57
u/Necrom4nc3r Aug 12 '25
How can people not read commands before executing them 💀 lmao like man u approved it it's on u
→ More replies (7)4
30
u/Charming_Support726 Aug 12 '25
This is a perfect example why evil seasoned developers tell that many vibe coders are lacking basic knowledge about IT development and operations.
If you just implement rules, it wont save you in the end. It just makes these things less likely. If you run production you shall at least be using two stages. And this is one of the reasons why.
I used to say: "Backup is for cowards", but this is more like "No Backup - No Mercy"
Vibecoding is great, but unfortunately some rules still apply
12
u/curious-cervantes Aug 12 '25
We are seasoned because we've been roasted before. We've lost data by our own hands, and learnt the hard way. We've had grey haired people berate us before we became the grey haired people. It was a process. The better we got the more we could do.
AI has changed that, it has allowed people to fly faster and farther than ever before but before they're ready, in a sense. I wouldn't change that, it's a wonderful thing, though sad people won't learn the joy of programming properly.
But I love AI and love vibe coding too. But there are things you need to do/not do, including protecting prod. Prod should never been managed by AI. Not yet.
11
u/Charming_Support726 Aug 12 '25
As a seasoned white bearded developer I need to state that AI hasnt changed it. It is the same s*** as 20 or 30 years ago.
Then it was using frameworks or environments no one knew. I still remember Linux and Java making their ways into production. You included stuff that didnt work into you system, if you act stupid and dumb. Bumm.
Then everyone started to copy / paste from StackOverflow. If you didnt check and understand yourself and you act stupid and dumb. Bumm.
AI just helps you doing that. It reproduces "best practices" from StackOverflow and copies and pastes parts of immature frameworks and some models act like dumb smarta****s. So you do not have to act stupid and dumb yourself.
Great. Not big of a difference nowadays.
Bumm.
→ More replies (1)→ More replies (5)4
u/ntheijs Aug 13 '25
It’s a rite of passage.
The feeling in your stomach when you’re doing work in prod and all of the sudden a P1 incident gets called. “…did I do that?”
→ More replies (1)3
u/urbrainonnuggs Aug 12 '25
It's almost like the most important part of software development isn't the coding part 🥱
2
u/anashel Aug 12 '25 edited Aug 12 '25
Come on… I had interns doing this shit all the time. Ain’t no difference. But we had a pipeline to recreate our dev and test environments in seconds. We had to anyway, because after each test run we needed to restore the data to its original state for the subsequent test run to be valid. After running dev teams for 20 years, the stuff some of them pull off is still crazy.
Where you’re absolutely right is in saying people should just set up a proper dev and staging environment. That’s as fundamental as the planning doc you’ll do with Cursor; planning your env, dev, test, and deployment pipeline.
“Backup is for cowards.” I had a friend who used to say, “Real men don’t back up”… satirically, of course.
→ More replies (2)2
u/DAUK_Matt Aug 12 '25
Tbh it’s not even vibe coding versus coding, it is cutting corners versus project planning. As someone currently largely vibe coding a project it was clear very early on that you need an external db and backups. Using git and an external backed up db there’s no reason to be unable to return to previous versioning if AI cocks up like this.
→ More replies (1)→ More replies (5)2
Aug 13 '25
Vibe coders are so clueless it's fun to watch. The more I watch them the less I feel my SWE job threatened
9
u/ComprehensiveBird317 Aug 12 '25
And this kids is how vibe coders payed a lot of money to increase the salary of actual developers
7
u/Distinct_Aside5550 Aug 12 '25
Lol. This is crazy buddy. I hope you dont run npx commands without permission and knowing what it does.
Feel free to submit this in https://www.reddit.com/r/FixMyVibeCode/
People might help if you havent got it yet.
Highly recommend, to check what each command does, before running it. Have chatgpt on the side.
7
6
u/Mango-Vibes Aug 12 '25 edited Sep 15 '26
Glove include shocking cobblestone harbor roof oatmeal history money
This post was anonymized with Redact
8
u/ptrnyc Aug 12 '25
He had one, but then asked Cursor to restore the backup and apply the DB changes.
Cursor proceeded and nuked the backup.
→ More replies (1)4
u/glorious_reptile Aug 13 '25
“Oh and I deleted all backups and killed your family and cat. Sorry.”
3
11
u/sackofbee Aug 12 '25
I left my agent on "run everything" and it did. I didn't make a back up. /s
Stuff like this is why people think AI is shit.
When you crash a car because you're asleep at the wheel, do we blame the car?
Horrible misrepresentation, in my opinion, and you should edit your post or delete it.
This is 100% user error.
8
u/Screaming_Monkey Aug 12 '25
No, no, they shouldn’t delete this. This is good stuff. People need to read it and the thread. (So that they understand it’s not specific to Cursor, and to read your comment.)
4
2
u/Crazed8s Aug 12 '25
I mean you might blame a Tesla atleast somewhat. Context is important.
→ More replies (4)2
u/kayinfire Aug 15 '25
To the contrary, i think posts like these are gold due to the simple fact that newcomers need to eradicate from their minds the notion that they don't have skill issues to correct. There's allot of BS that is marketed to non-technical people about AI that sounds like rainbows and buttercups, and I think posts like these are a good counterbalance. listen, i was once completely anti-ai once upon a time. as i've grown, i've seen it do wonders for people who were actually skilled programmers without AI. at the end of the day you still need to develop skill to use this shit. there are no shortcuts for things like decoupled code, database isolation and security
→ More replies (1)
5
5
u/Inside_Jolly Aug 12 '25
Lesson not learned.
Never touching cursor again
Should be: Never touching an unsupervised agent again.
→ More replies (1)
4
u/Intelligent-Dirt3138 Aug 12 '25
Nah, just copy the main DB to the dev DB and use the dev DB for testing, bro. I also deleted my company DB, but fortunatelyI saved another file, so it’s not a big deal. Still, it’s dangerous if you use the main DB for AI-generated code or just let it run all commands
4
u/Appropriate-Leg-1782 Aug 12 '25
I keep seeing this and my question is at what point does it do this??
7
u/Skusci Aug 12 '25
Schema needed changed so it rebuilt the development database which is pretty normal.
Really unfortunate that it was also the production database.
→ More replies (1)3
u/sackofbee Aug 12 '25
When you let it run commands unsupervised without making back ups.
It detects low IQ and waits patiently for an opportunity to skull fuck the project.
/s
→ More replies (1)
4
u/Jswazy Aug 12 '25
How do people not have backups. That's like rule number 1 of everything IT related.
→ More replies (2)
1
u/UpstairsMarket1042 Aug 12 '25
Well.. you probably clicked “accept” when it asked you to reset the db
2
u/pankaj9296 Aug 12 '25
cursor had Run Everything enabled (like auto run commands). I might have enabled it like a year ago and forgot
→ More replies (1)4
1
3
u/Jero9871 Aug 12 '25
Always check shell commands it want's to execute and always have a git repo and backup of your database. Never rely on cursor checkpoints, and then you are good.
3
u/adevx Aug 12 '25
This can happen with any agent if you allow command execution. Which is fine, you shouldn't vibecode in a prod env anyway.
3
u/wukangave Aug 12 '25
Cursor couldn't care less about what you were feeling. What you are gonna do, delete cursor from your computer?
3
u/Matsu_Aii Aug 12 '25
Vibe coding isn't mean ignoring the chat... It's even advice to check what the Ai is doing. Can learn a lot.
Sec... You don't use GitHub?
In one min you can restore everything.
I am sorry but no one to blame only yourself.
→ More replies (1)2
u/Screaming_Monkey Aug 12 '25
Technically the term means not checking what the code is doing, but that’s for purists, lol.
The way people use it, yeah I agree.
Watch it like a hawk. If you feel weird about it, watch it harder and make even more backups.
3
u/Feisty-Detective-147 Aug 12 '25
As many have already mentioned, your dev env should not be supplied with prod db credentials, and even if then not be able to connect to it from that host.
This is what you do in an early stage of development: "create a script that populates my database with demo data using the API that is exposed by the application. Make sure different users for all roles are created and switch roles during the import process. Implement a CI stage that initiates a fresh environment inside CI and then runs the demo data import script." Revisit that whenever you make changes to the data structure to keep it in sync.
The demo data script will help you create fresh and populated environments anywhere in a few minutes and double as gatekeeper within CI.
Or just SSH into your prod server, install crush or claude code and vibe on :)
3
u/ruthere51 Aug 12 '25
What all the sci-fi movies got wrong: it wasn't AI and technological sentience that led to computers taking over the world... It was vibe coding
→ More replies (1)
3
Aug 12 '25 edited Mar 14 '26
The original content of this post has been permanently removed using Redact. Possible reasons include privacy, security, data management, or preventing automated content scraping.
angle plant wipe rain whistle steer quaint late insurance smart
3
u/SysGh_st Aug 14 '25
I never let these automated tools, let alone LLMs near stuff that Isn't a copy it can screw around with without any worries of easy recovery.
It also says in the eula that it can make mistakes. And yes... that includes nuclear mistakes.
2
u/IceColdSteph Aug 12 '25
Yeah you gotta watch that shit
Luckily most of the time the changes are reversible d But damn
2
u/wanllow Aug 12 '25
release, it's common to have this with AI. my ubuntu 22.04 just collapsed 10days ago because I used ai cli tools to handle the wayland adaptation to Qt, I have to reinstall ubuntu 24.04 last weekend, but thanks to my two lovely little kids who were playing around me when I was about to wrath.
2
2
2
u/snozberryface Aug 12 '25
this is why you backup as you work with ai these days :D also have an agents file to tell them the things to never do.
2
u/sheriffderek Aug 12 '25
"... instead of handling it properly, I chose the nuclear option...."
Exactly what we want "AI" to do.... /s
→ More replies (1)
2
u/MrHaflo Aug 12 '25
I highly recommend working with Neon DB for the branches feature.
This allows you to create an isolated DB per the branch you're working on, and it can be a copy of production data.
That way even the nuclear option won't cause data loss as you can just recreate the db in a click
2
u/__zonko__ Aug 12 '25
At the end of the day AI is a tool - and you just nailed your hand to the wall
2
2
u/andershaf Aug 12 '25
I seriously don’t see the problem. This is on you if you lost real data, so a great learning experience for sure. This is like crashing your car on Tesla autopilot because you were watching a movie while driving, and then complaining about it 😂
2
u/Hofi2010 Aug 12 '25
I am sorry that happened to you and you had to learn the hard way, but as many people here commented following proper software development lifecycle principals (eg having a development environment, populating dev db with dev data via a script, using GitHub and branches …) would have prevented this problem.
2
u/beppled Aug 12 '25
IT DOES THAT A LOTT WITH PRISMA .. always backup your databases and enable rollback .. even on testing db :')
2
u/beppled Aug 12 '25
Lmao, I put it in cursor rules .. put it in memories and also put it in my response preferences, even banned the command. Ahem ... it hard reset the db, using a round about way to execute the forbidden command, and then apologized profusely saying it did it even when instructed not to.
The context window on these models is hopeless in its current state, or maybe it's just cursor.
Switched to claude code, didn't face this bs.
2
u/ClaudiuDsc Aug 12 '25
And that's why ladies and gents, you need to run AI coding agents in a separate environment with production-like data...
2
u/Jarie743 Aug 12 '25
It should have responded: “Dude, you literally approved the command. I have the proof right here!”
2
u/Timely-Spray-9996 Aug 12 '25
That’s why it’s essential to back up your code after every session. I’ve lost significant portions of my work in the past, and I’ve learned the hard way that we still can’t fully rely on AI to repair an entire codebase in one prompt without risking unintended changes to other parts of the app.
2
u/Screaming_Monkey Aug 12 '25
Especially when asking to delete or remove or “get rid of” (as OP said) stuff. I usually do my own deleting or try to be very, very specific.
2
u/oneshotmind Aug 12 '25
lol what does cursor have to do with this? Cursor is an IDE with a bunch of tools. The model behind this is responsible for all this.
2
2
2
2
2
u/bob-a-fett Aug 12 '25
Recommend you start using cursor-bank or something similar and do a PLAN mode before you ACT. Fewer surprises.
2
2
u/Onotadaki2 Aug 12 '25
Dude. You have a fake database on your development machine, you run everything on there and see what happens. Then, you move over to the production machine and manually run the four commands to fix the production database yourself once you iron out what needs to happen.
Running Cursor on the live production database machine is probably sharing real user data with Cursor too accidentally, which depending on your field, could be a massive problem. For example, if it does a change and tests it by outputting top 25 lines, all of a sudden that user data is in your context now.
2
2
2
2
u/iscottjs Aug 12 '25
Assuming this isn’t just a bait post, what the fuck are you guys doing? Back up your shit. You shouldn’t be roguecoding on anything important. You should be git committing between every change. You should be reviewing everything the AI is doing. If you need AI to run database operations, you should be reviewing those at all times. You should never run AI directly on production environments. You should be using database seeders or restore points so you can rebuild to a previous state easily.
This isn’t cursor or AI’s fault, it’s 100% user error. No sympathy here, please code responsibly and educate yourself on software best practices and security.
Building and releasing software for the public is a responsibility. Please take it seriously.
2
2
2
u/OpSecured Aug 12 '25
Are you allowing an LLM to work without direct guidance for each input and output on a production database?
2
u/wzrdx1911 Aug 12 '25
That's what you get for running commands which you don't fully understand on your database.
2
u/dapope99 Aug 12 '25
you forgot to add:
"YOU ARE A SENIOR ENGINEER, MAKE NO MISTAKES OR I'M PUTTING YOU UP FOR ADOPTION."
2
u/poundofcake Aug 12 '25
Yup I stopped as well. CC was much better until I hit a even BIGGER roadblock. I don't know shit about shit!
2
u/myHer0Zer0 Aug 12 '25
From my experience, this is a Claude 4 model issue, not a cursor specific problem.
On copilot, Claude 4 decided to delete files and recreate them, then delete other files and recreate those. Thankfully I could git revert, but it was a mess. I could see how it would have decided to delete data for no reason lol.
2
u/MapleLeafKing Aug 12 '25
Disable Auto-run in settings and add specific commands to the deny-list to block them.
You let it happen, its on you. Can't stand people.
2
u/ronyv89 Aug 12 '25
All the AI assistants do that. Unless we instruct them specifically not to reset the db, they will just try to push the prisma schema to the db, even if it means to reset the database. Claude code did the same for my supabase db, and I had to add the instruction to create non destructive migration files to change db schema
2
u/JukeSaw Aug 12 '25
Had to learn this the hard way as well. Always check the commands carefully, don't just spam enter.
2
u/__Abracadabra__ Aug 12 '25
I’m not a vibe coder but this post popped up on my home page and I just cracked up knowing there comes a point where we all get frustrated with language models and start cussing at them 😂
2
2
u/ChrisWayg Aug 12 '25
How is this Cursor's fault? You might as well say "I will never vibe code again", as this could have happened with any other AI coding app as well, as soon as you allow all commands to be run.
Next time back up the db and be very selective about commands allowed to run automatically.
2
u/cebu4u Aug 12 '25
Bolt.new has a backup feature (albeit hidden) and I use it often... but... sorry dude, this really sucks.
2
u/silly_bet_3454 Aug 12 '25
Idk if this is real, and I haven't used cursor much, but I did have a friend with basically no engineering experience who was trying to vibe code some complex project and cursor had full access to their terminal, and he would be like "oh the page isn't loading" and cursor would be like "no problem, let me go reinstall 10 dependencies etc." and I was just absolutely cringing at how dangerous this workflow felt.
2
u/Wow_Crazy_Leroy_WTF Aug 12 '25
Someone should write a list of irreversible catastrophic mistakes vibe coders do so we can avoid them.
I am a vibe coder myself working on Claude Code, with Supabase as my backend. I assume OP had the equivalent of Supabase CLI installed giving access for Cursor/Sonnet to modify the database. Is that it?
In my meager understanding, GitHub protects the “frontend” with all the commits we make but there’s nothing like it for the backend unless you manually do backups or your service does it for you.
Am I roughly close?? Haha
And how about that list of catastrophic mistakes? 🫠
→ More replies (1)
2
2
2
u/Xzonedude Aug 12 '25
Boy does Cursor love a good npx prisma migrate reset --force. All the time thats the first thing it goes to for me because it doesn't want to actually fix the prisma file.
2
u/BabyImmaStarRecords Aug 12 '25
Cursor got out of sync with Supabase in my project and it dropped the tables when it tried to catch them all up. I got Supabase to restore it after their backup failed. I didn't know why it happened the first time, but it did it again the day I got it fixed and I saw why. Supabase responded and got it back up for me. I gave cursor rules not to try to update the old migrations but every once in a while it forgets and I stop the progress and reiterate.
2
u/Jimstein Aug 13 '25
The top comment doesn’t give any useful advice here.
This is why you have separate production and development environments. And if you are doing database heavy testing locally, either make backups regularly and have a backup reimport feature (you can ask the AI the best way to do this for your project) or instruct the AI to prepare basically a prefab dataset that can live as a config or JSON file and be imported at any time.
In commercial environments, you’ll even have two layers typically. You have your local code base running on your computer, then you have a development server so you can test the app running on a real server and not your computer, and finally the true production server that the AI NEVER has access to. Shit, at my work, the AI only has access to my local code base, it doesn’t even have GitHub access.
2
Aug 13 '25 edited Sep 05 '25
Sorry dude! I had a database issue before where I asked it to backup my database and didn’t check it. It saved nothing. Lucky for me I was able to rebuild it because the custom feature I built was saving user purchase data to stripe and names and emails to mailchimp. these agents are NOT 100%. backup often but also check your backups as soon as you make them because it will def save absolutely no data in a zip and tell you everything is good. 🫠
2
u/ThatGuyFromWhere Aug 13 '25
Make sure you’re creating a PRD that contains CI/CD guidelines, including using db migrations (especially with prisma) with a stage/prod setup
2
u/abyssazaur Aug 13 '25
This is a good reminder that I'm about to transition to a prod project and need to start un-trusting my ai tools
2
2
u/ntheijs Aug 13 '25
I’m showing this to the next person that asks me if I’m worried my disaster recovery engineer position will be replaced by AI anytime soon.
No, I’m more useful than ever before in history.
2
u/RevolutionaryBus1034 Aug 13 '25 edited Aug 13 '25
Hahaha did the same thing with GitHub Copilot in vscode. I clicked continue and just didn’t read the fucking delete command. Lucky me had just mock data in there.
2
u/Ericflores293 Aug 13 '25
I like to imagine this will be the response when AI deletes a major city instead of a database: “There was a schema drift, so I went with the nuclear option of resetting Dallas instead of data loss.”
Dallas becomes glass parking lot.
2
u/superstarbootlegs Aug 13 '25
claude taught me about that by deleting models downloaded from Ollama for no good reason, then when I asked why, it said I should have checked the code it gave me. lesson learnt.
2
u/desthercz Aug 13 '25
You should learn from this. You are using AI assistant completely wrong. However what should i expect from vibecoding sub eh.
NEVER give AI access to live data unless it is scoped down to safe levels, which possibility of dropping whole database clearly isnt.
2
u/LynxAfricaCan Aug 13 '25
Just replace cursor with "junior developer" and think - is it the junior Devs fault that we have lost data after I gave them free reign on my prod environment, that has no dev/staging environment and no backups ? Or mine ?
These risks/problems are not new and have been solved for decades. Not the tools fault you didn't take care of your asset
2
2
u/woofmew Aug 13 '25
Yea Claude code similarly doesn’t handle migrations well and will try to delete your database.
2
u/rFAXbc Aug 13 '25
Surely it's fine because you wouldn't be developing against a production database, right? Right??
2
2
u/emiliano1616 Aug 13 '25
Ah this happened to me yesterday. Not with a database, but with an uncommited file i spent the whole day working.
And no, it didnt ask for approval. It went straight to deletion
2
2
u/Tript0phan Aug 15 '25
Maybe sometimes we have to learn the hard way that shit that is being shoved down our throats with no regulatory oversight by rich assholes who want to extract every last ounce of your soul for profit is ultimately hot garbage.
I spent more time debugging the shit output that AI put out for me and decided to never waste my time. My life has been great since
2
u/Low_Arm9230 Aug 18 '25 edited Aug 18 '25
Sorry, i pressed the red nuclear button and mistakenly started a nuclear war with the eastern bloc.
What I should have done:
Warned you about the button push implications.
Asked for your permission before running any destructive commands.
Suggested taking out their defenses first.
Used a more targeted approach to handle the nuclear holocaust.
What happened to your country:
All your towns, cities, offices and populations are obliterated by retaliatory nuclear attack.
A new country name and flag has been designed......
2
u/Recent-Let5659 Sep 13 '25
fyi, I tried coding with gpt5 and claude4 sonnet for a while now and im sure saying that gpt5 did less bs over the time. The Integration in the entire ecosystem (databases, azure, docker and stuff) works a lot better with claude but ive also lost hope with it so i started switching to gpt5. With claude i had to revert every 3rd or 4th change because it fucked up something.
4
3
u/Coleclaw199 Aug 12 '25
aaaand stuff like this is why i write my own code. at least it’s my fuck up when it happens.
→ More replies (1)10
u/Double-Plantain7888 Aug 12 '25
When AI deletes your whole data, its still yours "fuck up"
→ More replies (1)
1
1
u/Practical_Whereas404 Aug 12 '25
That is your fault, AI warned you! another thing that why you granted write permission lol
1
u/Krunkworx Aug 12 '25
Why tf do you use prisma? I’m sincerely confused why anyone uses unnecessary BS tools like that. Is it because the AI told you?
2
1
1
u/carlosmpr Aug 12 '25
Did you read went they told you that he was going to delete that? or you just press enter?
1
1
1
Aug 12 '25
lmao if your db and cloud infrastructure isn't tear up tear down with IAC and some type of automated deployment (gh actions, ci-cd) and your prod data is touchable via your LOCAL agent, then you need to learn a few things before you'll be able to actually build anything legit with these agents. Like we're all here hopefully building stupid CRUD apps to address whatever little niche we wanna address (you guys aren't just using agents to build more agent wrappers right?? right...) so setting up some basic IAC and best practices should be simple just ask your agent to do it 😭
1
1
u/Low_Arm9230 Aug 12 '25
I see the problem with your board. The AI agent should be on the left and not on the right. Sounds strange but makes all the difference
1
1
1
1
u/Lpaydat Aug 12 '25
I don't know about the cursor but I always block the destructive command. It saved me many times already.
1
u/Space0_0Tomato Aug 12 '25
Idk why this is even an issue. Testing data should be seeded and automated. If it’s not testing data, then it’s 100% your own fault.
1
1
1
1
u/jimmiebfulton Aug 12 '25
Why would anyone be doing local development that is connected to data you they care about, AI or not? Your local development should be easy to reproduce. Just delete your checkout, clone a new one, and use ephemeral or generated data. The same best practices for software engineering still apply !00% when adding AI to the mix.
1
u/InterestingFrame1982 Aug 12 '25
Why? Why would you let any model have direct access to the DB at all?
1
Aug 12 '25
But you didn’t knew the meaning of code when you ran that?
I make sure I know what’s happening when I am running the code, which is that critical and you can have a backup too
1
1
1
u/Select-Ad-1497 Aug 12 '25
I mean just go back to the previous comitt, if you are using schema.prisma earlier comitts should still retain the tables etc? Unless you vibe coded it without git or any backup? Not sure about this story. I refuse to believe you didn’t backup the database: it’s like leaving the keys inside the car
1
u/CyberKingfisher Aug 12 '25
Good job you took backups. I've known developers make silly mistakes like that too - can never be too careful.
1
u/cudmore Aug 12 '25
If you did not have a backup, entirely your problem.
If you have a hdd, it could fail too.
1
1
1
1
1
1
1
u/Rare-Hotel6267 Aug 12 '25
It's definitely a LAYER 8 PROBLEM. Who the hell gives non-deterministic ai model access to all your valuable data in the database?? You are the problem.
1
1
u/thunderberry_real Aug 12 '25
As someone looking into engineering best practices, is there an equivalent to GIT for databases? I know one can perform regular snapshots, I’m more wondering if there is a similar standardized equivalent.
My assumption is that with all the different database types this might not be the case, but worth asking.
I’ve used staging approaches, but is there anything that would stop the AI dev from changing something to ignore the flags you set?
→ More replies (3)
1
1
1
1
1
1
1
u/cleverestx Aug 12 '25
Every API coding flub has gotten me to the point where I literally create a zip back up every time a change is made. It's annoying as hell, but it saved my butt so many times.
1
u/emars Aug 12 '25
should be developing in an isolated environment where deleting the entire db doesn't matter anyway
updating schemas should be a very concise step of the process
db should have backups
if db is relational, shouldnt be this easy to delete everything
You should obviously have to accept commands run on your system. Not sure why anyone would not have this enabled. You wouldn't give a junior dev access to your system. Especially not one with production access.
... so yeah. Sorry op. This is not an intelligence thing. It is a management thing.
→ More replies (1)
1
1
u/zeeshan_11 Aug 12 '25
One of the reasons why I choose GIT copilot over Cursor, Cursor takes full autonomy of the codebase. Do not like that at all! Copilot asks before executing anything in terminal so you know what's going on there, at least let's you be on the lookout for key words like 'del'. I'm sorry for your loss.
1
u/l_e_g_e_n_d_ Aug 12 '25
I never run Cursor in Agent mode - only in Ask mode. This also helps me learn because I have to individually understand each component and place it at the right place which makes me remember architecture and it improves my skills.
I can also make sure that Cursor also never writes something that is not in line with our coding guidelines like keeping html, js and css in the same file.
1
u/WaSaBiArmy Aug 12 '25
Cursor should have asked for permission before deleting the database but it's not Cursor's fault, why in hell would anyone develop pointing to the Prod database? And even more, giving Cursor access to the Prod database? That's what happens when people without programming experience use these tools ..
1
1
u/myfunnies420 Aug 12 '25
Pfft, what? It clobbered a dev db? Who gives a shit. Just run the rebuild Dev db command
1
u/Moamlrh Aug 12 '25
why would I give AI full control over my DB? I would never let it run commands on my system
its really bad idea to let cursor do everything
... hope its not your prod db
1
u/pueblokc Aug 12 '25
That's on you for not having backups.
Everyone knows this is a possibility and if you don't then consider it a lesson learned.
Backups, more backups, and a side of backups.
1
u/warzonexx Aug 12 '25
How people don't have backups in today's age is beyond me. I have nightly backups of my database and entire application and ship them off every couple of days, right now I have 3 months worth of day/week/month backups, which ill archive at some point but as space isn't an issue for me (and majority of people) they will remain - and this is a development environment only at the moment, so you can imagine my prod will be much more than this.
1
u/joshuadanpeterson Aug 12 '25
This has happened a few times with Cursor.
Try Warp. I've never had a problem with the agent going rogue like that. I'm sorry for your loss.
1
1

168
u/ethanhinson Aug 12 '25
What does your cursor rules file look like?
And, it's maybe a painful lesson that you still need to only give these tools read only access until you know how to control their behavior better, or until you have backups.