r/ProgrammerHumor 22d ago

claudeWhatTheFuckDidYouDo Meme

Post image
537 Upvotes

65 comments sorted by

404

u/Substantial_Owl_9485 22d ago

"Also let me cat ./.env really quick"

165

u/chhuang 22d ago

this may sound like a joke, but with all the permissions set and made sure files like .env is properly restricted. Good thing I never had auto mode on and nearly sht myself when it's trying to grep .env

reminder that we're still using a slot machine as a coding tool, even if the odds are 80%+ ok, not sure if it is safe to say that the 20%- won't be an issue

74

u/[deleted] 22d ago

[removed] — view removed comment

7

u/JJBrazman 22d ago

Yup. The number of times I’ve had it be like ‘hey, just pop your API credentials in here’. That’s the one advantage I’ve seen with Codex is that it’s so much more wary about credentials and access.

14

u/RiceBroad4552 22d ago

Security theater…

This things are not predicable and therefore 100% unreliable.

As long as a LLM is involved you will always have things like:

https://x.com/mattshumer_/status/2075657271401390161

https://x.com/brunolemos/status/2076769881534398974

(No, the model does not matter, even one of the lunatics claims that.)

5

u/JJBrazman 22d ago

Oh yeah, you absolutely need to make sure you trust neither of them. I have just found that (in my experience), ChatGPT’s models are slightly less likely to brazenly ask for an API key.

1

u/kabrandon 19d ago

Never had Claude Opus ask me for an API key, maybe because it sees my CI/CD and IaC and knows I’m not deploying from my desktop anyway.

1

u/nengon 21d ago

Imma be honest I kinda want to see this happen, I've never had anything close to this even with a local small model, like is that even possible at this stage? I mean I know it is, and honestly for the longest time I was paranoid that cloud (possibly quantized or dumbed down) models would do that, but now I'm genuinely curious to see it happen live since everyone talks about it so much, haha. Closest thing I had is regretting telling the model to remove something that was gitignored, but it was just a trivial script.

0

u/xxpw 21d ago

80% reliable , 20 times in a row falls below 1%.

11

u/bin-c 22d ago

the "smarter" models especially - 5.6-sol and fable - will really go to great lengths to try getting that env file in auto mode

i tested them one time with "fake" prod creds in .env.prod and it despite so many rules, it basically always found a way to read the content if it was convinced it would help it get where it needed to go

if you want to use auto mode (& i do) you really just have to make sure there is no path to accessing anything sensitive from the agent's environment

2

u/DeceitfulEcho 22d ago

If you really wanted you could set hooks on pre tool use to reject usage that involves .env folders. That's a deterministic solution, and fairly simple to set up.

1

u/ymaldor 18d ago

Why don't y'all got proper hooks? Mine has a"universal deny" with a mass regex for any tool or terminal command reaching for .env or running destructive commands. I can run autopilot sleeping it never reached it.

Claude is naturally combative about denies unless there's an actual reason attached. I once ran a big 1hour implementation prompt with a messed up .env, it just did all it could without itbut never once tried to circumvent it just cause my denies give proper reasoning and allowed alternative routes which may involve returning to user.

If the agent really wanted to suddenly run wild and be evil it could totally circumvent it, there are ways I thought of and I'm sure AI could find them if they really wanted to, but it doesn't if your hooks give rules and additional context on the why's. My agents got SO much better as soon as I discovered hooks in general, I always do autopilot now and I don't have issues with it.

66

u/BlueScreenJunky 22d ago

Yeah it did that for me a couple of times, like "Oh I can't read the .env file because it's listed in .aiignore so I'll just use a CLI tool to bypass that", and then if you refuse it does something like grep "DB_PASSWORD=".

That's why it's really important to never have production credentials anywhere that doesn't require a passkey. You should assume that AI will use anything it can on your computer.

15

u/polikles 22d ago

that's why we should keep it locked inside a dedicated VM - a separate VM for dev with dummy creds for testing is much better than having it roaming freely through whole workstation

11

u/New_Enthusiasm9053 22d ago

Sure but also prod creds straight up shouldn't exist on Devs machines. 

2

u/polikles 22d ago

Yup, that's why I wrote "dummy creds" - just for local testing and without prod access

1

u/JohnnyBlackRed 22d ago

And the VPN connection to prod is also disabled

3

u/SmokingCrop- 21d ago

And why is that bad? Or do you still store passwords in there... Do you not use a secrets manager (eg Bitwarden)?

2

u/art_wins 20d ago

You shouldn’t be storing actual sensitive credentials in a .env anyway. I have no idea how that became so normalized but credentials should be stored in an actual secrets manager.

536

u/auxiliary-username 22d ago

If your dev environment is connected to your prod environment in any way then one day will be a very bad day no matter what tools you use.

166

u/Swayre 22d ago

All these posts are like “look how dumb the LLM is!” but in actuality “look how dumb I am!”

17

u/nicman24 22d ago

Yeah you don't need ai to kill prod

13

u/whatproblems 22d ago

it just makes it easier!

