[{"data":1,"prerenderedAt":532},["ShallowReactive",2],{"blog-prompts/rotate-credentials":3},{"id":4,"title":5,"body":6,"category":507,"date":508,"dateModified":509,"description":510,"draft":511,"extension":512,"faq":513,"featured":511,"headerVariant":517,"image":518,"keywords":518,"meta":519,"navigation":520,"ogDescription":521,"ogTitle":518,"path":522,"readTime":518,"schemaOrg":523,"schemaType":524,"seo":525,"sitemap":526,"stem":527,"tags":528,"twitterCard":530,"__hash__":531},"blog/blog/prompts/rotate-credentials.md","Rotate Compromised Credentials with AI",{"type":7,"value":8,"toc":493},"minimark",[9,16,23,28,31,88,92,97,100,159,163,166,222,226,229,308,312,315,364,368,371,431,440,462,481],[10,11,12],"tldr",{},[13,14,15],"p",{},"If your API keys were exposed, rotate them immediately. These prompts guide you through generating new keys, updating your codebase, deploying the changes, and revoking the old keys. Speed matters because attackers can find and use exposed keys within minutes.",[13,17,18,22],{},[19,20,21],"strong",{},"Time is critical."," Exposed credentials can be found and exploited within minutes by automated scanners. Start the rotation process immediately, then use these prompts to ensure you don't miss anything.",[24,25,27],"h2",{"id":26},"emergency-rotation-checklist","Emergency Rotation Checklist",[13,29,30],{},"Use this prompt to get a prioritized rotation plan for every exposed credential. Your AI will map out where each key is used, which environments need updating, and the exact steps to rotate without causing downtime.",[32,33,35,38,45,48,70,73],"prompt-box",{"title":34},"Emergency Rotation Plan",[13,36,37],{},"I have exposed credentials that need immediate rotation. Help me create an emergency rotation plan.",[13,39,40,41],{},"Exposed credentials:\n",[42,43,44],"span",{},"List the types of credentials exposed, e.g., Stripe API key, database password, JWT secret",[13,46,47],{},"For each credential, give me:",[49,50,51,55,58,61,64,67],"ol",{},[52,53,54],"li",{},"Where to generate a new key (dashboard URL)",[52,56,57],{},"All places in the codebase that reference it",[52,59,60],{},"All deployment environments that need updating",[52,62,63],{},"Steps to update without causing downtime",[52,65,66],{},"How to verify the new key works",[52,68,69],{},"How to revoke the old key",[13,71,72],{},"Also check:",[74,75,76,79,82,85],"ul",{},[52,77,78],{},"Are there any dependent services that use this key?",[52,80,81],{},"Are there any webhooks that need updating?",[52,83,84],{},"Is this key stored in any CI/CD secrets?",[52,86,87],{},"Could this key have been used to access other resources?",[24,89,91],{"id":90},"service-specific-rotation","Service-Specific Rotation",[93,94,96],"h3",{"id":95},"stripe-key-rotation","Stripe Key Rotation",[13,98,99],{},"Paste this prompt to walk through a complete Stripe API key rotation. Your AI will find every reference to your Stripe key, guide you through the Dashboard rolling process, and ensure webhook signing secrets are also updated.",[32,101,103,106,109,123,126,146,148],{"title":102},"Rotate Stripe Keys",[13,104,105],{},"My Stripe API key was exposed and needs immediate rotation.",[13,107,108],{},"Help me:",[49,110,111,114,117,120],{},[52,112,113],{},"Find all places in the codebase using the Stripe key",[52,115,116],{},"Identify if it's the secret key (sk_) or publishable key (pk_)",[52,118,119],{},"Check if webhook signing secrets also need rotation",[52,121,122],{},"List all environments (dev, staging, prod) that need updating",[13,124,125],{},"Rotation steps:",[49,127,128,131,134,137,140,143],{},[52,129,130],{},"Go to Stripe Dashboard > Developers > API Keys",[52,132,133],{},"Click \"Roll key\" to generate new key (old key stays active briefly)",[52,135,136],{},"Update all environment variables",[52,138,139],{},"Deploy to all environments",[52,141,142],{},"Test a payment flow",[52,144,145],{},"Revoke the old key in Stripe Dashboard",[13,147,72],{},[74,149,150,153,156],{},[52,151,152],{},"Connected accounts if using Stripe Connect",[52,154,155],{},"Webhook endpoints that need new signing secrets",[52,157,158],{},"Any stored customer payment methods (they should still work)",[93,160,162],{"id":161},"aws-credentials-rotation","AWS Credentials Rotation",[13,164,165],{},"Use this prompt to safely rotate exposed AWS access keys. Your AI will identify all services using the compromised credentials, generate new keys through IAM, and guide you through a disable-then-delete process with CloudTrail monitoring.",[32,167,169,172,175,189,191,205,208,219],{"title":168},"Rotate AWS Keys",[13,170,171],{},"My AWS access keys were exposed. This is critical because AWS keys can access compute and incur massive charges.",[13,173,174],{},"Immediate actions:",[49,176,177,180,183,186],{},[52,178,179],{},"Go to AWS Console > IAM > Users > Security credentials",[52,181,182],{},"Create new access key",[52,184,185],{},"Note the secret (shown only once)",[52,187,188],{},"DO NOT delete old key yet",[13,190,108],{},[49,192,193,196,199,202],{},[52,194,195],{},"Find all places using AWS credentials in the codebase",[52,197,198],{},"Identify all services that might use these keys (EC2, S3, Lambda, etc.)",[52,200,201],{},"Check for hardcoded credentials AND environment variables",[52,203,204],{},"Update all deployment platforms",[13,206,207],{},"After updating everywhere:",[49,209,210,213,216],{},[52,211,212],{},"Disable (not delete) the old key first",[52,214,215],{},"Monitor for any errors for 24 hours",[52,217,218],{},"Then delete the old key",[13,220,221],{},"Also check CloudTrail for any suspicious activity while the key was exposed.",[93,223,225],{"id":224},"database-credential-rotation","Database Credential Rotation",[13,227,228],{},"Copy this prompt to rotate a compromised database password with zero downtime. Your AI will locate every connection string, plan a parallel-user migration strategy, and verify all services reconnect successfully.",[32,230,232,235,241,244,255,258,274,277,291,294],{"title":231},"Rotate Database Password",[13,233,234],{},"My database password was exposed. Help me rotate it safely.",[13,236,237,238],{},"Database type: ",[42,239,240],{},"Supabase/PostgreSQL/MongoDB/MySQL",[13,242,243],{},"Steps needed:",[49,245,246,249,252],{},[52,247,248],{},"Find all connection strings in the codebase",[52,250,251],{},"Identify all services connecting to this database",[52,253,254],{},"Plan for zero-downtime rotation",[13,256,257],{},"For managed databases (Supabase, PlanetScale, etc.):",[49,259,260,263,265,268,271],{},[52,261,262],{},"Create a new database password in the dashboard",[52,264,136],{},[52,266,267],{},"Deploy all services",[52,269,270],{},"Verify connections work",[52,272,273],{},"Revoke the old password",[13,275,276],{},"For self-managed databases:",[49,278,279,282,285,288],{},[52,280,281],{},"Create a new user with the same permissions",[52,283,284],{},"Update connection strings to use new user",[52,286,287],{},"Deploy and verify",[52,289,290],{},"Drop the old user",[13,292,293],{},"Check if any of these also need updating:",[74,295,296,299,302,305],{},[52,297,298],{},"Database migrations",[52,300,301],{},"Backup scripts",[52,303,304],{},"Monitoring tools",[52,306,307],{},"Data pipelines",[93,309,311],{"id":310},"openai-ai-api-key-rotation","OpenAI / AI API Key Rotation",[13,313,314],{},"Use this prompt to immediately rotate an exposed OpenAI or AI service API key. Your AI will find all usages, verify none are client-side, and help you set up usage limits and alerts to prevent costly abuse.",[32,316,318,321,323,334,336,350,353],{"title":317},"Rotate AI Service Keys",[13,319,320],{},"My OpenAI (or other AI service) API key was exposed. These keys can rack up costs quickly.",[13,322,174],{},[49,324,325,328,331],{},[52,326,327],{},"Go to OpenAI dashboard > API Keys",[52,329,330],{},"Create a new key",[52,332,333],{},"Delete the exposed key IMMEDIATELY (no grace period needed)",[13,335,108],{},[49,337,338,341,344,347],{},[52,339,340],{},"Find all places using the AI API key",[52,342,343],{},"Ensure the key is only used server-side",[52,345,346],{},"If any client-side usage exists, fix that architecture",[52,348,349],{},"Add rate limiting to prevent abuse",[13,351,352],{},"Also:",[74,354,355,358,361],{},[52,356,357],{},"Check OpenAI usage dashboard for unexpected charges",[52,359,360],{},"Set up usage limits and alerts",[52,362,363],{},"Consider using project-specific keys if available",[24,365,367],{"id":366},"post-rotation-verification","Post-Rotation Verification",[13,369,370],{},"Copy this prompt after rotating your credentials to verify everything is working. Your AI will check all integrations, confirm old keys are revoked, and test critical flows like authentication, payments, and webhooks.",[32,372,374,377,380,397,400,417,420],{"title":373},"Verify Rotation Complete",[13,375,376],{},"I've rotated my credentials. Help me verify everything is working and secure.",[13,378,379],{},"Check:",[49,381,382,385,388,391,394],{},[52,383,384],{},"All API integrations are functioning",[52,386,387],{},"No references to old credentials remain in code",[52,389,390],{},"Old credentials are revoked/deleted",[52,392,393],{},"Git history doesn't need cleaning (for public repos)",[52,395,396],{},"No other credentials were exposed alongside this one",[13,398,399],{},"Test these flows:",[74,401,402,405,408,411,414],{},[52,403,404],{},"Authentication",[52,406,407],{},"Payment processing (if applicable)",[52,409,410],{},"Third-party API calls",[52,412,413],{},"Database connections",[52,415,416],{},"File storage access",[13,418,419],{},"Also verify:",[74,421,422,425,428],{},[52,423,424],{},"CI/CD pipelines can still deploy",[52,426,427],{},"Monitoring and logging still work",[52,429,430],{},"Webhooks are still receiving events",[432,433,434],"tip-box",{},[13,435,436,439],{},[19,437,438],{},"Pro tip:"," After rotation, set a reminder to check your service dashboards in 24-48 hours for any unusual activity that might indicate the old key was used before rotation.",[441,442,443,450,456],"faq-section",{},[444,445,447],"faq-item",{"question":446},"How quickly should I rotate a compromised API key?",[13,448,449],{},"Immediately. Automated bots scan for exposed credentials and can exploit them within minutes. The longer you wait, the more potential damage.",[444,451,453],{"question":452},"Do I need to rotate keys that were only briefly exposed?",[13,454,455],{},"Yes. Even brief exposure is enough for automated scanners to capture credentials. Treat any exposed key as compromised and rotate it.",[444,457,459],{"question":458},"How do I rotate keys without downtime?",[13,460,461],{},"Most services allow multiple active keys. Generate a new key, update your application, verify it works, then revoke the old key. This allows zero-downtime rotation.",[463,464,465,471,476],"related-articles",{},[466,467],"related-card",{"description":468,"href":469,"title":470},"Prevent future exposure","/blog/prompts/fix-exposed-api-keys","Fix Exposed API Keys",[466,472],{"description":473,"href":474,"title":475},"Detect exposures automatically","/blog/prompts/secret-scanning-setup","Set Up Secret Scanning",[466,477],{"description":478,"href":479,"title":480},"Full incident handling guide","/blog/checklists/incident-response-checklist","Incident Response Checklist",[482,483,486,490],"cta-box",{"href":484,"label":485},"/","Start Free Scan",[24,487,489],{"id":488},"prevent-future-exposures","Prevent Future Exposures",[13,491,492],{},"Set up continuous scanning to catch exposed credentials before attackers do.",{"title":494,"searchDepth":495,"depth":495,"links":496},"",2,[497,498,505,506],{"id":26,"depth":495,"text":27},{"id":90,"depth":495,"text":91,"children":499},[500,502,503,504],{"id":95,"depth":501,"text":96},3,{"id":161,"depth":501,"text":162},{"id":224,"depth":501,"text":225},{"id":310,"depth":501,"text":311},{"id":366,"depth":495,"text":367},{"id":488,"depth":495,"text":489},"prompts","2026-02-23","2026-03-06","Emergency AI prompts for rotating compromised API keys and credentials. Step-by-step guidance for Stripe, AWS, OpenAI, and other services.",false,"md",[514,515,516],{"question":446,"answer":449},{"question":452,"answer":455},{"question":458,"answer":461},"cyan",null,{},true,"Emergency AI prompts for rotating compromised API keys and credentials.","/blog/prompts/rotate-credentials","[object Object]","BlogPosting",{"title":5,"description":510},{"loc":522},"blog/prompts/rotate-credentials",[529],"Emergency","summary_large_image","Gl0ttTfbN9gpp3kc8Mz9gz-z5weCfbzEsESzvwLhQ7o",1775843938439]