r/ClaudeCode • • 16d ago

Help/Question [ Removed by moderator ]

[removed] — view removed post

1.4k Upvotes

601 comments sorted by

•

u/AutoModerator 16d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2.1k

u/EC36339 Senior Developer 15d ago • Popcorn Bravo Heartwarming Mindblown

You gave the prod db password to a junior?

183

u/Dr4g0ss 15d ago

At my company, while I was interning for three months, they literally gave me access to their Stripe, Mercury, a finances google sheet, all that jazz. I was as flabbergasted as you may expect. I could see pretty much all their finances, revenue, and <insert all the other financial terminology here>

88

u/StayShmacked 15d ago

Same here, had access to revenue projections, Salesforce renewals, deals pipeline, etc. Went on for a summer and two semesters part-time, then when I came back the next summer and brought it up someone said “What you’re not on the trading blacklist⁉️” and put me on that immediately.

Turns out I should’ve been timing the market on inside info instead of working on my stupid intern project.

46

u/ajr901 15d ago edited 15d ago

Youth is wasted on the young.

That is the kind of wisdom you’ll take into your next gig where they make the same mistake. Get rich next time, buddy.

→ More replies (1)
→ More replies (1)

10

u/futon_potato 15d ago

Similar thing happened to me. They wanted me to build SSRS reports against their time tracking and billing data. I saw what I was being billed out at to some clients and quit to become an independent contractor about 6 months later.

8

u/nevemlaci2 15d ago

And I can't even have workflow access to the GitHub repo but get tickets about adding CI to GitHub Actions...

→ More replies (1)

271

u/Z_G_R 15d ago

Yeah first question ☠️

→ More replies (4)

160

u/AY-VE-PEA 15d ago

Have you ever worked in actual small business, it is not uncommon

129

u/No_Welder7908 15d ago

The front desk lady probably has root access somewhere for printing stuff just because it triggered an error without it.

16

u/PaulSpangle 15d ago

We just showed her how to use the debugger to skip the line that sometimes errorred. We never gave her the password though!

16

u/AY-VE-PEA 15d ago

For real

→ More replies (3)

21

u/dccorona 15d ago

It is unfortunately quite common but we should still react viscerally to it because it has to stop. The cost of cyberattacks is rocketing downwards, before long you will not be able to rely on being too small for attackers to care about targeting. 

12

u/SleepyComputeMachine 15d ago

Eh at this point putting your prod token in a Claude log is least of your worries. Its not like Claude couldn't just read it if it wanted.

→ More replies (2)
→ More replies (4)

11

u/946789987649 15d ago

Doesn't mean it should though. I am a founder and once we had real clients, this was completely locked down. I can't even get into our prod database without going through a separate workflow which includes MFA. The password is just one step, and it really isn't a huge effort to set these things up.

→ More replies (5)

4

u/dmurawsky 15d ago

Still doesn't mean it's good or correct.

→ More replies (1)

8

u/gmatebulshitbox 15d ago

Not a problem if you want to learn hard way.

→ More replies (1)
→ More replies (5)

16

u/baldycoot 15d ago

There are juniors?

15

u/burgonies 15d ago

He means engineers with 20 years experience, but only just started using Claude.

→ More replies (1)

10

u/Few-Divide1870 15d ago

The password isn't the real problem. The real problem is that a junior's laptop could reach prod at all. Give the agent a read-only role and a staging copy, and the paste becomes harmless.

8

u/therealkevinard 15d ago

I wouldn’t say “harmless”, but deff less harmful.

Developer machines are prime targets for exfiltration attacks these days. Secret values for privileged environments should never even exist on workstations.

They’re just one npm post-install hook or even vscode theme install away from being shipped to a c2 server.

→ More replies (2)

19

u/SnooPets2051 15d ago

Also db migrations is quite critical and shouldn’t be handled by juniors.

15

u/ticklemeozmo 15d ago

Uhh, yeah, that's why the Junior was having Claude do it. Duh.

→ More replies (1)

4

u/RiotBoppenheimer 15d ago

Extra question: why is there one db prod password?

If your database is in something like AWS (which I assume it is), why are you not using IAM authentication to access a database?

Why does anyone have read-write access to the database using credentials they can just grab, rather than needing to go out of their way to make a temporary break-glass set?

There are many process failures here.

3

u/willee_ 15d ago

My exact question.

At one of my jobs (billion $$ company), my first week, I got access to all 3 ERPs with admin in all of them as well as prod api keys/secrets.

4

u/Equivalent_Kiwi8960 15d ago

I also worked at a billion $$ company and my first week, I got access to the restricted customers, like national intelligence, undercover RCMP, government officials, celebrities. It was crazy to be able to search of Sydney Crosby's phone number, or pulling reports knowing the Prime Minister's phone number was in that excel sheet. Took them several years to revamp access and I eventually lost it at some point, I was the only person on my team with that access because I was testing pre-release software updates as a power user.

→ More replies (2)

3

u/hipsterdad_sf 15d ago

how else are they supposed to bring down everything?

2

u/_amanu 15d ago

You have a password that works from Dev machine? 

2

u/DevSkylex 14d ago

“Bu-bu-but startups…” yeah, startups do this shit until someone screws up, I can’t believe people will look at this and think it’s normal.

4

u/Jealous-Adeptness-16 15d ago • Popcorn

There’s nothing wrong with that. All big companies have secret management tools. If they are working on that db, they should have access to its secrets in the secret manager. Otherwise, they’ll have a harder time doing the migration. We dont have to treat juniors like idiots.

4

u/rco8786 15d ago

Not a chance. Every big co I’ve ever worked at has strict controls over who has access to what databases and even getting your hands on an actual password is difficult to impossible. It’s all managed authentication. 

→ More replies (8)

5

u/Amazing-Mirror-3076 14d ago

Your migrations should be fully automated and tested before being applied to prod. You shouldn't be doing anything manual on prod.

→ More replies (5)
→ More replies (29)

364

