A two-hour checkout fix is ready to start, and the developer asks for "the Stripe key". You copy it from the dashboard into WhatsApp. The fix ships on Monday. The key that can move money on your account is still in that chat, in the phone's backup, and in any AI tool the developer pasted it into while debugging.
The short answer: don't send your keys. Give the developer their own access, limited to what the task needs: a sandbox role or restricted key in Stripe, a collaborator account in Shopify, a repository role in GitHub. If something really has to be shared, send it once through an encrypted link that expires, never in chat or email. Keep keys out of the code and out of AI prompts. When the task is done, remove the access and rotate anything you shared.
Why this matters more now
GitGuardian scans public code for leaked credentials. Its State of Secrets Sprawl 2026 report found:
- 28,649,024 new secrets (keys, tokens and passwords) in public GitHub commits in 2025, up 34% on the year before.
- About 28% of incidents started outside code entirely, in collaboration and productivity tools such as chat.
- Commits co-authored by Claude Code leaked secrets at about twice the baseline rate of all public GitHub commits.
- Leaked keys stay live. Of the valid secrets it found in 2022, 64% were "still active and exploitable" four years later.
The last number is the one a business owner should remember. A leaked key works until someone rotates it. The AI figure isn't a reason to ban AI coding tools. It's a reason to set them up so they never see your keys, which we cover below.
Give access, not keys
Most platforms you'd hand to a developer have a way to let someone work on your account without your password or your main key. Here's what to use on five common ones.
Stripe
Stripe's own guidance is blunt: "Don't share keys over email, chat, or other unencrypted channels" (Stripe API keys). Instead:
- For building and testing, invite the developer as a team member with the Sandbox Admin or Sandbox User role. Stripe says both "can't view or make changes to anything in your live account" (Stripe user roles).
- For live work, create a restricted API key (it starts with rk_) with only the permissions the integration needs. Stripe describes it as a way to "limit the damage to your business that a fraudulent actor could cause if they obtained your key."
- Be careful with the Developer role. Stripe notes that it "can create secret keys, which grant access to almost all API resources". If you use it, remove the person when the task is done.
Stripe also tells you to rotate keys "when team members with access to the keys leave your organization". A developer finishing a task counts.
GitHub
In an organization, give the Write role, which GitHub recommends "for contributors who actively push to your project". Don't give Admin, which includes "sensitive and destructive actions like managing security or deleting a repository" (GitHub repository roles).
One catch: on a private repository owned by a personal account, there's no read-only option. GitHub says collaborators there always get write access. If that's more than you want, move the repository into an organization first, where you choose the role.
Shopify
Use a collaborator account, not a staff login or the owner's password. Collaborators are Shopify Partners. You give them a 4-digit request code from the Security section of your Users settings, and you review and edit the permissions before accepting. Shopify says you "can't assign the Administrator store role to collaborators", collaborators don't count towards your user limit, and access expires automatically if they haven't logged in for 90 days (Shopify Help Center).
WordPress
Create a separate user for the developer instead of sharing your login. Installing plugins and editing themes are Administrator-only capabilities on a single site (WordPress roles and capabilities), so most developer work needs that role. That's exactly why it should be their own account, deleted when the work is done. For content-only work, Editor is enough.
AWS and other cloud accounts
Never share the root login. AWS says: "We strongly recommend that you don't use the root user for your everyday tasks" (AWS root user). Give the developer their own identity with least-privilege permissions, and prefer temporary credentials over long-lived access keys, as the AWS IAM best practices recommend. The same idea applies on Google Cloud and Azure.
The short version
- Stripe: a sandbox role for testing, a restricted key for live work. Never your secret key (sk_live_).
- GitHub: the Write role on one repository. Never Admin, and never your own account.
- Shopify: a collaborator account. Never the owner login.
- WordPress: a separate user, deleted afterwards. Never your own login.
- AWS: their own identity with least privilege. Never the root user or your access keys.
When something really has to be shared
Some things have no "give access" option: a database password on an old server, an email-sending login, a third-party service that allows one key per account. Then:
- Create a new credential for this task if the service allows more than one, so you can revoke it without breaking anything else.
- Send it through an expiring, encrypted link. A Bitwarden Send has a maximum lifespan of 31 days, after which "the Send and its contents will be completely purged", and you can cap how many times it's opened (Bitwarden Send). 1Password can share an item with someone who doesn't use 1Password, with a link that expires and that you limit to "anyone with the link or only specific people" (1Password).
- Write down what you shared, with whom and when, so you know exactly what to rotate later.
Your keys and AI coding tools
Many developers now give each task to an AI coding agent such as Claude Code or OpenAI's Codex. Both can read the files in your project folder without asking, by default:
- Claude Code's documentation lists file reads as needing no approval "within the working directory" (Claude Code permissions).
- In its standard mode, Codex "can read files, make edits, and run commands in the working directory automatically" (Codex approvals and security).
So if a .env file with live keys sits in that folder, the agent can read it. What it reads becomes part of the conversation.
What to do about it:
- Keep live production keys off developer machines. Developers use test or sandbox keys. A person adds the production keys on the server or in the hosting dashboard.
- In Claude Code, add deny rules such as Read(./.env) and turn on the sandbox. The documentation is honest about the limit: deny rules "don't apply to arbitrary subprocesses that read or write files indirectly, like a Python or Node script that opens files itself". That's why it recommends the sandbox for operating-system-level enforcement.
- In Codex, keep the default workspace-write sandbox, which "keeps network access turned off unless you enable it".
- Never paste a key into the chat to help the agent debug. Give it the variable name.
If a key has already leaked, rotate it first
GitHub's guide to removing sensitive data starts with the step most people skip: "as a first step you need to revoke and/or rotate that secret. Once the secret is revoked or rotated, it can no longer be used for access, and that may be sufficient to solve your problem" (GitHub).
In order:
- Create a new key at the provider.
- Update it on your server or in your hosting settings.
- Revoke the old key.
- Check the provider's logs for activity you don't recognise.
- Only then decide whether rewriting Git history is worth it. Deleting the file in a new commit doesn't remove it from earlier commits.
GitHub also gives you a free safety net. Push protection for users "is enabled by default" and "stops you from pushing secrets to public repositories on GitHub" (GitHub push protection). It doesn't cover private repositories by default: push protection for repositories is off until an administrator enables it, and it needs GitHub Secret Protection.
A checklist for your next task
- Write the task without any keys in it. Name the variables it needs, not their values.
- Give the developer their own access, at the lowest role that does the job.
- Use test or sandbox keys for development.
- If something must be shared, use an expiring encrypted link and note what you sent.
- Ask the developer to keep .env files and keys away from their AI tools.
- Add production keys to the server yourself.
- When the task is done, remove the access and rotate anything you shared.


