Guides · ← All guides · Published November 14, 2026 · Reviewed November 14, 2026 · Ingenious AI team · 8 min read

Rotating Credentials Found in Eval Files: The Complete Playbook

Five credential classes, one sequence. Rotation is a procedure with an order, and the order — create, switch, kill, purge, verify — is what separates a fix from a ritual.

The short answer: Rotation protects you only when revocation happens, and revocation is step three, not step one. rotate in five steps, in order: (1) create the replacement credential in a secrets manager or as a scoped role; (2) switch the harness to load it at runtime and prove the path with a small run; (3) deactivate or revoke the exposed credential at its issuer — the step that protects you from copies you cannot see; (4) purge the old value from the declared files and their version-control history; (5) re-scan the identical declared set and file the clean report. The sequence applies to every EvalEgress credential class — aws_access_key_id and its secret pair, github_token, generic_api_key, generic_secret_assignment and private_key_block (whose revocation leads, as the CRITICAL exception). Start from a fresh report: the free scan lists what you hold.

What is credential rotation?

Credential rotation is the replacement of a credential that may be known with a fresh one that is not, executed so the workload never depends on the exposed value again. It differs from deletion (which changes files, not validity) and from revocation alone (which kills the old without standing up the new). A complete rotation has an issuer-side event, a workload-side change, and a verification.

Why does the order matter so much?

Each step protects against a different failure, and skipping ahead exposes the gap the skipped step covered. Create-first prevents the outage panic that makes teams reactivate the old credential 'temporarily' — the temporary reactivation that becomes the permanent state. Switch-and-prove ensures the new path genuinely works before the old one dies; a rotation discovered broken mid-incident will be rolled back under pressure, to the exposed value, at the worst moment. Kill-before-purge spends your first effort on the step that reaches unknown copies: until deactivation, every clone of the folder holds a working key, and no amount of file hygiene changes that. Purge-after-kill can then proceed calmly, because the value being scrubbed from history is already worthless. Verify-last converts the whole exercise from testimony into evidence.

The one sanctioned exception is the private key. As the scanner's only CRITICAL credential class (25 points), a private_key_block finding inverts steps one and three: revoke or reissue first, then rebuild the workload's trust around the replacement. The exception proves the rule's logic — order follows the copy-risk, and a private key's copy-risk is total, because the key is the identity.

What differs between classes?

The issuer mechanics, not the sequence. Cloud key pairs rotate in the IAM console (create pair, switch, deactivate, delete). Provider API keys rotate in the vendor console, ideally into a dedicated eval key with a spend cap. GitHub tokens are revoked and reissued narrower — fine-grained, single-repo, read-only where the eval permits. Assigned secrets (database passwords, client secrets) rotate at the system that checks them, with the manager updated in the same motion. JWTs rotate by lifetime rather than by ceremony: let the pasted token expire, and fix the issuance so the eval's own account mints short-lived tokens at start-up. Each class's own guide in this series covers its issuer specifics; the playbook is the spine they hang on.

Two classes travel in pairs and must rotate together: an aws_access_key_id and its aws_secret_access_key are one credential — rotating the secret while the ID's pair lives on in another file is half a rotation, and the re-scan will show it. Read a report for pairs before scheduling: same folder, same config block, same afternoon's work.

How do you handle the exposure window honestly?

Every rotation has a window: from when the value entered the declared files (the introducing commit is the usual evidence) to when it died at the issuer. For each rotated credential, record the window in the incident or run notes, and for CRITICAL and billing-bearing classes, review the issuer's usage or access logs across it. Most reviews find nothing — the copies were the team's own — and the review's value is that 'nothing found, in these logs, across this window' is a statement you can make to a customer or a regulator, whereas 'we rotated it' alone answers a question nobody asked. The scan report anchors the window's near end: the finding's file and line are where the value demonstrably sat on scan day.

Do not let the window review delay the rotation. The sequence is rotate first, review second — a live exposed credential does not become safer while you read logs. Order within the response mirrors order within the rotation: stop the bleeding, then write the history.

Worked example: Alderman & Fitch Brokers, scored end to end

Example. Alderman & Fitch, a fictional insurance brokerage, ran the playbook across one eval folder over a single week. The opening scan's credential inventory:

FindingClassSeverityWeight
GitHub token in the harness setup scriptgithub_tokenHIGH15
AWS access key ID in the copied credentials fileaws_access_key_idHIGH15
AWS secret access key assignment in the same fileaws_secret_access_keyHIGH15
Generic secret assignment in the app configgeneric_secret_assignmentHIGH15

The arithmetic: 15 + 15 + 15 + 15 = 60 points of exposure, so the score is 100 − 60 = 40/100, grade D. 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.

Monday created replacements: a secrets-manager layout with per-purpose secrets and a fine-grained read-only GitHub token for the dataset repo. Tuesday switched the harness and proved each path with small runs. Wednesday deactivated the AWS pair and revoked the GitHub token, then rotated the database password at its server. Thursday purged the files and rewrote the eval repo's history. Friday's re-scan of the identical set reported zero findings, and the week's record — opening report, issuer confirmations with the exposure windows noted, clean re-scan — was filed as a single exhibit. Total engineer time: roughly nine hours, most of it Thursday's history work.

The rotation playbook: the five actions

Create, switch, kill, purge, verify — for every credential:

  1. Create replacements in the manager or as scoped roles. Per-purpose, per-suite, narrower than the originals wherever the eval permits — the replacement should be a better credential, not a photocopy.
  2. Switch the harness to runtime loading and prove it small. One short run per credential path before anything dies; a proven path is what lets the next step be irreversible without drama.
  3. Deactivate or revoke the exposed credentials at their issuers. Pairs together; private keys first and fastest. This is the step that reaches the copies you cannot enumerate.
  4. Purge values from files and version-control history. Current files, old commits, exported bundles and archives — now working with dead values, so the scrub can be thorough rather than hurried.
  5. Re-scan the identical set and file the full record. Clean report, issuer confirmations and exposure-window notes together: the exhibit that closes the episode for reviewers and for your future selves.

Rotation done once, in order, stays done. The destination pattern the replacements live in is the secrets-manager guide.

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, purging secrets from eval repo history, isolating an eval environment from production, staging config copied into an eval folder. EvalEgress is one of the Ingenious AI platforms.

Sources

Frequently asked questions

We have six credential findings. Is that six rotations?
Six values, one campaign: inventory them as one backlog, work the playbook per credential (pairs together), and let one re-scan verify the set. The per-credential sequence is identical, so the second rotation is faster than the first.

What if rotating breaks a running evaluation series?
Sequence around it: create and prove replacements between runs, deactivate in the gap. What you may not do is let a live exposed credential keep working because a series is mid-flight — break the path (network or scope) if the series truly cannot pause.

Is deleting the value from the file ever sufficient?
Only if the value was never live — a documented synthetic placeholder. For any real credential, deletion without issuer-side deactivation leaves every existing copy fully functional.

How far back must history purging go?
To the introducing commit — the value should be unrecoverable from the repository's retained history. Where rewriting is impractical (mirrors, forks), the calculus leans harder on deactivation, which is already done by then: history holding a dead value is a hygiene issue, not an exposure.

Who should be told a rotation happened?
Whoever owns the systems the credentials touch, and whoever holds the eval's assurance record. The filed exhibit (reports plus issuer confirmations) is the notification's content — precise, dated and value-free.