u/bkrsh099 15d ago • Bravo

I won’t go into bad idea or not, but I’ve mentored people for a decade now in IT, and this is the type of junior I’d carry on with me… because he was honest, probably learned with his mistake and will take time to shit on the same bed again, and moreover, you’ve also taught him how to do the same thing he did wrong, in a secure way, and if he gets that part and takes that to heart, that’s the winning side of this story.

65

u/dccorona 15d ago

“Put the password in 1Password and let Claude have that instead” is not really a more secure way. The concerning result here is as much “Claude has access to prod” as it is “password is in a transcript on your laptop”. 

19

u/zyygh 15d ago

The underlying, way bigger issue is that the password is freely traveling in the first place.

A junior just opening some file and copying the password into a different file is completely normal human behavior, coming from a place of naive ignorance. A ton of security measures exist purely to protect the company form such mistakes.

I understand the comments saying that these situations are common practice in small businesses, but that does mean that you accept that any human mistake can cause a major issue or breach. If that's the case, then Claude knowing your password doesn't really create a problem that wasn't already there.

→ More replies (2)

5

u/miltonthecat 14d ago edited 14d ago

1password has some new beta features where I believe it can inject secrets into Claude code tool calls without them passing into the transcript. I’ve started using this as a way to purge my laptop of any secrets lingering around in env files. Also works nicely with the Claude desktop config file for local mcp servers with their own tokens in Auth headers.

https://www.1password.dev/environments/claude-plugin

The prod thing is its own issue.

→ More replies (2)

9

u/biacz 15d ago

Great Points. Also would force me to double-check my key rotation process 😅

7

u/red_nick 15d ago

Did you just not read it at all? The junior was dismissive of the fact that this is an issue

5

u/JadedDesk 15d ago

Or the junior was inadequately aware of why this is an issue.

OP - I half agree with the Junior on whats the harm of sharing the password with Anthropic. I frequently do this with unimportant secrets (discord notifications, or anything without a billable activity on the end) on my projects. That said, a Prod DB on an Enterprise system is different.

As an exercise, you could have the Junior ask a fresh Claude agent on their machine whether it can find any historical secrets and passwords within previous session transcripts, then if (when) it does, have Claude explain some of the unprompted things that could happen if Claude, or another agent, read this during future conversations. Not malicious things, but situations in which Claude could decide to take a peek at the Prod DB.

Also have Claude analyse how difficult it would be for a hacker to find this within the scratchpads and transcripts.

We're great at using Claude for development and other innovative ideas, but sometimes we forget Claude itself is also a great teacher sometimes.

59

u/rubenknol 15d ago

it will sit inside the transcript and the transcript is accessible to org admins when doing a data dump, so you need to rotate the credential when this happens

in our org this happens from time to time as well, and we have a skill + context layer rule that informs me when ever someone dropped a production credential into transcript, as well as mechanisms available for if people do want to use production credentials with their agent without taking them into transcript

15

u/gqgk 15d ago

This is the most sane answer here. Yes, you shouldn’t give your agent creds directly. Yes, there are valid cases for agents to use credentials. There are engineering solutions that can be built to prevent people from shouting themselves in the foot.

3

u/Maxion 15d ago

And also, it really shouldn't be that big of a deal. You should have in-place (tested) procedures for rotating secrets and that rotation should happen regardless periodically as secrets can still leak through various means.

→ More replies (2)

422

u/srggrch 15d ago

Sending secrets to AI agent is bad, giving it direct access to production DB is worse

82

u/dbbk 15d ago

Why are you giving the junior developer direct access to production DB in the first place? This is not an AI problem.

→ More replies (6)

22

u/No_Welder7908 15d ago

"You are right, I should have asked you before committing that whole schema alteration you were merely asking about." How many times?

6

u/PhilbertNoyce 15d ago

My claude harness freaks the fuck out if you give it access to plaintext credentials and then lectures you at length about why that is a no-no. One of the first skills I built for it.

13

u/Odd_Painter_3666 15d ago

Strong disagree. We have tightened up our prod DB access requirements so much by using Claude and some thoughtfully designed skills (which enforce various checks and provide rollback capabilities).

25

u/dccorona 15d ago

You can have Claude make improvements to prod infrastructure without giving it direct access to that infrastructure. 

→ More replies (5)

6

u/Veriosity 15d ago

Ok so you've had Claude help you protect prod from yourselves, but completely opted out of protecting prod from Claude.

→ More replies (2)
→ More replies (5)

9

u/_wewf_ 15d ago

But its claude.

And I don't touch anything else

31

u/Radiant_Persimmon701 15d ago • Popcorn

Why does that matter.

Claude normally warns and goes to great lengths to ensure you never to give it the secrets

5

u/Significant-Bee5101 15d ago

it really fucking DOES. Like it will sit there and refuse it even if I have a VM set up just for testing with a bullshit password. "I'm still not going to do that"

Bitch??

It's not even a thing with CVP. It's just how the model is tuned.

OpenAI on the other hand. Give that mfer a password and it'll rip shit apart.

→ More replies (1)
→ More replies (2)

66

u/fernandojm 15d ago

Don’t underestimate the security implications of having plain text passwords hanging around in places unnecessarily.

15

u/coordinatedflight 15d ago

I work at a company that solves this problem, and it happens way more than you think at bigger companies than you think

5

u/The-Wizard-of-AWS 15d ago

I don’t think people realize that this password is now in session logs that are stored in plain text.

24

u/kanine69 15d ago

It can be obfuscated in the local transcript (just ask Claude) but its been posted to Anthropics cloud. So rotate it.

I handle this by giving helper scripts to the agent, so it never needs to go looking for credentials, and generally if you tell it this is production it gets very antsy about touching the DB, for actual inspections, changes etc I get it to write the SQLs that I run and paste the results, or set up a mirror which is a better process.

91

u/cyb3rheater 15d ago

"I could also see him thinking this is old guy paranoia.". Someone from your cybersecurity team needs to have a word with him.

