Skip to main content

Prod.keys Switch Page

{ "environment": "dev", "api_keys": { "ai_provider": "dev_sk_test_123", "payment_gateway": "dev_pk_test_456" } } She knew the routine. Never, ever commit prod keys to code. Instead, the system used a —an environment variable called PROD_KEYS_ENABLED . When set to false , the app used dev keys. When set to true , it reached into a locked, encrypted vault and loaded the real production keys.

She needed to roll back, but there was a problem: if she simply reverted the code, the prod.keys switch would still be true . The old AI provider’s prod key was already deleted from the vault. Without it, the app would crash entirely. prod.keys switch

Maya was the lead site reliability engineer for a fast-growing gift marketplace called PresentsPass . Every December, traffic spiked. This year, the company had a new feature: "Smart Wishlist," which used a third-party AI to predict what a user’s friend might like. When set to false , the app used dev keys

deploy --service=wishlist --prod-keys-switch=false The switch flipped to OFF . The app instantly fell back to using dev_sk_test_123 —the fake key. The AI calls failed gracefully, and Wishlist displayed a polite message: "Gift ideas temporarily unavailable. Shop our curated collections!" The old AI provider’s prod key was already