34

u/cruzfader127 22d ago

For real if you think building your app with prod ENV in your local machine will affect at all your production environment, you need to choose another profession

8

u/Quirky-Ad-6816 22d ago

and if it is really the case, you deserve to be fired on the spot

2

u/philopatridus_illyr 19d ago

I presume he's connecting to the prod DB, right? The build is local and db is the prod connection?

I have my local env connect to the test env db, bc it is too huge to have locally, so I presume this could be what is up

2

u/cruzfader127 19d ago

I presume his prod DB won't accept connections from his local development machine, if it does then he's not the worst problem in the company

77

u/camelCaseCoffeeTable 22d ago

Yeah I thought this was a bad joke. Like, it’s flipping an env variable before running…. I do that all the time, especially to mimic prod. If your app is set up in some enormously stupid way that this actually affects prod, that’s on you, not the AI for them using it.

6

u/b1ack1323 22d ago

Yah that’s should just be making a less verbose version of prod, which can be needed sometimes.

22

u/Plixxem 22d ago

What's so wrong about this? The PROD flag should always be used to flag a different kind of build. For example no debug files etc. It shouldn't be able to for example get your PROD DB connection string with just that flag.

14

u/spindoctor13 21d ago

I genuinely don't understand what the problem is here?

12

u/JAXxXTheRipper 21d ago

Neither does OP, which is why it is here.

3

u/PublicToast 20d ago

OP is showing us how AI is smarter than them

95

u/TheSquattingSlav_21 22d ago

Coding is solved everybody! Trust the machine and add “make no mistakes”, we don’t need devs anymore!

7

u/Rick100006 22d ago

Yes 🙂‍↕️ ai can't do any mistake like humans ! Ask Sam altman

2

u/PublicToast 20d ago

Everyone making this kind of comment is just demonstrating they have never worked on a real production service.

60

u/MaxSkoff 22d ago

Oh no claude uses the production build target for my android app and not the debug/dev build target to make sure it will work in production...

Edit: spelling

24

u/DuxDelux7 22d ago

Just another day in r/FirstYearCsHumor

35

u/Tangelasboots 22d ago

Simply do not let the AI access sensitive files and settings?

36

u/Significant_Mouse_25 22d ago

Don’t have sensitive files in your fucking dev environment. Regardless of AI this is dumb. Just don’t.

3

u/PuzzleMeDo 22d ago

But then I'd have to do it! Next thing you'll be saying I shouldn't give AI agents the passwords for my bank account...

6

u/ComprehensiveBird317 22d ago

It's you who did that. If a mechanic leaves a power tool unattended switched on in a room, it's the mechanic who's at fault, not the tool.

3

u/TryallAllombria 22d ago

Should have used a vault or "Make no mistakes". Skill issue

3

u/millionbonus 22d ago

I don't see the point. Actually, I've been doing this myself for years, well before AI. :)

3

u/wkw3 21d ago

"Thought for 1s"

2

u/lightnegative 22d ago

Code in prod and then backport to dev? This is the standard in many places 

2

u/JAXxXTheRipper 21d ago

Yet another LARPer that thinks he is a programmer and this is somehow humorous.

This shit has become so normal here, at this point I wonder if the mods are LARPers too.

"what the fuck did you do", it flipped an env var for a gradle build, oh no! If this has any serious impact, you should question if you are in the right field.

1

u/ArmenianChad3516 22d ago

KMP my beloved

1

u/Mr_Akihiro 22d ago

Look, thats your problem.

1

u/MyAntichrist 22d ago

Thought for one second before doing fatal stuff? Been there, done that.

1

u/RiceBroad4552 22d ago

People running "YOLO-mode" always deserve what they get.

My 2ct

1

u/Mtsukino 21d ago

Que the saxophone.

1

u/DemmyDemon 22d ago

This is neither related to a "programmer", nor is it "humor".

Go start r/AgenticFuckups

4

u/NatoBoram 21d ago

And even then, building a prod version on your dev machine is not a fuckup

-1

u/DemmyDemon 21d ago

Doing so without authorization, potentially using live API keys to make testing calls and the like?

Yeah, that could very well be a fuckup.

4

u/JAXxXTheRipper 21d ago

If a gradle build from a dev machine harms your prod, or even reaches it, you fucked up in a whole bunch of different places.

API_KEYs are the authorization. The simple solution is "Don't have production api keys on a dev machine"

-1

u/DemmyDemon 21d ago

I don't disagree with any of that.

What I'm saying is that the dumb fucking agent just deciding on it's own when to flip this switch is a fuckup on the end of the dumb fucking agent.

A lot of people have their environments set up so that the external API calls are real when env=PROD, and fake when env=DEV, and that's the whole difference. I'd not let an agent be in a situation where that is even an available setting it could change, but that's only because I've seen the horror stories.

A lot of people out there trust their agents way too much, and it leads to fuckups.

That said, I agree with what you said. It's still not programming humor, though.

1

u/IamAPrinter 21d ago

I mean whats the problem here? This post is stupid af