15

u/CrashandCern 15d ago

Based on a junior having direct prod access and troubleshooting directly in the production DB, I’m assuming/hoping this is a small enough company to not have a cybersecurity “team”.

21

u/LunkWillNot 15d ago

Of the five cases I witnessed getting fired for egregious behavior over the course of my career, three were related to being loose with secrets like passwords like in this case, and the other two also had a strong security angle.

7

u/Maxion 15d ago

Companies have very different cultures. F500 or F50 incredibly strict, startups store shit on post-it notes and ran prod from a semi-broken laptop in the lunch room. I've seen it all :D

→ More replies (1)

3

u/Last-Chemical-1592 15d ago

If they have cybersecurity team they should all be fired. No one should have prod db password not even seniors

→ More replies (4)

109

u/erratic-character 15d ago

I honestly think AI is making tech professionals - the very people who should know better, and have no excuse - lose their minds.

42

u/codechino 15d ago

I’ve seen plenty of junior (and some senior) engineers accidentally wipe out prod databases entirely on their own over the last 20 years.

17

u/Immaculate5321 15d ago

It’s a rite of passage and if you give the junior the ability to do it, it’s not ONLY on them

→ More replies (2)

4

u/One_Day_304 15d ago

Honestly even in small company. No one should have the ability to such things without being reviewed but one more engineer

→ More replies (4)

37

u/_wewf_ 15d ago

Tech professionals have not known better for decades and we call it learning

5

u/adulion 15d ago

I’m spending most of my week patching vulnerabilities and it’s only getting worse

4

u/the_younglings2 15d ago

Claude genuinely catches things I'd never think of and things I've never been trained on. It is a net win for me. The hardest part is simply that it can generate so much material in a short time and I can't easily review it all. In 20 minutes it can fill in the rest of my day with reviewing the output.

12

u/tedfa 15d ago

Pretty sure this is a bot account for infisical

2

u/No-Captain2150 15d ago

The things people blindly reply to without any scrutiny often surprise me.

→ More replies (1)
→ More replies (1)

10

u/Amazing-Mirror-3076 14d ago

Why does a junior have the prod db password?

→ More replies (3)

17

u/pixxelkick 15d ago

  He copied the connection string from the prod env, 

Why the fuck did a junior dev even have access to this secret?

Prod access should be limited to only top level team members, but ideally even not them.

Instead prod secrets ideally are managed by IT as they allocate stuff.

At most, team members should just have access to logging/telemetry from prod to investigate issues.

7

u/_Swish-41_ 15d ago

Production env can mean many things. I work in the automation software industry for warehousing. Very common for everyone to know how to connect to the prod database, especially for small warehouses.

I’m sure I’ll get roasted for this because it’s Reddit, but it’s true and people are trusted.

5

u/Stunning_Ride_220 15d ago

Well, it's you guys being just a 'whoopsie' away from ground zero

→ More replies (6)
→ More replies (5)

2

u/Hardwired_lavamantis 15d ago

It's shocking how many companies don't practice basic security best practices. Those companies likely won't be around in 6 months.

→ More replies (1)

13

u/sjltwo-v10 15d ago

Forget Claude. The junior as a human shouldn’t get access to secrets let alone production DB ones. I really hope it’s a read replica. 

22

u/Annh1234 15d ago

Not sure I would let the agent run stuff on production database.... Next thing you know it will drop tables, or add some index on a 5tb table what will take 12 hours to replicate and bring your site down.

7

u/quantum1eeps 15d ago

Read only in prod with short lived credentials is a very smart thing — if those credentials don’t get rotated or aren’t minted on the spot, that could eventually be a problem and if it’s not read only, you have to accept the consequences if things go awry. You can make it clear to an advanced model like Claude Opus 5.5 what its limitations are and ground rules (take snapshots) of what it can do on that db but you have to just accept what happens

4

u/zwermp 15d ago

We do read-only creds that live in doppler so the LLM never sees it. Troubleshooting has never been easier.

→ More replies (1)

10

u/KrydanX 15d ago

Meh. I trust AI more than juniors these days. At least AI is doing backups (mostly unasked) of everything in case something goes bad

7

u/Annh1234 15d ago

Well, you should not give junior live db credentials either..

→ More replies (2)
→ More replies (1)

4

u/cosmicvelvets 15d ago

Little Bobby strikes again

4

u/aradil 15d ago

You know, I have a side project with a sqlite database that I’ve given Claude free reign on, but I take a snapshot literally before and after anytime I ask it to do anything.

I’ve had to grab some rows from backups on maybe 4 occasions and it was never due to something stupid and catastrophic Claude has done directly.

It’s always been some code mangling some record of a type it wasn’t aware of at the time the code was written and tested. Which honestly is also the type of problem humans make often as well; it’s just that Claude can do 10x more shit so it can break stuff 10x faster, and shit is 10x more fucked before you realize it.

But it’s also 10x easier to fix, so 🤷 this is life now

But Claude never touches my prod db, and passwords are not kept anywhere it can see.

3

u/razorree 15d ago

just create read only user for AI or use MCP with read only rights.

→ More replies (2)
→ More replies (3)

12

u/flatfisher 15d ago

Having a production database hanging around, available to any developer let alone a junior is insane. Now was only a leak to Claude, but it’s a disaster waiting to happen. Also that means you can hit the prod database from any developer station? In my org if you were the lead you’ll be shown the door.

4

u/Late-Replacement-481 15d ago

This. You know how you don’t have data breaches and agents deleting prod? By engineering your workflow and systems to minimize that possibility… not by just getting lucky

2

u/Maxion 15d ago

Those type of policies are needed in large orgs, but in small ones does not really work or help much.

3

u/MMOSimca 15d ago

This. I work for a small company that has dozens of sites. When I moved here from a big company, I wanted to bring all of the security baggage with me as is - 2 person approvals, no remote access, all infrastructure as code in repositories without ever making manual changes, etc.

