An Environment Config Review Prompt That Catches Drift Early
An environment config review prompt diffs two env configs, ranks the drift by severity, and returns a parity plan, so 'works on my machine' stops shipping.
"Works in dev, breaks in prod" is almost never about the machine. It's about the config: a timeout that's 30 seconds in staging and 5 in production, a feature flag on in one place and off in another, an env var that exists in dev and silently doesn't in prod. An environment config review prompt finds those mismatches before they find you, by diffing two configs and telling you which differences are dangerous.
Environment configuration drift is when environments that should behave alike quietly diverge, through manual edits, ad-hoc fixes, and copy-paste config that aged differently. The bug ships through testing because staging didn't have the production setting that triggers it.
This is the job the Environment Parity Harness Pack runs end-to-end. The single prompt below is its core.
Why a raw diff isn't enough
OneUptime has a good environment parity guide with six steps and a validate-parity.sh script that compares database schemas. They also cover environment drift issues. Upsun writes about the repro gap and environment parity.
The advice is sound: containerize, use IaC, validate on a schedule. But the scripts and tooling stop at structural comparison. A schema diff tells you a column differs; it doesn't tell you that the differing connection-pool size is what's causing prod timeouts under load. And plenty of app config never lives in IaC at all. The gap is judgment: which of these forty differences actually matters? The prompt ranks them.
Most drift detection fails not because it misses differences but because it reports too many. Environments are supposed to differ in places, hostnames, scaling, secrets. A tool that flags all of them equally trains you to ignore the output. The useful question isn't "what's different," it's "what's different that shouldn't be." That's a judgment call, and it's exactly what a well-prompted model is good at.
What you can do with this prompt
- Diff two environment configs and get differences grouped by type
- Rank each difference by severity, expected, suspicious, or likely bug
- Flag missing variables that exist in one environment and not the other
- Spot value mismatches that commonly cause production-only failures
- Get a parity plan: what to align, and guardrails to stop it drifting again
- Run the same review for dev-vs-staging or staging-vs-prod without rewriting it
Anatomy of the prompt
Variables
{{env_a_config}} – the first environment's config (e.g. staging)
{{env_b_config}} – the second environment's config (e.g. prod)
{{expected_diffs}} – differences that are intentional (hosts, scale)
{{stack_notes}} – what the service is sensitive to (timeouts, pools)
Prompt
Role: platform engineer reviewing environment parity.
Diff the configs. Classify each difference: expected, suspicious, or
likely-bug. Ignore intentional diffs. Propose a parity plan + guardrails.
Output contract (locked)
## Drift findings (table: key, env A, env B, severity)
## Likely-bug differences (with reasoning)
## Parity plan
## Guardrails to prevent recurrence
The {{expected_diffs}} variable is what suppresses the noise. Tell the prompt that hostnames and replica counts are supposed to differ, and it stops flagging them, leaving the suspicious ones visible.
How to run it
1. Export both configs
Pull {{env_a_config}} and {{env_b_config}} in the same format, env files, rendered Helm values, whatever you've got. Matching formats make the diff cleaner.
2. Declare the intentional differences
{{expected_diffs}} is the noise filter. List the keys that are meant to differ. Skip this and you'll get a report that flags every hostname and trains you to ignore it.
3. Add stack sensitivity notes
{{stack_notes}} tells the prompt what your service actually cares about. If connection-pool size has bitten you before, say so, and the prompt will weight it.
4. Read the likely-bug findings first
The severity ranking is the point. Start with "likely-bug," confirm each one, then skim "suspicious." The "expected" bucket is just there to show its work.
5. Apply the parity plan and a guardrail
Fixing the drift once is half the job. The guardrails section is what stops it recurring, a CI check, a single source of truth, a locked-down prod.
Model behavior worth knowing
Claude is strong at the classification step: given {{stack_notes}}, it reasons about why a difference matters rather than just listing it, and it respects {{expected_diffs}} to suppress noise. GPT-4o produces tidy diff tables but tends to flag everything at medium severity unless you push it to commit to "likely-bug" vs "expected." Gemini handles large config blobs well but can truncate the findings table on very long inputs, so for big configs, split the review by section.
A reliable pattern here: put both configs first, the classification instructions and output contract last. On long pasted configs, a contract stated up front gets buried under the data and the model forgets the severity buckets. Models weight recent tokens, so the format spec belongs at the end of the prompt.
Aligning two configs today feels productive. It's also temporary, because the same manual edits that caused the drift will cause it again next month. The durable win is the guardrail: a CI parity check, a single config source, locked prod access. Fix the drift, but spend the real effort on making it not come back.
Variables you'll set
| Variable | Required | What it is |
|---|---|---|
{{env_a_config}} | Yes | The first environment's config, e.g. staging |
{{env_b_config}} | Yes | The second environment's config, e.g. production |
{{expected_diffs}} | No | Differences that are intentional and should be ignored |
{{stack_notes}} | No | What the service is sensitive to (timeouts, pools) |
Getting started
- Copy the prompt skeleton into ChatGPT, Claude, or Gemini.
- Paste both configs into
{{env_a_config}}and{{env_b_config}}. - List the intentional differences in
{{expected_diffs}}. - Run it and read the likely-bug findings first.
- Apply the parity plan to align the dangerous diffs.
- Add one guardrail so the drift doesn't recur.
- Reuse the prompt for the next environment pair.
Config drift is a sibling of infrastructure drift, so the Terraform drift detection prompt covers the IaC layer this prompt deliberately leaves alone. And when an environment-only failure does ship, the CI failure diagnosis prompt helps trace it back to the config difference that caused it.
Browse the devops and config prompt packs →The Environment Parity Harness Pack runs this as a four-prompt workflow: detect drift across dev, CI, and prod, then generate a parity plan and a guardrail proposal through its companion prompts, so the works-in-dev-breaks-in-prod bug gets traced to the exact mismatched setting. At $5 it's one of the lower-priced packs, and it's part of The Complete AI Prompts Bundle, a one-time lifetime license to the whole catalog plus every future pack.
Config that drifts often hides secrets that drift with it, so the Polyglot Secrets Management Playbook is the pack for the credential side of environment hygiene. Between parity and secrets, the gap between staging and prod stops being where bugs hide.
See the Polyglot Secrets Management Playbook →Common questions
What is an environment config review prompt?
Why not just diff the config files manually?
Does this replace tools like driftctl or Terraform plan?
Get the prompt packs this guide is built on
Ready-to-paste prompts with documented variables and usage guides for ChatGPT, Claude, and Gemini. One-time payment, own it forever.
More prompt guides

Gemini vs Claude for Long-Context Code: Window or Accuracy
The honest framing of Gemini vs Claude for long-context code isn't which model is smarter. It's a tradeoff between two different things: how much code you can fit in one prompt, and how often the mode…

An OKR Drafting Prompt That Catches Vanity Key Results
An OKR drafting prompt has to fight the model's strongest instinct: handing back something that sounds like a goal but can't be measured. Ask any model for key results and you'll get "increase user en…

A Technical Design Doc Prompt That Holds the RFC Structure
A technical design doc prompt earns its keep when it stops every author from inventing a new doc structure. Context, the options you considered, why you picked one, what breaks, how you roll it out. S…