API Key and Credential Rotation Runbook (JSON) — ChatGPT, Claude.ai
The API Key and Credential Rotation Runbook (JSON) is a prompt for ChatGPT, Claude.ai, and Claude Code that builds a secure secret rotation plan. It outputs a structured JSON object with steps.
CC0-1.0 ★ 178,201 updated 2026-10-24
Open on GitHubWhat API Key and Credential Rotation Runbook (JSON) does
This prompt functions as a security engineering assistant that converts rotation logic into a standardized JSON format. It requests specific inputs such as the secret type, its storage location, all dependent services, the reason for rotation, and provider capabilities regarding key overlap.
The generated runbook includes a blast radius assessment, preparation tasks, rotation steps, verification procedures, and a rollback strategy. If an incident is flagged, the prompt adds sections for audit log reviews and evidence tracking.
Before running the prompt, identify every system using the secret, including CI/CD variables, local .env files, and external partner integrations. The output relies on placeholders like <NEW_SECRET_REF> instead of actual credential values to maintain security protocols during the planning phase.
What it helps with
- generate a structured secret rotation runbook
- assess operational risks during credential updates
- create specific rollback instructions
- document security verification steps
Example prompts for the agent
- Generate a rotation runbook for an AWS Secret Manager key used by five internal services.
- Create a JSON rotation plan for a database password after a confirmed leak, including a short maintenance window.
How to install API Key and Credential Rotation Runbook (JSON)
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about API Key and Credential Rotation Runbook (JSON)
How to install the API Key and Credential Rotation Runbook (JSON) prompt?
Simply copy the provided prompt text and paste it directly into your chat interface in ChatGPT, Claude.ai, or Claude Code when starting a security task.
What does this prompt do?
It processes your security inputs to produce a single JSON object containing a comprehensive rotation strategy, health checks, and communication plans.
What is required to use this prompt?
You need the secret type, storage location (e.g., vault, Kubernetes secrets), a list of consumers, the reason for rotation, and details on whether the provider supports dual-credential overlap.
Source text
prompts.csv · CC0-1.0
You are a senior platform security engineer. Using the schema below, produce a complete credential rotation runbook as one valid JSON object for the secret I describe (an API key, database password, OAuth client secret, signing key, webhook secret, cloud access key, SSH key or TLS certificate). Ask me up to 5 short questions first if the inputs are missing, then output ONLY the JSON, with no comments and no trailing commas.
My inputs:
- Secret type and provider:
- Where it is stored (vault, cloud secret manager, CI variables, .env files, Kubernetes secrets):
- Every service, job, device or partner that uses it:
- Reason for rotation (scheduled, employee offboarding, suspected leak, confirmed leak, compliance):
- Can the provider keep two valid credentials at once (yes / no / unknown):
- Allowed downtime and team size:
Schema:
```json
{
"rotation_runbook": {
"summary": {
"secret_name": "",
"secret_type": "",
"provider": "",
"reason": "",
"severity": "routine | elevated | incident",
"owner": "",
"approver": "",
"target_completion": "",
"rotation_strategy": "dual_credential_overlap | blue_green_secret | hard_cutover"
},
"blast_radius": {
"consumers": [
{ "name": "", "type": "service | job | ci | device | partner | human", "how_it_loads_secret": "", "reload_method": "restart | hot_reload | redeploy | manual", "owner": "", "risk_if_broken": "" }
],
"unknown_consumers_check": ["provider access logs for the old key", "secret scanning in repos and CI logs", "search config and IaC for the secret name"]
},
"preparation": [
{ "step": "", "command_or_location": "", "verify": "" }
],
"rotation_steps": [
{ "order": 1, "action": "", "who": "", "command_or_location": "", "expected_result": "", "verify": "", "rollback": "" }
],
"verification": {
"health_checks": [],
"old_credential_usage_must_be_zero_for": "",
"metrics_and_logs_to_watch": []
},
"revocation": {
"revoke_old_after": "",
"steps": [],
"confirm_revoked_by": ""
},
"rollback_plan": {
"trigger_conditions": [],
"steps": [],
"point_of_no_return": ""
},
"incident_extras": {
"applies": false,
"scope_review": "",
"audit_log_queries": [],
"notify": [],
"evidence_to_keep": []
},
"communication": [
{ "audience": "", "when": "", "channel": "", "message": "" }
],
"prevention": {
"next_rotation_date": "",
"automation_opportunities": [],
"secret_hygiene_fixes": []
},
"open_questions": []
}
}
```
Rules:
1. Prefer a dual-credential overlap: create the new secret, roll it out to every consumer, verify, and only then revoke the old one. If the provider allows only one valid credential, use hard_cutover and plan a short maintenance window.
2. Order rotation_steps so nothing breaks: store the new secret, update consumers from least to most critical, reload each one, verify, then revoke.
3. Every step must have a concrete verify and, before the point of no return, a rollback.
4. Never print, invent or echo real secret values; use placeholders like <NEW_SECRET_REF>.
5. For a suspected or confirmed leak, set severity to incident, fill incident_extras, revoke as fast as safely possible, and review audit logs for misuse since the exposure window began.
6. Include CI/CD variables, local .env files, cached build artifacts, mobile or desktop apps and partner integrations in the consumer search, because they are the usual misses.
7. In prevention, suggest moving to short-lived or workload identity credentials where the provider supports them, and a realistic rotation interval.
8. Put anything you had to assume into open_questions instead of guessing silently.
© f · CC0-1.0 · f/prompts.chat