I still believe in those things, but they do not have as much value when there's a tiny handful of people working around the globe at different times and levels of employment on legacy systems which are much more likely to be vulnerable because they were running old software than because somebody got phished. A modern, full force security stance for internal access would be a noose around the productivity of this tiny group of people.

I have still pushed for improvements. I have closed external SSH access in favor of using AWS SSM start-session and taught people how to use it. But it's tricky to do much more because we're actually behind on real measurable security updates, and asking people to go slower to adjust to entirely new processes (or trying to put all the infrastructure into code from nothing) isn't reasonable.

→ More replies (1)

18

u/redblack_tree 15d ago

It was bad a decade ago, today it's a very bad idea.

Regardless of the "junior having Prod DB connection" which is absurd on itself. In a bigger shop, no developer should have Prod access. When is absolutely required, a temporary read only key is generated.

Let me give you a real world example. One of our senior developer installed the wrong library. He was trying to solve a nasty CI pipeline problem and used a "spiked" library. As it happens, the malware baked in on that innocent library triggered multiple alarms and got caught early. We had to rotate passwords, key vault access, access tokens and his VM was scrapped and recommissioned.

No one is immune to mistakes, one of the easiest ways to protect the team is to control who has access to critical information.

2

u/Late-Replacement-481 15d ago

Man, who are these companies that don’t have secret rotation automated? Doppler teams will do it for you with a single click, bam, problem solved.

3

u/No_Analysis91 15d ago

Company’s with 4 it people and 500 factory workers. Not everyone is a pajama coder.

→ More replies (3)

5

u/naxhh 15d ago

you did the right thing. You should prepare to claude randomly deciding to drop a table at some point...

the password is now in a server that you don't own waiting to be hacked by someone at some point so.. yeah.. is not great. Is like saying why it matters to commit passwords in git if the server is private...

so you know... maybe just give it RO access and depends on the data you are storing not even that?

2

u/Dubwize 15d ago

You should prepare to claude randomly deciding to drop a table at some point...

This sounds like a promising approach to optimizing this slow query: it's worth a try!

5

u/Strange-Grass6025 15d ago

I'm completely with you on this. Though I'm also with others in the sense that they probably shouldn't have had the production password in the first place. I've worked for companies in the past where I've begged them NOT to give me production passwords, even when working as a manager. I know to much, I do too much in other environments, I'm far too likely to do something wrong, accidentally - Claude, on the other hand, is *guaranteed* to do somethings stupid. Give it logs, give it a mirror or a disposable backup or snapshot - but never ever direct access to production, especially when it has the 'developer' setup and rights, so I wouldn't even inject it.

