r/ClaudeCode • u/CriticalPhen • 16d ago
Help/Question [ Removed by moderator ]
[removed] — view removed post
1.4k
Upvotes
r/ClaudeCode • u/CriticalPhen • 16d ago
[removed] — view removed post
•
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 •
You gave the prod db password to a junior?
364
u/bkrsh099 15d ago •
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.
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
422
u/srggrch 15d ago
Sending secrets to AI agent is bad, giving it direct access to production DB is worse
66
u/fernandojm 15d ago
Don’t underestimate the security implications of having plain text passwords hanging around in places unnecessarily.
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.
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.
12
u/tedfa 15d ago
Pretty sure this is a bot account for infisical
10
u/Amazing-Mirror-3076 14d ago
Why does a junior have the prod db password?
17
u/pixxelkick 15d ago
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.
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.
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.
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.
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?
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:
Things you should be more concerned about:
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.
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/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:
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?
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.
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
2
u/Gullible_Sweet1302 13d ago
OP is advertising for infisical.
https://www.reddit.com/r/aws/s/xF48DiYTYB
https://www.reddit.com/r/ClaudeCode/s/oj2NoPvT99
Etc
Report spam and block
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
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:
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.
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.