Guides · ← All guides · Published November 14, 2026 · Reviewed November 14, 2026 · Ingenious AI team · 8 min read
Private Key Found in an Eval Config: What to Do First
One header line — -----BEGIN PRIVATE KEY----- — is the single heaviest finding an eval file can carry. Here is why, and the exact order to close it.
The short answer: treat the key as compromised, not as misplaced. A private key block declared in a file an eval runs with is flagged by EvalEgress as private_key_block (CRITICAL, weight 25 — the heaviest single deduction in the scanner). Revoke or replace the key first, then purge it from the file and its version-control history, then mount the replacement from a secrets store so it never lives in a declared file again. Rotation comes before cleanup, because anyone who already copied the file holds a working key until the moment it is revoked. Check the rest of the folder afterwards with the free scan — a folder that held one key usually holds the config that went with it.
What is a private key block?
A private key block is the PEM-encoded body of an asymmetric private key, introduced by a header line such as -----BEGIN PRIVATE KEY----- or -----BEGIN RSA PRIVATE KEY-----. Whoever holds that text holds the identity the key represents: they can sign, decrypt or authenticate as its owner without any password. EvalEgress detects the header pattern itself — class private_key_block, CRITICAL — and reports presence, file and line only; the key material is redacted in every output.
Why does one header line outweigh everything else in the report?
Most findings describe a path: a wildcard that could be abused, an open rule that could be reached through. A private key is not a path, it is the destination. The eval agent runs with the file, anything that steers the agent reads what the agent reads, and the key authenticates as its owner to whatever system trusts it — a host, a signing service, a deployment pipeline. There is no second condition to satisfy, which is why the scanner weights it 25 points, equal to an admin-level managed policy and a wildcard principal, and above every secret-like pattern in the HIGH band.
The header is also uniquely copyable. A key pasted into an eval config tends to travel: into the results archive when the harness logs its environment, into a shared drive when the eval folder is zipped for a colleague, into a dataset snapshot. Each copy is fully functional. That is the practical difference between private_key_block and, say, debug_route at LOW weight 3 — the debug route tells an attacker where a door is; the private key is a working copy of the key to a door, already cut.
Where do private keys in eval folders actually come from?
Almost never from carelessness about keys specifically. They arrive as passengers. A team copies the application's deployment folder into the eval workspace so the model under test runs against a realistic stack, and the TLS or signing key sits inside it. Or an infrastructure export — the file that provisions the staging box — is pasted in whole because the eval needs the same shape, and the key block rides along in the middle of two hundred harmless lines. Or a support bundle, generated to debug a failing integration, is dropped into the eval data as a realistic document for the model to summarise — with the key the bundle was never meant to publish.
The common thread is that the file was assembled for a different purpose and inherited by the eval. That is why the fix is procedural rather than personal: eval workspaces get built from allow-listed pieces, not copied from production-shaped folders. The wider pattern — copied configuration as the main road into eval exposure — is the subject of what is eval-to-production exposure?
What order do you close a private_key_block finding in?
Revocation first, because it is the only step that protects you from copies you cannot see. Replace the key wherever it is trusted — reissue the certificate, rotate the signing key, remove the public half from authorized_keys or the trust store — and only then clean the files. A team that purges the repo first and rotates second has spent the interval advertising, to anyone watching the commit history, exactly which key to use quickly.
Cleanup second, and cleanup means history, not just the current file. Deleting the block from today's config leaves it in every earlier commit, which for a pasted eval folder is usually the same repository the eval results live in. Rewrite or retire the history, then verify: paste the cleaned declared files into the scan and confirm the class is gone. If the key protected anything customer-facing, the rotation event itself belongs in your incident notes with the dates the key was live in the folder — the scan report's file and line are the evidence of where it sat.
Worked example: Harborline Freight, scored end to end
Example. Harborline Freight, a fictional logistics firm, assembled an eval for its shipment-tracking assistant from a copy of the staging deployment folder: 14 declared files, including the service's TLS configuration. The scan of those files returned three findings:
| Finding | Class | Severity | Weight |
|---|---|---|---|
| Private key block header in the copied TLS config | private_key_block | CRITICAL | 25 |
| Generic secret assignment in the same folder's app config | generic_secret_assignment | HIGH | 15 |
| Debug mode enabled in the staging settings file | debug_mode_enabled | MEDIUM | 8 |
The arithmetic: 25 + 15 + 8 = 48 points of exposure, so the score is 100 − 48 = 52/100, grade C. Scoring uses EvalEgress's published weights — CRITICAL 25, HIGH 15, MEDIUM 8, LOW 3 — with grades at A ≥ 90, B ≥ 75, C ≥ 50 and D ≥ 25.
Harborline revoked the key the same morning — it was the staging host's TLS key, trusted by two internal services — and reissued it from the secrets store, mounted at runtime instead of stored in the folder. The secret assignment was rotated and moved to an environment variable, debug was turned off, and the eval workspace was rebuilt from an allow-list: the harness, the dataset and a hand-written config with no key material in it. The re-scan of the rebuilt folder reported zero findings. The lesson the team kept was the ordering: the report was filed on a Friday, and revocation still happened before the weekend cleanup, because copies do not wait for tidiness.
Close a private key finding: the five actions
In this order — the sequence is the substance:
- Revoke and replace the key first. Remove its public half from every trust store, reissue the certificate or key pair, and treat every hour before revocation as exposure time.
- Purge the block from the files and their history. Deleting it from the current version is not enough; earlier commits, bundles and zipped copies of the eval folder all carry working key material.
- Mount the replacement from a secrets store. The new key is injected at runtime or mounted by the platform — it never returns to a declared file, an env dump or a pasted config.
- Scan the whole eval folder, not just the fixed file. A folder that carried a private key usually carried its companion config; run the declared set through the scan and close what else it finds.
- Record the exposure window. File the scan report — class, file, line and dates — with the rotation record, so a later reviewer can see where the key sat and when it stopped working.
A private key finding is the one class where the response starts with revocation rather than discussion. The general method for the credential classes as a group is in how to stop an AI evaluation from reaching production secrets.
Keep checking the boundary
Run the free exposure scan on the files your next eval will run with. Compare plans, read the scoring documentation, and keep reading: what is eval-to-production exposure?, what is egress in AI evaluation?, pre-deployment eval safety checklist, how to stop an AI evaluation from reaching production secrets, AWS access key ID in eval files, rotating an AWS secret key after eval exposure, GitHub token in an eval repo. EvalEgress is one of the Ingenious AI platforms.
Sources
- EvalEgress scoring documentation — the 16 finding classes, severity weights and declared-surface scope every judgement in this guide applies, published 2026.
- What Is Eval-to-Production Exposure? — the companion guide this page builds on, published November 7, 2026.
- The free EvalEgress scan — the declared-file scan this guide's checks are performed with.
Frequently asked questions
Is a private key in an eval file really compromised if nobody ran the eval?
Treat it as compromised. The exposure is the declaration: the file was copied, committed or shared as part of assembling the eval, and each of those steps can leave copies you cannot enumerate. Revocation is cheap next to proving a negative about every copy.
Why is private_key_block CRITICAL while an AWS access key is HIGH?
A private key authenticates as its owner with no second factor and no expiry in the file itself; it is a complete credential for whatever trusts it. The scanner weights it 25, the CRITICAL band, alongside the admin-policy and wildcard-principal classes.
Does the scanner read or store the key itself?
No. The finding reports presence, file, line and pattern class; the key material is replaced with [REDACTED] in every output and is never stored or displayed.
The key was for staging only. Does that change the response?
The order stays the same — revoke, purge, mount from a store. Staging keys are routinely trusted by internal services and pipelines, and staging folders are exactly the ones copied into eval workspaces.
How do I prove the key is gone afterwards?
Re-scan the declared files and keep the clean report next to the rotation record. The before report shows the class, file and line; the after report shows the class absent from the same file set.