And yep - as soon as the password is compromised (accessed by *anything* that shouldn't have it - even something you otherwise trust), rotate it. Immediately.

4

u/Appropriate-Draft-91 15d ago edited 15d ago

There has to be a line somewhere. Not having line means the de facto line will move, continuously, away from security.

Having a line allows you to observe and correct when it's overstepped, and having a line that seems overly cautious turns oversteps something that can still be corrected and not a catastrophic company ending event. If the line adds near-zero safety and a lot of inconvenience, the line is usually too far on the cautious side, which incentivizes people to work around it.

"We just paste the passwords into other companies' chat interfaces" might be a line, but not one I'd be comfortable with.

4

u/davidemo89 15d ago

How is your Claude code let you past passwords inside chat? Mine gets crazy mad with me even if I just past some test environment password and reduses to do anything else in that chat till I delete the chat...

4

u/ClemensLode Senior Developer 15d ago

It's the best thing that could have happened to your project in weeks. Now you have tested your password rotation process, your communication process, and have plenty of material how to improve your CI process. Your prod password should not be exposed, even for debugging or migration. Build a proper staging system. That a junior developer had access to prod means he could have also accidentally deleted all your data permanently.

4

u/taotau 15d ago

Why does a junior under your supervision have access to the prod password ?

6

u/ishandeva 15d ago

Things you're right about:

  • Not giving secrets to agent.
  • Rotating the password immediately.

Things you should be more concerned about:

  • Giving a Junior prod db access.
  • Giving the Junior's agent prod db access.

3

u/elite-data 15d ago

Giving a junior a connection string to the prod database, what a brilliant idea. Especially considering he was working on a migration, meaning those credentials had schema write permissions at the very least.

You should be thanking him for using Claude, which undoubtedly did a better job than the junior himself would have. He could just as easily have dropped a table or two while debugging the migration.

The questions here aren't for him anymore. They're for you.

3

u/vespassassina 15d ago

it's not Claude (or the junior) fault if you have bad development practices.

3

u/framauro13 15d ago

I work in health care so this would likely be a fireable offense, especially if any PII or patient data was sent to a third party. I'd also come down hard on the person who granted them prod DB access.

Even if its your corporate account, that information was sent over the wire to a third party. So it's not just where the data lives now, but what did it pass through to get to Anthropic and back.

Sounds like your whole org needs some security training because there's a couple problems: 1. the junior made a decision to do this and 2. they had access to a system they likely shouldn't have.

3

u/bfume 15d ago

Junior dev, hell, NO DEV should have “the production password”.

Fuck, a single production password shouldn’t exist. 

Claude and the junior dev is BY FAR not your problem here, sir. 

3

u/NotGoodSoftwareMaker 15d ago

I am pretty strict

No-one except select few should have access to that stuff anyway

Juniors have always been fairly naive with these things, so my approach is to rather ask

“Why do you let juniors have prod access again?”

3

u/East-Acanthaceae-879 15d ago

Why do the databases you use in real environments have passwords? Why do SWE have access to them at all? Why do you even have network connectivity to your production environment?

3

u/Last-Chemical-1592 15d ago

The fact that you or junior have access to prod db (clearly you are not the person to be trusted with it) is the problem. Claude getting password pasted inside it is problem on top of a much bigger problem.

3

u/markera_ 15d ago

Very strict, and I would treat this as a systems failure first and a junior mistake second.

Rotate that password immediately. Once it is in a prompt it is no longer a secret you control. Assume it is in logs, in a transcript, and on a laptop that can be lost or compromised.

The fix is not to tell people to be more careful. It is to make the careless path impossible. No human should have a shared prod password to paste anywhere. Use short lived credentials with a read only role for debugging, and keep prod access behind a bastion or a break glass flow that logs who used it and when.

That is the pattern I settled on after years of debugging prod from logs. I worked as a staff engineer at Meta, and I built a log observability tool because I kept seeing the same failure. People gave an agent full access because that was the fastest way to get an answer. The safer way is to give it read only access to the logs and the schema, and no write access to the database. I dogfooded a read only MCP server for logs, and that is what I would give Claude instead of a password. I diagnosed a pool exhaustion incident that way, from connection counts and slow queries in the logs, without touching prod data.

So yes, be strict about the password. Then remove the need for anyone to have it.

5

u/bloudraak Developer 15d ago

I work in regulated industries. This would be a security incident, followed by locking down production access, and the developer be given a “notice” by HR. At a minimum, their production access will be suspended for some time.

Mistakes happen, but some mistakes can impact the viability of the company. So yeah, this is serious. But it’s also an opportunity.

Access to regulated data is generally prohibited for anyone, including operations, developers, let alone agents. That includes any information about individuals, even when you’re not in a regulated industry. It’s covered under various privacy laws. It’s unethical to access personal data without a need-to-know. There’s regulations about accessing bulk data of individuals. And when you permit it, make sure everything is audited.

This is too much work, so you can engineer your way out of it.

To allow agents and people to access production data, use an intermediary, like an MCP server which contains controls or a website. Mask all sensitive data, and audit when it’s viewed. Split transactional data from regulated data, and use surrogate identifiers. This split allows more folks to diagnose problems in production without ever seeing any persons information or other regulated data. Instead of Jane Doe, everyone sees 763579.

It’s really advantageous to have agents analyse data, schemas, and performance in production, you just have to engineer the system to permit it.

But in environments where I work, the team will still be in a lot of hurt after that “incident” not just because of credentials but because of laws governing the data in the databases.

2

u/Opening_Pop8755 15d ago

I'm a backend engineer for a company in a pretty regulated industry, and my company uses querydesk for all of the use cases above. We already used it before AI was so widespread, but now I feel like it's a no brainer

→ More replies (1)
→ More replies (1)

4

u/fogeyman 15d ago

In the comments, I’m not seeing a direct answer to why it’s bad to have production credentials on your local machine, especially persisted. The lesson your junior engineer needs to learn is that the risk is mostly in the scenario where your computer gets compromised. Social engineering is how many hacks work: they trick an employee into downloading something they shouldn’t which compromises their computer.

And if the computer has production credentials, the hackers now have the keys to the kingdom.

A key step* in how Binance lost $6bln in crypto was an engineer taking an interview with a fake company, running some code from that company on their computer, and that gave attackers a vector in to further systems.

*This hack was super complicated and had a lot of steps, but a compromised computer was at the heart of it. https://en.wikipedia.org/wiki/2026_Binance_hack

2

u/Dimencia 15d ago

If your account is compromised, that's the same account that has access to retrieve the credentials. They don't have to be on the local machine for an attacker to get them

→ More replies (4)

2

u/Latter-Tangerine-951 Senior Developer 15d ago

I would trust claude more than the junior.

But it's obviously a major failing of governance and process that this happened.

2

u/wasgonon 15d ago

I did something similar in a startup I used to work at 3 years ago. Me and my manager got fired for it.

not allegedly because the startup’s revenue crashed significantly due to bad business decisions, but we were let go first so that they save cash :(

I’ve started taking corporate data security seriously since.

2

u/idontuseuber 15d ago

Nothing. Business plan especially. I do not say it’s good to do, but it’s not death scenario. Obviously it depends on business.

The copilot, Claude business plans stakes reputation on those plans.

Obviously if database access is not exposed directly (which should be in normal world) I do not think it’s too much of a worry.

I would also implement in such cases guardrails of masking “credentials” for pre-execution.

2

u/Think_Network2431 15d ago

As soon as you install Claude Code on your PC, I don't see how you can realistically enforce any password policies. Even if you provide it with a dedicated environment, it will search everywhere. So I think that long before it copied the password into the chat, Claude Code had already had access to it for quite some time, whether through a little .txt file on your desktop or simply by looking at your screen.

So, it's all well and good to play the frustrated security expert, but maybe you should start by blocking AI applications from accessing your environment in the first place.

2

u/Geekfest 15d ago

It's an easy trap to fall in to.

You think, "I could spend an hour looking over this system to find out the problem, or I could let claude do it in 5 minutes".

Except, process wise, you should tell yourself to rule out that kind of direct access as a viable option.

So then it becomes, "how long would it take me to set up the tooling to give claude read-only access to this system?" then add that to the 5 minutes it might take claude to fix the problem.

It might, hopefully, turn into, "I spent 2 hours setting up an MCP server with strict read-only access, but now I can ask claude all kinds of questions about my system without worrying that it will make a mistake and wipe everything out AND my co-workers will also benefit from the time spent on this".

2

u/ScaredyCatUK 15d ago

Three questions:

  1. Why is it an issue to change it?
  2. Does Claude have access to prod?
  3. Is Prod exposed t'Internet?

2

u/dccorona 15d ago

I think you weren’t harsh enough, but it goes beyond just that person. You should now be reassessing your entire setup. I fear you haven’t taught or learned the right lesson. Swapping “paste the prod credentials into chat” for “let Claude access the prod credentials via a password manager” is very minimally different. In fact, one could argue it’s worse because now the prod password is available via a command rather than via explicit confirmed intent, and it’s a prompt injection target or even just usable via good old misunderstanding (AI never does that right?) 

Whatever you’re doing that requires AI to touch prod needs to change. Prod passwords need to get out of the hands of developers entirely. There’s no shortage of ways to do this and keep scoped down, only when necessary prod access (which you also should endeavor to minimize over time, but one step at a time). 

In other words, you should have reacted strongly, but you should have directed that reaction at yourself (or whoever owns these security practices in the first place). 

2

u/SlayerOfDemons666 15d ago

This has to be satire. Who gives prod credentials to fucking juniors?

→ More replies (2)

2

u/TenerifeInFoCo 15d ago

Over reacting or reacting is not good.
Nothing is so important to worry. One say we all die.

Of course, they should not be putting passwords in Claude but be under no illusion that using Claude is a tradeoff between IP and sensitive information that you give up (regardless of the no training etc”) when using it

2

u/DjFrosthaze 15d ago

In this case, I would argue that it would be better if he had a staging database that he could play around with. If you really need to debug stuff in the prod database, He should have had a dedicated read-only account for that, but I assume it would not have been enough in this scenario?

2

u/PilotLost404 15d ago

Company account doesn't change it. The password now sits in a transcript on his laptop and in whatever he pastes next, so rotating was right. The better fix is keeping secrets out of the agent's reach instead of making a rule. Inject them into the environment the command runs in and strip credentials from the env the agent itself sees. It can run the migration without ever holding the password, so there's nothing to paste.

2

u/LysanderStorm 15d ago

Question aside why a junior (or anyone that does not strictly need to for all that matters, SOC2 and ISO27001 and so ...) has access to prod, even senior technical people in our team don't let an agent (or anyone) run things against prod. At most with some read-only account, and rarely.

So no, you don't overreact. Not because anything will or would happen, but because there are some things where you have to draw a line if you're running a (serious) business.

2

u/PodBoss7 15d ago edited 15d ago

Not a good idea. No model training doesn’t equal no risk.

Create a read-only account to use for troubleshooting purposes. Use command line SQL or MCP and authenticate to the database outside of Claude with the read-only account. Review the output of each statement Claude proposes to run.

This mitigates the risk and helps train the Junior on the thought process to solve the problem.

2

u/besugh 15d ago

Even if you protect the password somehow, letting unauthorized access to production data Is a severe privacy break. Letting a developer or an agent access to production data can result in multi million fines in most european countries

2

u/Options_100 15d ago

He is wrong. Its 100% bad practice to do this, regardless of ZDR / training.

2

u/Maude_ville 15d ago

I'm in front end and even I know to keep it as a hashed credential on my computer that the agent can call.

2

u/0xSnib 15d ago

This post is an ad for some dogshit thing called Infisical

2

u/bobdvb 15d ago

This post is spam, if you search their username they're posting about their security product that's mentioned in the post.

2

u/smartcave 15d ago

I think it's more likely you underreacted than overreacted, but realistically it depends on the business and the scope of critical business activity supported by that database. There are possible answers to those unknowns that would indicate that the only responsible action would have been to fire both of you.

2

u/iscottjs 15d ago

Small company CTO here. This is absolutely fucked. What the fuck are we doing?! 

If this was me, I’d be firm on the junior and use it as a learning opportunity, I would hope that he understands the seriousness of the situation and learns from it.

But I would be wanting to speak to whoever the fuck setup that database and how a junior managed to get access to the prod credentials that allowed him direct access to prod.

Is it not locked down? Why couldn’t he connect to a seeded dev server instead? Or an anonymised prod replica? Or just anything else. 

But to be fair, I also appreciate in this crazed AI world everyone wants you to just “get Claude to to it”, so I’m willing to bet the junior and his team was under pressure so this is going to be a risk. 

I’d also want to speak to someone in leadership to let them know that their obsession with speed is putting company data at risk, then ask the CTO to get his shit together. 

→ More replies (1)

2

u/jyling 15d ago

Rotate, also why are junior getting prod keys, is it at least ready only ?

2

u/Eldorian 14d ago

You don’t have an AI issue, you have a process issue where a junior developer (and I’m assuming literally anyone else there or elsewhere) has direct access to your production database.

Sure, use it as a learning moment for your junior but you need to look just as much at yourself and the way your shop is running things as well.

2

u/Semisemitic 14d ago

A junior developer should not normally hold “the” production db password to begin with.

In any case you need to recycle it now.

2

u/Abadabadon 14d ago

Is this a real scenario? No, you should not be sending sensitive data to any Ai agent ever

2

u/Not-a-bot-6702 14d ago

The fact (it seems) like there’s no sandbox and a jr is working against prod is a bigger risk to me than that key somehow escaping chat

2

u/l_m_b Senior Developer 14d ago

You rotate the password. Transcripts do leak, and for something like Fable, ZDR isn't available.

If Claude got access to the live data, you may or may not have a data privacy breach you need to communicate to your customers and possibly the regulators.

2

u/Intelligent-Net1034 14d ago

change every passwort ASAP, it goes into trainings data and get leaked in some months

"It's a business plan, it's not training on it."

they train 100% on it, what do you think lol

beside that, use them as you should use them, never in production, thats insane.. just let an agent spin up a test environment from a backup and work with that.

I don't know why people think its okay, NEVER LET AN AI AGENT WORK ON ANY PROD SERVER, ENVIRONMENT or ANYTHING that is your buisness, thats basicly give a hacker access to your MONEY MAKER.

2

u/quantum-elle 14d ago

You definitely should rotate it, as you did, for the reasons you mentioned. Claude should even (almost to the point of being annoying) pester you to do so.

One piece of malware scanning CC logs for anything that looks credential like and it’s gone.

2

u/R00t_Cause 14d ago

Passwords? We're looking into phasing those out. They don't seem to do much anymore.

2

u/Jumphrey1670 13d ago

Least privilege is terrified of this one simple trick

2

u/Simengie 13d ago

Fired. Walk out building. Team resets all passwords regardless if he had them or not. Consider possible legal action if information is accessed by unauthorized third parties. Report the incident all the way to the top.

2

u/z0phi3l 13d ago

That's a fireable offense at my last employer

3

u/lucidmodules 14d ago

It's either a clickbait post or you need to fix how you manage access to production systems on the organization level.

2

u/shayanx45 15d ago

Where are these kind of juniors getting hired??

1

u/tonyfith 15d ago

Give the junior a promotion and fire the person who gave juniors access to production.

1

u/pwn2own23 15d ago

I would have a serious talk with the seniors and ask them what they are doing as profession.

1

u/Old_Flounder_8640 15d ago edited 15d ago

Try nvidia/openshell, so the Chinese spies can't get your secrets

1

u/Mammoth_Molasses_927 15d ago

Juniors will junior.

Mistake is on you for giving them prod secrets.

Prob bait post?

1

u/robo555 15d ago

Sending password in plain text is bad practice, that's it. If you're fatigue you may do it elsewhere. Have a simple system in place so it can done without exposing the password.

1

u/iVirusYx 15d ago

In Enterprise language this would qualify as security incident.

As a manager you’d be forced to report and escalate it with potential repercussions for the employee if they violated policy.

1

u/YesToWhatsNext 15d ago

At my company (finance) it’s a fireable offense.

1

u/bhattbhuwan13 15d ago

Credentials/Secrets should be a strict no. Maybe you can have a one page document that your juniors can read during the onboarding so that they don't do such acts in the future. Also, Never store them in the env files instead use password manager/secret manager from services like AWS that way even if claude tries to find the secrets in .env files, you are safe.

1

u/SnackerSnick 15d ago

A) don't give your prod password to Claude
B) how is it that in 2026 we're still using passwords to access production databases instead of temporary, targeted authentication tokens?

