Why the Test Environment Is the Weakest Door
A test environment is the copy where a new feature is tried before it goes live. It is thought of as temporary, so it is built carelessly. Yet it often uses the same key as the live site. 🧪
This article explains why the test environment stays weak, how keys leak from it, what AI-assisted development has changed and how to separate the environments. This article covers the defender’s side only; it does not describe how to carry out an attack.
Why does the test environment stay weak?
BU BÖLÜMÜN ÖZETİ
- It is treated as temporary
- The same key
- It has no owner
Not through ill will, but through the thought that it is only temporary. Three habits produce the weakness.

It is treated as temporary
A test environment is set up for a few days and stays open for months. Security settings are skipped during set-up because it does not count as real. There is no rate limit, no login, and its address starts with a guessable prefix. What is built as temporary is forgotten as permanent. ⏳
The same key
For convenience, the live key is copied into the test environment. The less protected environment then carries a fully authorised key. When the test environment is compromised, the key in the attacker’s hands is the key to the live account. A chain is as strong as its weakest link; for the key, that link is the test environment.
It has no owner
The live site has someone responsible for it. The test environment usually does not: a developer set it up, the project ended and the environment stayed. Nobody watches it and nobody closes it. An environment with no owner means a key with no owner. It may not even appear in the inventory. 👤
How do keys leak from here?
BU BÖLÜMÜN ÖZETİ
- Configuration files
- Shared examples
- Forgotten copies
The testing process itself causes the key to be copied to many places.
Configuration files
During testing the key is written into a configuration file, and that file is pushed to a repository. According to GitGuardian’s 2026 report, 28.65 million new secrets were written into public GitHub commits in 2025. The report also found 24,008 unique secrets exposed in the configuration files that connect AI tools to other systems, 2,117 of them valid. The settings file is where a key is most often forgotten. 📄
Shared examples
One developer sends another a working example with the key inside. A screenshot of an error is shared with the key visible in a corner. A log file is attached to a support request. Testing runs on sharing, and every share is a copy. These habits are stricter in the live environment and loosen in testing.
Forgotten copies
The project ends and the key remains: on an old server, on a developer’s laptop, in a backup. According to GitGuardian’s report, 64 per cent of the secrets confirmed valid in 2022 had still not been revoked four years later. Most leaked keys stay valid for years. A test key with no expiry date is an open-ended risk; the timetable is in when to rotate an API key. 🗝️
What has AI-assisted development changed?
BU BÖLÜMÜN ÖZETİ
- More code, more leaks
- Commits written with AI
- What it means for the test environment
Writing code became faster. Leaks rose with the speed, and there are figures that measure it.

More code, more leaks
According to GitGuardian, public commits rose to about 1.94 billion in 2025 and newly leaked secrets grew 34 per cent, the largest yearly rise on its records. More people are writing more code, faster. When production speeds up, mistakes spread faster too. 📈
Commits written with AI
The same report found that commits co-authored with an AI tool leaked secrets at a markedly higher rate than the baseline: about 3.2 per cent for commits co-signed by Claude Code against a baseline of 1.5 per cent. The report also stresses that the human factor remains decisive. The tool speeds things up; checking what goes to the repository is still a person’s job.
What it means for the test environment
Tests built quickly with AI mean settings files built quickly. A prototype that appears in an afternoon can go to a repository with the live key inside. The faster the work, the more the rule of a separate key for testing matters. The rule is set once and protects every prototype. 🚀
How are the environments separated?
BU BÖLÜMÜN ÖZETİ
- A separate key, a separate cap
- Closing the door
- No real data
The answer is not to ban testing but to limit the harm testing can do.
A separate key, a separate cap
Give the test environment its own key, if possible in a separate workspace with a low spending cap. If that key leaks, the damage is limited to that small cap and the live site is unaffected. OpenAI recommends creating keys with an expiration date. A test key should be short-lived and small-budget. ✂️
Closing the door
A test environment does not have to be public. Close it with a password, with specific addresses or to the team network only. Prevent search engines from indexing it. An environment nobody can find is not scanned. Your developer can do this in a few lines.
No real data
Use sample data in testing instead of real customer data. If the test environment is compromised, what leaks is fake records. This matters for security and for personal data obligations. The purpose of a test is to see behaviour, not to carry data. This article is not legal advice. The whole frame is in the AI audit guide. 🧾
What should a business do?
Asking two questions is enough. The answers usually surprise.

Lock list: the test environment
This article’s lock list has four lines, in order. One: list every open test environment and close those not needed. Two: give each environment a separate, short-lived key with a low cap. Three: close the test environment with a password or an address restriction. Four: set up secret scanning on the repository. Exactly where a key sits on your site is described in where AI keys live in WordPress. Forecast: development tools will switch on secret scanning before a push by default. Update log. 30 November 2026: first publication. Forecasts on this page are re-read when they fall due; one that proves wrong is corrected here, not deleted.
How does Adapte Digital find test environments?
BU BÖLÜMÜN ÖZETİ
- A single delivery package
- What is reviewed
- Where to start
In the Attack File we look for every copy of the live site alongside it, and ask which key each one uses.
A single delivery package
Adapte Digital does not charge a monthly management fee. Work starts with a single delivery package whose scope is written down in advance: 36,000 TRY + VAT. If the work grows, the new need is defined as a separate add-on package, priced by what will be delivered rather than by the hours spent. 📦
What is reviewed
Open test environments, their access restrictions and the keys they use are listed; every copy that carries the live key is marked.
Where to start
The written scope of each package, with current pricing and capacity, is on our campaign pages. 🧭
Quick Summary
- A test environment is less protected yet often carries the live key.
- Keys leak through settings files, sharing and forgotten copies.
- Most leaked secrets stay valid for years.
- AI-assisted development has raised the rate of leaks.
- A separate key, a low cap and closed access limit the harm.
Short Glossary
- Test environment
- A test environment is the separate copy in which software is tried before it goes live.
- Live environment
- A live environment is the workspace in which software serves real users.
- Configuration file
- A configuration file is a file that stores a program’s settings and connection details.
Frequently Asked Questions
Next Step
Send your developer two questions: how many copies of our site are open, and which key do they use? If the answer is the same key, this week’s task is clear.
Sources: GitGuardian — The State of Secrets Sprawl 2026 · GitGuardian — When We Use AI To Ship Fast, Secrets Spread Fast · OpenAI Help Center — Best practices for API key safety
Updated: November 2026
Sık Sorulan Sorular
Ask your developer: how many copies of our site are open, what are their addresses and which are still needed? Copies left from old projects that nobody uses may turn up. Those not needed are closed. The key of a closed environment is revoked as well; if the environment goes and the key stays, the job is half done. 🔎
The second question: which key do these copies run on? If it is the same as the live site’s, that key is rotated and a separate one is issued for testing. The change takes an hour and removes the weakest link from the chain. The same key turns two environments into one risk. Where keys should be kept is in how to store an AI API key.
Ask your developer and look at your hosting panel. Subdomains and old project folders are often forgotten copies.
No. Creating a key is free; only usage is charged.
Yes. A private repository can be breached too, and everyone with access sees the key.
