- Hardcoded API keys are passwords to paid services written straight into the code. Anyone who has ever seen the code, including a departed developer, can use them.
- GitGuardian counted about 28.65 million new secrets in public GitHub commits in 2025, and over 64 percent of secrets confirmed valid in 2022 still worked in January 2026.
- Ask your reviewer to scan the full Git history, not just today's files. GitHub secret scanning and gitleaks both do this.
- Rotate keys with an overlap, new key live first, old key revoked only after its traffic drops to zero. Stripe gives up to 7 days of overlap when you roll a key.
- Accounts matter as much as code. Hosting, domain, code host and vendor accounts registered to a former developer can switch the app off.
- A clean code review does not prove the app does what the business needs. Pair it with a walk through of real workflows by the people who use it.
Hardcoded API keys and 11 other things to check before you inherit an app
/ Updated / 13 min read
TL;DR
If you are taking over an app because the developer or agency left, or because you are buying a business that runs on it, assume every password and API key the old team could see is exposed. Have a reviewer scan the full code history for hardcoded API keys with GitHub secret scanning or gitleaks, then rotate every key using a grace period so nothing goes down. After that, confirm you own the code and every account, that someone other than the original developer can redeploy the app, and that a backup has actually been restored.
Key takeaways
On this page
- The app handover checklist, 12 checks
- Hardcoded API keys, what they are and what a leak costs
- How to find hardcoded API keys in a codebase
- How to rotate API keys without downtime
- Who owns the code, and who owns the accounts
- Can anyone other than the original developer redeploy it
- Dependencies, the parts nobody maintains
- Backups that have actually been restored
- If you are buying a company that runs on the app
- Keep it, fix it, replace it or walk away
- Where to go from here
- Frequently asked questions
Hardcoded API keys are passwords to paid services, such as payments, email, maps or accounting, written straight into an app's code. When you inherit an app, assume every key the old developer or agency could see is exposed. Have a reviewer scan the full code history for them, then rotate each one with an overlap so the app never goes down. That is the first item on the checklist below, and the one most likely to cost money if it is skipped.
This article is for the owner or buyer, not the developer. Maybe the developer went quiet, the agency contract ended or the one person in house who understood the app left. Maybe you are acquiring a company that runs on a custom app. Either way, know what you are taking on before you sign or before something breaks.
Hand the checklist to whoever reviews the code for you and ask for written answers on every row. The sections after it explain the items that cause the most trouble, starting with hardcoded keys.
The app handover checklist, 12 checks
Each row says why it matters to the business, how a reviewer checks it and what a bad answer looks like. A red flag does not mean walk away. It means the item has to be fixed, priced into the deal or written into the handover agreement.
| Check | Why it matters to the business | How to check | Red flag |
|---|---|---|---|
| 1. Secrets and API keys | A leaked key lets anyone run up charges on your accounts or read customer data | Scan the full Git history with GitHub secret scanning or gitleaks, then search chat and tickets | Keys in the code, in old commits or pasted in chat threads |
| 2. Account ownership | Whoever controls hosting, domain, code host and vendor accounts can switch the app off | List every account and the email address and payment card it is registered to | Accounts in a former developer's or employee's personal name |
| 3. Code ownership | Paying for an app is not the same as owning its copyright | Read the development contract for a written assignment of intellectual property | No assignment, or the agency keeps rights to large parts of the code |
| 4. Source code access | Without the full repository nobody can fix or move the app | Get admin access and confirm the code matches what runs in production | Code only on a laptop or the live server, or the repository is months behind |
| 5. Rebuild and redeploy | An app nobody else can redeploy cannot be recovered after an outage | Have a second developer stand up a working copy from the repository and the written steps | Deploys depend on one person's machine or memory |
| 6. Dependencies | Outdated packages carry known security holes and make every upgrade harder | Run the package audit (npm audit, pip-audit) and check the framework's support dates | Framework past end of support, critical advisories left open |
| 7. Backups and restore | A backup that has never been restored is a guess | Restore a recent backup into a test copy and compare record counts | No restore ever tested, backups kept in the same account as production |
| 8. User and admin access | Former staff and contractors may still have admin rights | Pull the user lists for the app, the code host and each vendor account | Shared logins, departed people still active, no two step sign in |
| 9. Personal and payment data | Customer data carries legal duties, and a breach is expensive | Map where personal and payment data is stored and who can read it | Full card numbers or ID numbers stored by the app itself |
| 10. Integrations | Links to accounting, CRM and payment tools fail silently | List every outside service the app calls and every service that calls it | Integrations running under a departed person's login |
| 11. Running costs | Hosting and paid services bill whether anyone watches or not | Put 12 months of invoices tied to the app on one page | Charges on a personal card, or services nobody can explain |
| 12. Documentation | The next developer starts from zero without it | Ask for setup steps, a one page architecture sketch and the known issues list | Nothing written down and the only person who knew has left |
Items 1, 2 and 7 are the urgent ones. A leaked key, an account you do not control or a backup that does not restore can each cost real money in a single bad week. The rest decide how expensive the app will be to live with.
Hardcoded API keys, what they are and what a leak costs
Every app talks to other services. It charges cards through a payment processor, sends email through an email service, pulls maps, syncs with accounting. Each connection needs a credential, usually called an API key or token. That key should live in a separate, protected store that only the running app can read. When it is typed straight into the code instead, it is hardcoded.
The problem is that code gets copied. It sits on every developer's laptop, in every old backup, in every commit ever made, and sometimes in a public repository by accident. Anyone who ever had the code has the key, including the developer who just left. Deleting the line later does not help, because the key stays in the history.
The numbers show how common this is.
| Finding | Figure | Source |
|---|---|---|
| New secrets found in public GitHub commits in 2025 | About 28.65 million, up 34 percent on 2024 | GitGuardian, State of Secrets Sprawl 2026 |
| Secrets confirmed valid in 2022 that still worked in January 2026 | Over 64 percent | GitGuardian, State of Secrets Sprawl 2026 |
| Private, internal repositories compared with public ones | About 6 times more likely to contain hardcoded secrets | GitGuardian, State of Secrets Sprawl 2026 |
| Leaks found outside code, in chat, tickets and wikis | About 28 percent of incidents | GitGuardian, State of Secrets Sprawl 2026 |
| Average cost of a data breach in the United States, 2025 | $10.22 million (global average $4.44 million) | IBM, Cost of a Data Breach 2025 |
Sources are GitGuardian's State of Secrets Sprawl 2026 and IBM's Cost of a Data Breach report. The second row is the one to remember. Most leaked keys are never changed, so a key the old developer saw years ago may well still work today.
What a leaked key costs depends on what it opens. A payment key can issue refunds or read customer records. A cloud key can start servers that bill by the hour. A database password exposes everything at once, which is where breach costs like IBM's come in. The fix is the same for all of them, find every key and replace it.
How to find hardcoded API keys in a codebase
You do not need to read code to get this done. You need to ask for the right scan and the right scope.
- Scan the full history, not just today's files. A key removed last year is still in the old commits. If the code is on GitHub, ask for GitHub secret scanning to be turned on. GitHub's documentation says it scans the entire Git history on all branches, plus issues, pull requests, wikis and discussions. It is free for public repositories and part of the paid GitHub Secret Protection product for private ones.
- Use an open source scanner for any code host. gitleaks is free, scans a repository's history or a plain folder of files, and works whether the code is on GitHub, GitLab, Bitbucket or a single server. It is a good choice when the code arrives as a zip file.
- Search outside the code. Keys get pasted into Slack, Teams, Jira tickets and shared documents during urgent troubleshooting. GitGuardian found about 28 percent of incidents came from places like these.
- Get a list, not a reassurance. Ask for every key found, which service it belongs to, what it can do and whether it still works.
To stop new keys from being committed, ask the developer to add a pre-commit check. gitleaks can run on each developer's machine before code is saved, and GitHub's push protection blocks a push that contains a recognised key. The OWASP Secrets Management Cheat Sheet is a good reference to share with whoever takes over.
How to rotate API keys without downtime
Rotating a key means issuing a new one and switching the old one off. The fear is that the app breaks in between. It does not have to, as long as both keys work for a short overlap.
| Step | What happens | Done when |
|---|---|---|
| 1. Inventory | List every key, its service, what it can do and where the app reads it from | No key on the scan report is unaccounted for |
| 2. Move to a secret store | The app reads keys from environment settings or a secrets manager, never from code | Code contains no live keys |
| 3. Issue the new key | Create it with the service, with the narrowest permissions that still work | New key stored, old key still active |
| 4. Deploy and watch | Release the app using the new key, check logs and the service's dashboard | Traffic flows on the new key with no errors |
| 5. Revoke the old key | Switch the old key off at the service | Old key's request count is zero |
| 6. Record it | Note the date, owner and next rotation date | Every key has an owner in the company |
Many providers build the overlap in. Stripe's API key documentation says that when you rotate a key in the dashboard, both the old and new keys work for up to 7 days, and recommends expiring the old key only after its request volume has been at zero for a while. For database passwords, AWS Secrets Manager's alternating users strategy keeps two valid logins, so an app that fetches its password mid rotation still gets one that works.
Order matters. Rotate the keys with the most power first, usually payment, cloud hosting and the production database. Do the low risk ones, like a mapping key with a spending cap, afterwards. And do it right after the handover, not at the next convenient moment, because the person who left still has the old values.
Who owns the code, and who owns the accounts
Paying for an app does not always mean you own it. Many development agreements give the client a license to use the software while the developer keeps the copyright, or keep rights to a library of reusable components that turns out to be most of the app. Read the contract for a clear assignment of intellectual property to your company. Our article on who owns the code when you hire a software company covers the clauses to look for, and if the app was written with AI tools, who owns AI generated code covers what changes.
Accounts are the part people forget. The code host, the hosting provider, the domain registrar, the app store listings, the email service and every vendor the app connects to each have an owner. If that owner is a former developer's personal email, they can lock you out, let a card lapse and take the app offline, or simply never answer.
Automations count too. Zapier or Make connections authorized under one person's Google account stop the day that account closes. The fix is structural, a dedicated integrations account owned by the company, with every connection re-credentialed to it. The same principle applies to any inherited app. Every account moves to a company owned login, with at least two people in the company able to reach it.
Can anyone other than the original developer redeploy it
An app you cannot redeploy is an app you cannot recover. Test this before you need it. Give a developer who has never touched the app the repository and whatever setup notes exist, and ask them to stand up a working copy on a fresh environment.
What breaks is the useful part. Missing settings, a database change made by hand on the live server, a build step that only works on one laptop. Each is a single point of failure found on a quiet day instead of during an outage, and the list becomes the first job for whoever takes over.
Dependencies, the parts nobody maintains
Modern apps are built on other people's code, often hundreds of packages. Each one gets updated, and some get abandoned or develop security holes. An app whose packages were last updated three years ago will need real work before it can safely take a framework upgrade.
Ask the reviewer to run the package manager's built in audit, such as npm audit for JavaScript or pip-audit for Python, and to report the count of critical and high advisories. Also ask for the main framework and language versions and whether they are still supported. A framework past its end of support date will not get security fixes, which turns a maintenance chore into a project. For what that work costs to carry year to year, see what to budget for after the build.
Backups that have actually been restored
Everyone says they have backups. Far fewer have restored one. The question is not whether the database is backed up. It is when someone last restored a backup and confirmed the data was complete.
Ask for a restore into a test copy and a comparison of record counts against production. Backups kept in the same cloud account as the live app are lost with it if that account is compromised or closed. And a database backup does not include uploaded files, which usually need their own.
If you are buying a company that runs on the app
In an acquisition, the app is part of what you are paying for, so the checklist feeds the deal. Findings on code ownership and accounts belong in the purchase agreement, typically as a seller warranty that the company owns its code and a closing condition that every account is transferred to company control. A large rotation or rebuild job can justify a price adjustment or a holdback.
This article covers one app's code and accounts. A sale also brings every subscription, contract and integration the business depends on. That wider review is in 8 things a technology audit during a business sale reveals.
Rotate keys and transfer accounts at closing, not weeks later. Until then the seller's team still holds working credentials.
Keep it, fix it, replace it or walk away
Once the answers are in, there are four honest options.
- Keep it and fix the findings. Right when the app does its job and the problems are hygiene, such as keys to rotate, accounts to move and packages to update. This is the most common outcome.
- Rebuild it as a system you own and control. Right when the app is central to how the business runs but cannot be redeployed, sits on an unsupported framework, or the ownership terms are unclear. A rebuild starts with clean accounts and documented keys from day one.
- Move to an off the shelf product. Right when the app does something standard, such as basic scheduling or simple invoicing, that a subscription product now does well. Do not rebuild a commodity.
- Walk away or renegotiate. Right in an acquisition when the seller cannot show ownership of the code or will not hand over the accounts.
Look before you decide. A design firm Black Badger worked with had attempted a Zoho migration roughly three years earlier through another consultant, and the project stalled. Before proposing anything, the work went module by module through what the earlier attempt left behind, which automations existed, which were broken and what could be salvaged. The design firm system design case shows that review in practice.
One limit to keep in mind. A code review finds exposed secrets and structural problems, not every logic bug. Pair it with a walk through by the people who use the app daily, running a real quote, order or month end report. The spreadsheets they keep next to the app show what it will cost you next year.
Where to go from here
Start with items 1, 2 and 7 this week. Get the secret scan run on the full history, list every account and who owns it, and ask for one tested restore. Those three answers tell you how urgent everything else is.
If you want a second set of eyes on what comes back, Black Badger reviews inherited apps and builds custom software that businesses own outright, including the accounts and keys. Book a call and bring the checklist answers. You will get a straight read on whether to keep the app, fix it or replace it. If the risk is a no code tool rather than custom code, read what to do when the no code tool your business runs on changes its rules.
Frequently asked questions
What are hardcoded API keys?
A hardcoded API key is a password for an outside service, such as a payment processor, email sender or mapping tool, typed directly into the app's source code instead of being stored in a separate, protected place. Anyone who can read the code, or any old copy of it, can use that key to act as your business with that service.
How do I find hardcoded API keys in my codebase?
Have whoever reviews the code run a secret scanner across the whole Git history, not only the current files, because a key deleted last year still sits in old commits. If the code is on GitHub, turn on GitHub secret scanning, which scans every branch and the full history. For any code host, the free open source tool gitleaks scans a repository's history or a plain folder. Also search chat threads, tickets and shared documents, where keys often get pasted during troubleshooting.
How do you detect hardcoded API keys and credentials in source code automatically?
Scanners match known key formats and high randomness strings, and some check with the provider whether a key still works. GitHub secret scanning and push protection catch keys as code is pushed. gitleaks can run as a pre-commit hook on each developer's machine and in the build pipeline, so a key is blocked before it is ever saved to the history.
How are API keys renewed without disrupting an application?
Use an overlap. Create the new key, put it in the app's secret store, deploy, confirm traffic is flowing on the new key, then revoke the old one. Many providers support this directly. Stripe keeps both the old and new key working for up to 7 days when you roll a key, and AWS Secrets Manager's alternating users strategy keeps two valid credentials so the app always has one that works.
Is deleting a hardcoded key from the code enough?
No. Deleting the line leaves the key in every earlier commit and in every copy of the code that already exists. GitHub's own guidance is to rotate the credential first. Once the old key is revoked, cleaning it out of the history is optional.
What should be on an app handover checklist?
At minimum, secrets and API keys, ownership of every account, the development contract's intellectual property terms, full source code access, a test redeploy by someone new, dependency health, a tested backup restore, user and admin access, where personal and payment data lives, integrations, running costs and documentation. The table in this article lists how to check each one and the red flag to watch for.
What is included in a software due diligence checklist when buying a company?
For a business that runs on its own app, due diligence covers who owns the code and accounts, security exposure such as leaked keys and outdated packages, whether the app can be redeployed without its original developer, data protection duties, and the real monthly cost to run it. Findings feed the purchase agreement, for example a seller warranty on intellectual property or a holdback until key accounts are transferred.
Share this article
Keep reading
ERP Integration Cost in 2026, by Approach, Plus Yearly Upkeep
ERP integration costs anywhere from nothing to six figures a year, depending on the approach. Here are real 2026 price ranges for native connectors, Zapier and Make, Celigo, Boomi, Workato, a custom integration and one owned system, plus what each costs to keep running.
If this is your situation
Talk it through on a call
Thirty minutes over video with the person who would run the build. You talk, we ask questions, and you leave with a plain read on whether custom software makes sense for you. If the answer is that your current tool is fine and badly configured, you will hear that.
Who wrote this

David Verneuille
Founder, Black Badger Software Solutions
David Verneuille founded Black Badger after 18 years as a project manager and years implementing Smartsheet, monday.com, Wrike and Zoho for clients. He now builds custom systems that clients own outright, which is why the writing here is specific about where each platform fits and where it stops fitting.