1

u/Reasonable-Idea7064 15d ago

Ich würd nicht zu streng sein. Er hat bescheid gegeben und gelernt

1

u/2736287 15d ago
  1. I hope you gave him an enterprise account.
  2. The team should have pipelines where Claude Code can operate in a safe environment. One of the first things you should teach everyone on the team is how to use those pipelines.
    We need to accept that everyone will be using CC nowadays. The question is whether they are going to use it in a good way or a bad way.

1

u/agustusmanningcocke 15d ago

Why the hell does the junior have prod accesses at all?

1

u/what_did_you_forget 15d ago

Then what is the safe way to do it?

1

u/ex_gatito 15d ago

At this point just him run Claude Code on a server and fix bugs there.

1

u/phantomeye 15d ago

i dont work with databases and security, but how do you use AI to set things up if they can read env files and so on?

1

u/[deleted] 15d ago

yeah the password is still burnt, but no need to inform the Information Governance Office or send letters to customers.

1

u/finncmdbar 15d ago

You're not overreacting. First, production secrets should be highly guarded, and it's better to err on the side of caution. And second, secure AI agent usage and deployment is not yet solved.

I work in an org where we use a multitude of agents, both in-house and third-party, so here are a few thoughts on this situation:

  1. Anthropic may not train on the credential if it's on the business plan. But if it was included in a prompt, it was sent to Anthropic's servers. If Anthropic ever gets breached, attackers might find the credentials in some database.
  2. Using a secrets manager like Infisical is 100x better, but granting AI agents access to your secrets manager means Claude can pull plaintext credentials into context anytime, which isn't ideal because you never know what Claude does next.

