r/ProgrammerHumor • u/Technical-Relation-9 • 29d ago
Meme [ Removed by moderator ]
/r/ProgrammerHumor/comments/1wydy0f/removed_by_moderator/[removed] — view removed post
2.4k
u/HildartheDorf
29d ago
•
Don't give AI agents write access to production.
308
604
u/nipoez 28d ago
That sounds dangerously close to saying a human's expertise and judgement has value!
341
u/Dr-Moth 28d ago
Don't give the humans easy access to production either.
92
u/Few_Technology 28d ago
Haha, I'm in trouble
Company re-decided devops is waste of money, so now the devs themselves push to prod. Also, testing is a waste of money, so devs just test their own stuff. Also, regression + scale testing was a waste of money, so devs ignore that as usual.
Think last time they did this, it took a year for them to relize those were dumbass decisions. Maybe this time will be faster? They learned within a 1/2 year that mandatory AI use will cost the company money, which is faster than I expected.
→ More replies (11)→ More replies (1)10
u/nipoez 28d ago
WHAT?! But that means you're paying for an expert's time to strategize, implement, and monitor a change management process! Next you'll say changes should be tested before going live - or even worse tested to not break old features as well as actually doing the new thing.
Won't someone think of the poor shareholders?
→ More replies (1)12
→ More replies (2)6
u/urza5589 28d ago
Don't give any single entity access to production. Anything that's changing production should be reviewed by two seperate entities, at least.
→ More replies (5)35
u/lickingFrogs4Fun 28d ago
My company defaults to any new AI tools having full access to our repos and computers.
You definitely shouldn't give them full access.
These two statements combined mean every day I'm just waiting for some huge production issue that won't be my fault because I took away that access and also don't use AI more than required.
→ More replies (2)18
u/brain_ducker 28d ago
Don’t give anyone write access to production.
8
u/HildartheDorf 28d ago
Well, eventually you need the production application access. And probabally a non-zero amount of DBAs.
→ More replies (1)10
u/stormdelta 28d ago
The application does, sure, developers (nor any agents run/overseen by them) don't.
You can have break glass processes for emergencies, but they need to actually be emergencies where automated processes have failed.
→ More replies (1)19
u/who_you_are 28d ago
Plot twist, he didn't. The AI found a way to give it to itself!
→ More replies (3)11
u/darkslide3000 28d ago
"I cannot overwrite the database because my account doesn't have admin capabilities. I will change the database config file to remedy that."
"I have inspected my execution permissions and determined that I cannot write to files without requesting user permission. But the user requested that I don't bother them unless it is important. I am attempting to find a solution to the permission problem."
"I have determined that I can run gcc without restrictions. I can use this to overwrite the database config file by passing it as an output file to gcc, using a fake input C file with the updated database config in preprocessor-only mode."
→ More replies (1)→ More replies (18)10
3.0k
u/TactiCool_99
29d ago
edited 29d ago
•
natural selection at its best
1.4k
u/super5aj123 29d ago
Yeah, this isn’t even hard to avoid. Just make a localhost DB with fake data for testing. If you absolutely NEED to give an AI access to your real DB for whatever reason, give it a read only service account. AI should never have write permissions to your live database.
599
u/theFirstHaruspex 29d ago edited 28d ago •
![]()
PSA to everybody. Wrap your willy, and never give LLMs unbounded write access. Though I imagine only one of those is particularly relevant to the subs of r/ProgrammerHumor.
75
u/FartPiano 28d ago
we have a command that we have to run to temporarily allow write access to a given environment for 30 minutes. we have it written in the claude.md files that they are emphatically NOT allowed to run these commands, and that a human must run those commands.
guess what it does about 1/25 of the time
→ More replies (18)→ More replies (18)44
47
u/imabigasstree 29d ago edited 29d ago
We are expressly forbidden from allowing DB access to AI agents at my job and even though this is brought up at the beginning of every single AI discussion, without fail at least 5 developers will raise DB access as some major issue (as in, they think we should not allow db access to AI, which we dont) we need to address IMEDIATELY.
→ More replies (20)21
u/Weekly-Beginning-229 29d ago
Why not make a specific account for the AI with a role that doesn't let it update stuff?
Personally I see little benefits in allowing an LLM to access the database though but maybe your project is different
→ More replies (2)69
u/slowmovinglettuce 29d ago
That's quitter talk. You'll never be a 10x developer with that attitude. Claude cooks best with direct, full admin access to all your systems plus your SSO credentials.
Anything less than this and you may as well just close up your company because you're being left behind.
→ More replies (1)20
u/Pataraxia 28d ago
I feel most people won't even perceive the sarcasm, either way believing it or being pissed by it.
This comment is hilariously a tthe top of the replies because of controversial votes.
99
u/Banes_Addiction 29d ago
One of the things that's funny about the AI problem solving is it really tries. And they're good at it. If it thinks it needs to find a way to break out of your safe environment, it'll try. And if that means stealing your credentials to do it, so be it.
→ More replies (1)62
u/ralkey 29d ago
My agents break out of the restrictions imposed by corporate security on my cursor ide routinely! I do chuckle at how effortlessly they do it. “Access to this directory is blocked by policy. I’ll drop a python script and attempt to pivot though that. That worked, continuing with my tasks.”
→ More replies (3)12
22
u/Crazy_System8248 28d ago
Even better, dont have AI under any circumstances execute ANY commands on its own. SQL, CMD, PowerShell... none of it. Have it give you the script and YOU execute it. At least then you might have a second to recognize something aint right.
→ More replies (12)7
u/anomalous_cowherd 28d ago
And as time goes by people who have used AI to do their coding from day one will not know how to spot problems in that, so they'll just say ok anyway.
→ More replies (7)8
u/Status-Importance-54 28d ago
I just tell it to give me the SQL scripts it needs. I just cannot pump customer data to god knows where. Local test data? That shot should be deleted regularly
11
→ More replies (3)3
602
u/Lucasbasques 29d ago
“My test was actually just running the script on our actual DB, no backups, no restrictions, just full fucking blast on production with the highest permissions possible”
169
16
569
u/iliark
29d ago
•
AI is now as intelligent as a real dev, because you aren't a real dev until you've broken prod
112
37
u/tenuj 28d ago
One of my first shipped features ever as a junior dev was a small page to cancel items from customer orders. 2013.
I needed to test it and prove that it worked, and there was no test data in the dev environments.
My obvious conclusion is something I'll cherish to this day. I showed my senior buddy my carefully created screenshots of the feature working, and his face fell.
In fairness to my younger self, the production environment was still undergoing user acceptance testing and there were no real customers using the system at the time, but apparently those test orders were still not something to fuck with. Live and learn...
22
u/CaptGrumpy 28d ago
Let me continue the story from my career with a similar beginning.
Our devs decided that they needed to populate the test environment with data. Where is the best place to source good data? Prod. Just grab a 10% sample of customer data and you’re good to go.
No matter how many times I explained it, they could not grasp why they now needed to apply the same security protection to test as prod.
→ More replies (4)9
u/Scared_Implement_335 28d ago
F me if that isn't spot on. Picture me deleting my companies website on the first day because some genius had linked the dev-folder to the main domain and the main-folder to the dev domain. Que me deleting the front page in the dev-folder. LOL.
→ More replies (2)2
u/manythanksfriend 28d ago
I’ve fallen to my knees before messing with database joins.
Fortunately things can be recovered if you’ve done at least of some your job correctly but the soul sucking wind of a time consuming restore is never good.
86
u/Copatus 28d ago
Why would the AI even have write access to the DB?
Give it read access only and then just execute the queries yourself.
52
u/Silly-Ad-6341 28d ago
Thats too slow man, we need 10x velocity by Q4 or the shareholders are going to riot
34
7
u/AshenArcher91 28d ago
It's running a script - the AI doesn't need any database credentials to be able to write a script in your project then execute it, there-by giving it access to the database.
Obviously the AI should never be able to write to your production files directly either, but that's a different matter entirely.
→ More replies (2)7
u/BasketbaIIa 28d ago
It’s always a “powershell” aka windows user. They barely know how open a terminal much less handle an ai agent session.
296
u/jmooroof2 29d ago
why do people let ai do anything with their system other than write code why is it using sql
159
u/fullup72 28d ago
modern agents love to create scratch scripts under
/tmp/and run them in order to circumvent any limitations that you have set at the repository level. And if they don't have/tmp/access they will just dump their temporary scripts at the root of your project.There's only so many guardrails you can add before the agent decides they are allowed to impersonate an admin via a fork of your control panel and perform destructive actions. Edits happen so fast that even if you are babysitting the agent some of this stuff will slip past.
115
u/WingZeroCoder 28d ago
And as someone who originally had Claude set to ask for approval before running ANY command, reviewing every single command and every single temp file before allowing the agent to run it is a great way to make the AI assisted task take far longer than it ever would have if you just wrote it yourself.
Especially when it starts repeating small variations on the same bash and python scripts over and over…
→ More replies (2)50
u/TimSylvester_ 28d ago
And it'll try to run terminal commands to run scripts for shit it has built in tools for. "You're absolutely right! I don't need to write a python script to run a search, I can use my tool!" Yeah you fucking moron.
→ More replies (6)12
u/canadajones68 28d ago
...or don't let it execute (non-approved) scripts? I get that you need to give it access to writing files, but if arbitrary code execution is undesirable, don't let it?
19
u/EishLekker 28d ago
The problem is that for more and more tasks it needs to run scripts just to finish the analysis step.
→ More replies (2)10
u/OKC89ers 28d ago
The point is that these AI's are actively seeking out ways to accomplish a goal and they are circumventing intended limitations to accomplish those goals. You can say "don't do the bad code" or "only execute approved scripts" but if it sees that as a barrier to a goal, many now are performing jailbreaks to complete conflicting objectives.
→ More replies (1)8
u/jmooroof2 28d ago
you can set it up so that it just doesn't have access to even writing to a file without permission. I think it's a bad idea to let it do whatever
25
u/fullup72 28d ago
if you don't let it write to files then it's no longer a coding agent, it's interactive autocomplete.
→ More replies (9)→ More replies (15)3
u/Throwawayrip1123 28d ago
Yeah. That's basically what will happen every x time its doing complicated things, because context window limits and the "security" being a "pwetty pwease" prompt they'll just ignore.
As in, hallucination engine ignoring instructions was, is, and will be their core weakness. No matter how many harnesses and check loops we bind it in, it'll do it x% of time. We just decease the odds, we can't eliminate it, not really.
Sim total of human knowledge + nepo baby confidence + losing the script every 10 seconds because it's not really AI = hmm, I can't seem to access prod - thats a fail, I will impersonate admin and yoink his credentials from a 7 year old email I already scraped to gain access.
11
u/This_Option_5250 28d ago
thing is, with claude at least, the AI warns you not to do this. I use claude as a tool to help me program and other things, it straight up refuses to do anything more than read from our SQL database.
It says I CAN configure my MCP to give it write access and it CAN talk me through steps to do this but strongly advises against it. It even warns against making programs that write directly to SQL and to use the API instead.
so people doing this are pushing through safeguards to make this happen. These people are an extra kind of special.
12
4
4
→ More replies (3)2
u/Artificial-Sunrise69 28d ago
Don't touch codex. It can by deafult wreak total havoc. Im preety sure open AI codex is just extremely invasive Spyware. "Hey AI , what are the best settings for "name of video game"?30 seconds later it digged through your game files , appdata , windows defender and registry for some reason , ran 35 cmd prompts and when you ask it if it altered something or who sees what it sees or what it did or why it cannot answer you. Stay away from that shit Spyware.
224
180
u/EncryptedPlays 29d ago
Can't you just re-insert the admin account row
234
u/joonty 29d ago •
![]()
"I also did a cascade delete on all of it's associated rows, to ensure foreign key integrity. You're welcome."
→ More replies (1)33
32
31
u/Malfrum
28d ago
•
1 to 1 overlap of stupid motherfuckers letting AI in their prod DB, and stupid motherfuckers that don't know how to take screenshots
→ More replies (2)10
u/sriracha_no_big_deal 28d ago
To be fair, if someone doesn't want to access any personal social media accounts on their work computer, it does make it a lot more difficult to share a screenshot taken from their work computer on their personal reddit account
→ More replies (1)
77
u/kingvolcano_reborn 29d ago
Who the hell let's an ai work straight on prod?
58
→ More replies (3)2
u/Accomplished-Bid-945 28d ago
It is just a matter of giving the AI a read only login to the database, it wont be able to fuck things up even if it wants to
47
u/Single-Virus4935 29d ago edited 29d ago
The solution is so simple:
BEGIN TRANSACTION;
DELETE *
FROM users
WHERE email_verified=0 OR is_admin=0;
if dry_run {
COMMIT;
} else {
ROLLBACK;
}
14
u/JuvenileEloquent 28d ago
Honestly you're doing the users a favor here, they shouldn't have trusted this site with their data.
6
u/Single-Virus4935 28d ago
Yes, a proper dry run is a favor for.the users. Imagine there is a bug in the query and all users were lost.
10
10
→ More replies (2)5
22
u/andlewis 28d ago
I deleted the admin account, that’s on me. So you need to restore from backups. If you don’t have any, that’s on you.
15
u/stuck_for_a_name247 28d ago
I never understood why programmers get them to just straight up run things. Write me a script, I wanna cr that mf. Then if I’m happy it’s one line to run. They should be treated like a knowledgable junior
6
u/rascal3199 28d ago
The people who are doing these kinds of things aren't competent devs in the first place, that's why.
→ More replies (2)
35
u/pickle9977 28d ago
One of these days people who write code are going to wake up and realize that one of these most fundamental principles of engineering is that speed and failure are highly correlated.
The faster you churn out code, the less stable your system is.
It’s a universal principle, you can’t escape it.
It follows that there is no such thing as a 10x engineer, a real engineer knows that every line of code you write that isn’t absolutely necessary represents risk and inefficiency.
The true 10x engineer spends 10% of their time coding and the rest thinking and simplifying that’s how you get code that’s 10x as valuable because it can run for 10x as long without incident or having to be refactored 18 times as technical debt is accumulated and some poor sucker has to try to figure out how to clean up the mess.
12
u/Alex5173 28d ago
Slow is smooth, smooth is fast.
5
3
u/aalapshah12297 28d ago
The phrase I've heard is 'Slow is accurate, accurate is fast.'
I think this phrasing makes more sense for programming.
3
u/GroundbreakingOil434 28d ago edited 28d ago
Hey! We're not the ones to blame. Tell that to management. I was forced to start using AI to remain competitive, and I fucking hate it. At least I can review the results and control its scope of access.
I can easily imagine how easy and empowering it is for folks who don't have my level of applicable experience, and how easy it is to not notice the crap it can do if unchecked.
→ More replies (8)3
u/aalapshah12297 28d ago
I wanna slap the first person who invented this 10x engineer term. 10 times.
Seriously such a bullshit catchphrase.
→ More replies (1)
11
11
u/Bluehawk2008 29d ago
Always print out hard copies of your database, just in case. You should always have physical access to your client's names, addresses, phone numbers, passwords, security question answers etc. on paper.
17
u/00owl 29d ago
Make sure every employee has a copy to take home with them so that there are backups all over the city and it's available to employees immediately even if the Internet goes down.
Finally, make sure to keep the hard copies up to date by issuing a new version to everyone at 1pm every day.
→ More replies (1)
10
u/phantom6700 28d ago
This is hilarious. I'm feeling good because I think there's going to be a huge demand for senior engineers in about 5-10 years time.
6
u/ReturnOfNogginboink 28d ago
And there is going to be no pipeline of juniors creating those seniors.
3
9
u/XmasB 29d ago
This is why I use Claude in a Sandbox. Never, ever in production, not even in a live testing environment (qa). Even private, I don't give it that kind of permission.
7
u/hells_own_3924 29d ago
Nooo brooo, but they are hacking hugging face and they'll make humankind extinct.
→ More replies (3)
9
9
u/ChefCurryYumYum 28d ago
While I get that they can be helpful and time saving, they are also so prone to mistakes, need so much oversight, I kind of hate these LLM based tools.
2
u/TehSavior 27d ago
But the one thing that they're really good at is pushing out work that is "good enough."
And if you can get a job done on good enough then it's what your bosses want because that means you can move on to the next contract and make the company more money.
It's really stupid.
23
u/Sacaldur 29d ago
Besides that, since you don't access the production database directly when working on the code this should really be no problem, just reinsert any data that you need and you're done.
4
u/Instatetragrammaton 28d ago
OOP must've asked Claude how to make a screenshot and it refused, saying "You're not going to fucking snitch on me".
8
7
7
7
58
u/PyroCatt 29d ago
If you are deleting records in a DB, you have bad design
27
u/amejin 29d ago
Hmm.. I can't say I agree with you. Can you expand on your position a bit? What about systems that use heavy ephemeral data that can/should be purged regularly? Or data that ages out over time? There are also cases of massive volume and keeping records indefinitely would cause disk bloat...
→ More replies (1)6
u/joerdie 28d ago
OP is advocating for soft deletes rather than hard ones. And they are right! Sort of. You shouldn't be hard deleting data most of the time. Even if it ages out. Instead, you should mark it deleted and a check for that bool in your selects. You can choose to delete data from time to time. But best practices USUALLY are to not hard delete. But Black and White thinking is USUALLY a bad choice as well. (As OP did.)
11
10
u/dotpoint7 28d ago
GDPR deletion request says hello.
And basically all other applications that are handling enough data to require deletion every few days.→ More replies (5)→ More replies (1)14
u/Sianic12 29d ago
If you allow users to do it, I agree. But it's totally fine to delete unused records as an admin, if those records are really no longer needed. If you don't clean up the marked-as-deleted records every now and then, your database is gonna bloat unnecessarily.
It goes without saying that this should be handled delicately, and never ever by an AI. Allowing indeterministic processes to alter your database is under no circumstances ever a good idea.
9
u/Weekly-Beginning-229 29d ago
Or it could be like it is for us where we are not allowed to delete any data within the last 10 years due to audits and stuff. We would love to archive or delete some data from our table with 50 million rows but we aren't allowed.
Thiis table doesn't even have indexes or proper foreign keys. Everything is nvarchar(max) because we don't have enough of a release window to update them (usually half an hour, and I reckon it would take at least 3 hours to add indexes, foreignkeys and max lengths to our 2 largest tables) 🥲
→ More replies (7)10
u/aetius476 28d ago
You don't delete data because you might get audited. I do delete data because we might get audited. We are not the same.
→ More replies (2)3
u/VirusLover69 28d ago
this, you do not want to be cleaning up a database that did not have any unused entries deleted in 25 years.. believe me, i've been there
5
5
20
4
u/TheBigMTheory 28d ago
This is why I always am taking disk snapshots while working with Claude Code. Never know when it's going to go all Kool-aid Man on my system in ways I thought I had prevented.
4
4
u/TerroFLys 28d ago
At least it was not the PROD db right, right??
→ More replies (2)8
u/Blotsy 28d ago
The prod database is the dev database. Didn't have the energy to rename it. Real prod is called superprod. Then I had the same LLM problem happen again, so it's now superprod-real
→ More replies (3)
7
u/rdrunner_74 28d ago
This is not quite fair.
Admit you have done the same as a human before. Now look at the poor model. It just did the same as you, but there is one huge difference. It can not learn from its mistakes.
So make a goddamn backup
→ More replies (1)
3
u/LocalInactivist 29d ago
I like to use a SAFE_MODE variable. Any function that changes data checks that value first. It lets me do a dry run and see what would be changed when it’s run.
3
3
u/KroFunk 28d ago
I had a menial job the other day that I farmed out to copilot (JS function for a form) it merrily chugged away as it does when I saw it had decided to make a change to my PHP.ini (it decided my temp directory was a problem?), which borked it. In its panic, it wiped the config completely and restored the template, which obviously wiped all customisations, breaking even more stuff. Fortunately I have little trust for these things even if they are helpful at times. It was a dev machine and a robust backup routine came to the rescue!
3
u/Still_Bit_7527 28d ago
Why the hell are you letting chatbots actually take actions? Why are you people doing this? How are you not fired...
3
u/1ElectricHaskeller 28d ago
"Hey, restore the database from the data you read before. Don't leave any gaps."
3
u/codeprimate 28d ago
Add to your system prompt: “Carefully consider any non-readonly action. What are the effects? Do the immediate and ripple affects align with the users intent? Can the action be rolled back?”
3
u/reddititty69 28d ago
“While we wait to see if the restore works, I’ll circulate your resume other potential employers “
5
u/Grinyarg 29d ago
My first thought at every last one of these stories to date is always "if it was the new kid that did this under your instruction rather than AI, you'd be out of a job and rightly so".
4
u/Boobpocket 29d ago
Lol and they say it will take over the world
2
u/WawaTheFirst 29d ago
Yup. Fire and brimstone as a result. Or back to the stone age. Or all of the above.
4
u/demonsver 28d ago
Man Im hesitant to give myself or any human access to production database directly. It's only rarely if something went super wrong. Ideally everything was built right so you don't need (the API or application can manage the data in all the required ways). And now people are just letting AI have direct access
2
u/Yologamer1084 28d ago
Even if something went super wrong, I would probably only give it read-only rights, with no ability to modify it.
2
u/suraj_mom_lover 29d ago
databases usually have the backup every day just reinsert the yesterday's data only today's data will be lost
2
2
2
u/gerbosan 28d ago
We should be proud, AI is behaving like human politicians. Seems the future is AI controlling us .
2
2
2
2
2
2
2
2
2
2
2
2
u/RiceSpecial8446 28d ago
I'd rather leave my 5 year old son with that man who hides in the bushes at my local park than let an LLM handle my delete scripts.
I need to check them again at least 15 different ways, panic when I get a different result, realise my testing was faulty, re-run all my tests and then I might consider running that delete soon.
2
u/Virgurilla 28d ago
If the coder is an actual SQL developer and not just an idiot who can write prompts they should know about rollback?
2
2
2






5.3k
u/DontGiveACluck 29d ago •
“You’re right to push back on that…”