It's worth looking into architectures to give agents access without letting them use plaintext credentials (e.g. credential brokering). This is harder to enforce for local agents, but worth looking into.

1

u/seventyeightist 15d ago

Why is there a "prod database password" that applications all have, rather than (e.g.) the application having an identity that authenticates as itself to the db server? I hope this doesn't mean (but I bet it does..) that the applications all have admin access!

1

u/throwaway-research1 15d ago edited 15d ago

Personally I see so many issues here that all of that is just insane to me and Idk where to begin 💀

1

u/Majestic_Dress_7021 15d ago

We have workflows and safe guards in place to prevent something like this. When Claude needs access to a db or webspace, it warns the user to not paste any tokens or passwords in chat. When someone posts it anyway, Claude insists on changing it.

In my mind, it's not only about security but also about transparency and traceability. When you have a security breach, you don't want to worry about who had access to these chats.

We have an AI vault in our password manager that holds tokens and passwords, and Claude can access that.

1

u/Wide-Answer-2789 15d ago

We run Litellm with DLP and Guardrails to prevent such dump things. Your password may be not in training data but in every log including local sessions.

1

u/qwertyorbust 15d ago

That’s a no. Let them know they messed up and never to do that again.

1

u/Quick-Penalty4883 15d ago

Why does any developer have access to a db password? Why is this not a service account ??

1

u/BadDescriptions 15d ago

Granted it’s not something that should have been done but more importantly why does it take an hour and app restarts to rotate a db password? That’s a critical flaw in your system. Assuming your password is breaches and you need to change it you have to pick between an hour down time or an hour a malicious actor can pull data. 

1

u/vilkazz 15d ago

We had our tech lead do that… three separate times…

1

u/tben2004 15d ago

If this was me. I would force them to spend the day recovering a fake production database on a shit low spec computer. So they can see the painful process of recovering a production server when shit hits the fan.

1

u/BizarroMax 15d ago

Claude is blocked from accessing any secrets at the kernel/filesystem level. It also is blocked from access to production databases. I run it in a sandbox. So, pretty strict.

1

u/Plane-Character-19 15d ago

I would be more concerned about letting the AI run in your production db, session managed by a junior or not.

1

u/Own_Weight_3252 15d ago

Just had to read the first 7 words.

Why on earth you give the prod db password to a junior?

As for the rest of the question, don’t even ask…

1

u/Foreign-Truck9396 15d ago

What you send through the harness should be considered as logged on your computer.

Anyone accessing it could easily find this password.

You didn’t over react at all, but he shouldn’t have been given the prod password in the first place, imo.

1

u/-Dargs 15d ago

Set up a gateway to filter requests before it hits any LLM. All requests to any LLM go through the gateway. Hire an ML engineer or spend a bit of time spinning up an internal LLM to scan requests for sensitive information and outright reject or perform substitution. Just don't let it happen. Few hundred ms lag on requests, hardly noticeable in most cases.

1

u/permissionBRICK 15d ago

I have a dedicated read only pw for prod that sits in the keyvault outside the agent vm where claude can request it from inside the sandbox, and if i approve it use it on prod, and once its done or the lease runs out the host vault connects to the vm and wipes the pw from all agent logs, and deletes the string from all files on the whole fs in general

1

u/AY-VE-PEA 15d ago

No over reaction, it caused work off the back of it no one ever wants to do. As long as you shape it as learning. All good.

1

u/mrmugabi 15d ago

I see others have said the same thing I was thinking. You gave Prod password to a Jr, and then wonder why the Jr tech was so nonchalant about giving it to Claude.

You set the precedent.

1

u/khendron 15d ago

I’m surprised Claude itself didn’t flag this as an issue.

In my experience it’s been rather sensitive about passwords and access tokens, and questions asks to verify they are not production before going ahead.

1

u/digihmong 15d ago

Never give prod secrets to a junior, I'm a senior and I don't even have access to it at the startup I'm at and there's only two developers. 😂

But to answer your question, prod secrets should never go in. That's just bad practice.

1

u/SFWaleckz 15d ago

If you inject secrets into the agent using env vars the agent can read those too btw

1

u/BlackberryOk5347 15d ago

Cut off just one finger

1

u/dumbasPL 15d ago

Claude? Why do any of the development machines have prod credentials on them in the first place, let alone juniors. All it takes is one infected package and somebody will be asking for a ransom.

1

u/Index_Tortoise_4407 15d ago edited 15d ago

Really bad practice across the board. I presume it's a small company (or else the junior shouldn't have production database credentials in the first place). But by sending it to Claude, it will be passed around through a network of trusted servers, where the chats can be stored and evaluated if they're flagged by the system. Because of the entropy around NLP, it's worth treating every request like there's a chance it will be flagged. The local machine with the Claude code chat history will also retain this data, which it shouldn't. The only place database credentials should be stored is on the production servers. Even storing them in a GitHub repo is an unnecessary security risk and poor practice.

This extends to any information stored within the database. If, for example, Claude's lookup included the first 10 rows of each table, including the "users" table, and you have a user from the UK/EU, it may even be a breach of GDPR, which is something to take seriously even at a small company.

AI companies are also slightly freaky about the way your data is used for model improvements, so it might be worth double-checking that you're using an enterprise account and that your settings are configured to avoid that.

Claude doesn't always respect your instructions; if those credentials were capable of deleting or editing the database, all it takes is the AI to go a bit rogue, and you're in a world of hurt. If, down the line, the junior asks, "Users are reporting this issue; could you look into what might be causing it?" Although unlikely, Claude could theoretically come back with, "Those users are corrupted, so I've removed them from the database for you." When in reality it was a different issue entirely. You just shouldn't give Claude the agency to view or make changes to production.

We use a purged and seeded clone of the production database for our staging and dev servers. And we have a similar one we can download for local debugging. Because of firewalls, it's not even possible to do what he did.

You also need a brief internal AI usage policy so everyone is on the same page about what is and is not acceptable. The fact that the junior felt it was a good idea and performed it without first consulting you is a flaw in your operations

TLDR: That password needed to be changed yesterday.

1

u/Moncky 15d ago

How would you deal with a Junior pushing the secret to git?

I would mentor the Junior and now he has a mark that I’m super on top of him. Life will be a bit rubbish till they regain my trust and I need to do extra work and extra reviews. But they will learn and be better for it

1

u/Hirogen_ 15d ago

read only users! for prod… copy prod to test db, test with test db

1

u/vordan 15d ago

We do this only for the dev server and only in Code CLI. NEVER for the production server.

No problems so far, but we are a smallish company and take care.

On the other hand, just change the password and don't fall for the horror stories. People tend to panic too much. Educate the admin, warn him, tell him what could happen. It's better to teach than to punish.

Edit: typo

1

u/Brazilator 15d ago

Spin up a test db, problem solved

1

u/RedditingJinxx 15d ago

no unacceptable. tell him to figure out with claude what are best practices for handling secrets. He should come up with implementing hooks to prevent the AI from even being able to read or use them directly in the first place. Then if he figures it out and was able to confidently demonstrate it works, let him show colleagues / other juniors

1

u/procrastinatewhynot 15d ago

i would give him just a copy of the database and he works on that lol. he shouldn’t touch prod.

1

u/Krommander 15d ago

Old guy paranoïa is what juniors need to learn, without making catastrophic mistakes to become paranoid themselves. It's a self sustaining cycle of stewardship and repairing an old ship that has seen several storms. 

1

u/Tchoalien 15d ago

Pour essayer d'apporter une réponse sans entrer dans le débat du junior qui a accès aux identifiants de prd ou que Claude puisse taper la prd : L'un des problèmes de saisir des identifiants dans un prompt, c'est que ce dernier va être stocké en clair sur la machine (si usage de Claude code en CLI, je sais pas pour la version client lourd) . Donc, si cette machine est compromise, l'attaquant peut retrouver les identifiants.

1

u/xLRGx 15d ago

No that’s not fine. I’m surprised Claude didn’t call it out and make him do it the right way. Has to be rotated. He needs to learn best practices.

1

u/OvermanWhimere 15d ago

anddddd this is why you don't let juniors use AI.

→ More replies (6)

1

u/Tiny_Ad_7720 15d ago

> It's a business plan, it's not training on it

Oh sweet child

1

u/dmurawsky 15d ago

Why on earth are you sharing credentials? Yeah, I'd be very strict about that... This is exactly one of many reasons why you don't do that. Further, you can do supplemental training for the dev about not pasting passwords into Claude. Use time limited API keys in a .env file or an mcp server that handles the auth instead.