This prompt is built for release engineers and platform teams who need to move beyond a manual, line-by-line review of feature flag configuration changes. The core job-to-be-done is connecting a raw configuration diff to its real-world runtime impact before the change is merged and deployed. It requires three specific inputs to be effective: the configuration diff itself (e.g., from a Git PR), the flag's code references (showing where the flag is evaluated in the codebase), and the intended rollout plan (targeting rules, percentage, and schedule). Without these, the analysis will be speculative and low-confidence. The ideal user is someone who can provide this context and is responsible for preventing incidents like a mistyped userId attribute exposing a beta feature to a production audience.
Prompt
Feature Flag Configuration Change Analysis Prompt

When to Use This Prompt
Identifies the specific workflows, users, and conditions where this feature flag analysis prompt delivers reliable, structured risk assessment, and where it should not be applied.
The prompt is designed for high-signal, structured output. It produces a risk-ranked analysis covering four specific areas: targeting rule correctness (e.g., detecting a typo in a user attribute), stale flag detection (identifying flags that are 100% rolled out and safe to remove), conflicting flag combinations (finding two flags that control the same code path with contradictory states), and high-risk code path exposure (flagging a flag that gates a critical payment or authentication flow). This is not a general-purpose code review tool. It is a specialized instrument for a specific class of high-severity misconfiguration. Use it in automated PR checks, pre-deployment review checklists, and technical debt sprints focused on flag cleanup.
Do not use this prompt for reviewing application code logic, assessing algorithmic complexity, or evaluating UI changes. It is not a substitute for a full code review, nor is it designed to reason about feature flag SDK behavior or evaluate the performance of a flag evaluation service. Its value is strictly in analyzing the configuration and its relationship to the code and rollout plan. For high-risk flags controlling revenue-critical paths or user data access, the prompt's output should be treated as a structured input to a mandatory human approval step, not as an automated gate that can pass or fail a deployment on its own. The next step after generating this analysis is to integrate it into your CI/CD pipeline as a non-blocking comment on the PR, allowing the on-call engineer to make the final judgment.
Use Case Fit
Where the Feature Flag Configuration Change Analysis Prompt delivers reliable, structured risk assessment and where it should be replaced by programmatic checks, human review, or alternative workflows.
Good Fit: Flag Rollout Impact Assessment
Use when: release engineers need to understand the blast radius of a targeting rule change before deployment. The prompt excels at mapping flag modifications to affected code paths, user segments, and dependent services. Guardrail: always provide the flag configuration diff, the codebase context for the flag's evaluation points, and the expected rollout percentage.
Good Fit: Stale Flag Cleanup Identification
Use when: teams need to identify feature flags that are fully rolled out, deprecated, or no longer referenced in code. The prompt cross-references flag definitions against codebase usage and rollout status. Guardrail: pair the prompt output with a programmatic dead-code analysis tool to confirm removal safety before deleting flag definitions.
Bad Fit: Real-Time Flag Evaluation Decisions
Avoid when: the system needs to decide at runtime whether a flag should be toggled based on live metrics or incident signals. This prompt is a pre-deployment analysis tool, not a runtime decision engine. Guardrail: use circuit-breaker automation or manual runbooks for production flag toggles; reserve this prompt for change review workflows.
Bad Fit: Flag SDK or Library Implementation Review
Avoid when: the task requires auditing the feature flag SDK code, evaluating library performance, or assessing flag evaluation latency. This prompt analyzes configuration semantics and code references, not SDK internals. Guardrail: route SDK-level reviews to the PR Diff Review or Code Smell Detection prompts instead.
Required Inputs: Flag Diff, Code Context, and Ownership Map
Risk: incomplete or stale inputs produce false confidence. The prompt needs the exact configuration diff, the code locations where the flag is evaluated, and the team or service ownership map. Guardrail: validate that the diff is from the target environment's source of truth and that code references are current on the main branch before invoking the prompt.
Operational Risk: Conflicting Flag Combinations
Risk: multiple flags controlling overlapping code paths can interact in ways the prompt misses if flags are analyzed in isolation. A change to one flag may appear safe while creating a broken state when combined with another flag's current targeting. Guardrail: always include the full set of active flags affecting the same service or code path in the analysis context, not just the single flag being changed.
Copy-Ready Prompt Template
Paste this prompt into your AI system to analyze feature flag configuration changes for rollout risk, stale flags, and conflicting targeting rules.
The prompt below is designed to be copied directly into your AI harness. It expects a feature flag configuration diff, a flag registry or catalog for context, and a defined output schema. Replace every square-bracket placeholder with real values before execution. The prompt instructs the model to produce structured JSON suitable for downstream CI/CD checks, release gates, or review dashboards.
textYou are a release engineering analyst reviewing a feature flag configuration change. ## INPUT Flag Configuration Diff: [FLAG_CONFIG_DIFF] Flag Registry Context (current flag catalog with metadata): [FLAG_REGISTRY_CONTEXT] ## TASK Analyze the configuration diff and produce a structured rollout impact assessment. ## OUTPUT SCHEMA Return valid JSON matching this schema: { "change_summary": "string (one-sentence summary of what changed)", "targeting_rule_changes": [ { "flag_name": "string", "change_type": "ADDED | MODIFIED | REMOVED", "previous_rule": "string | null", "new_rule": "string | null", "affected_segments": ["string"], "rollout_percentage_change": "number (percentage point change, positive or negative)", "risk_level": "LOW | MEDIUM | HIGH | CRITICAL", "risk_rationale": "string" } ], "stale_flag_candidates": [ { "flag_name": "string", "staleness_indicator": "string (e.g., 100% rolled out for >30 days, targeting removed, kill switch unused)", "recommended_action": "REMOVE | ARCHIVE | INVESTIGATE" } ], "conflicting_flag_combinations": [ { "flag_pair": ["string", "string"], "conflict_description": "string", "affected_code_paths": ["string"], "severity": "LOW | MEDIUM | HIGH | CRITICAL" } ], "high_risk_code_path_flags": [ { "flag_name": "string", "controlled_code_path": "string", "risk_description": "string", "requires_manual_approval": true } ], "overall_rollout_recommendation": "PROCEED | PROCEED_WITH_CAUTION | STAGED_ROLLOUT_REQUIRED | BLOCK", "recommended_staged_rollout_plan": "string | null (if staged rollout recommended, describe sequence and monitoring gates)", "evidence_links": ["string (references to specific diff lines or registry entries)"] } ## CONSTRAINTS - Only report findings grounded in the provided diff and registry context. Do not invent flags, rules, or code paths. - For each HIGH or CRITICAL risk finding, include a specific evidence link to the diff line or registry entry. - If a flag controls payment, authentication, data deletion, or user permission code paths, mark it as high-risk and set requires_manual_approval to true. - Stale flag detection: flag any flag that has been at 100% rollout for more than 30 days, has had its targeting rules removed entirely, or is a kill switch that has never been triggered in the last 90 days. - Conflicting flag detection: identify pairs of flags whose targeting rules overlap and control the same code path or feature surface, creating unpredictable behavior. - If no issues are found in a category, return an empty array. - Do not speculate about runtime behavior beyond what the configuration controls. ## EXAMPLES [FEW_SHOT_EXAMPLES] ## RISK LEVEL [HIGH_RISK_DOMAINS]
Adaptation guidance: Replace [FLAG_CONFIG_DIFF] with the actual diff output from your flag management system (LaunchDarkly, Split, Flagsmith, or custom). Populate [FLAG_REGISTRY_CONTEXT] with a structured dump of current flag metadata including rollout percentages, creation dates, last modified timestamps, and owning teams. [FEW_SHOT_EXAMPLES] should contain 2-3 annotated examples of correct output for your organization's flag patterns. [HIGH_RISK_DOMAINS] should list your organization's critical code paths (e.g., "billing, auth, user_data_deletion, admin_permissions"). If your flag system uses custom terminology, adjust the schema field descriptions accordingly.
Before shipping: Validate the output JSON against the schema. Run this prompt against 10-20 known flag changes with expected outcomes and measure precision/recall on stale flag detection and conflict identification. Flag any CRITICAL or BLOCK findings for human review before automated gating. Log every invocation with the diff hash, model version, and output for auditability.
Prompt Variables
Every placeholder required by the Feature Flag Configuration Change Analysis Prompt. Use these to wire the prompt into your CI/CD pipeline, release checklist, or code review tool. Each variable maps to a specific input source and has a concrete validation check before the prompt runs.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[FLAG_CONFIG_DIFF] | The unified diff of the feature flag configuration file changes, showing additions, deletions, and modifications to flag definitions and targeting rules. | diff --git a/flags/production.yaml b/flags/production.yaml @@ -12,7 +12,7 @@ flags: enable-new-checkout:
| Parse check: must be valid unified diff format. Schema check: must contain at least one flag definition change. Null allowed: false. Retry condition: if diff is empty or whitespace-only, abort and request valid input. |
[FLAG_SYSTEM] | The feature flag management system or service in use, which determines the semantics of targeting rules, rollout percentages, and kill switch behavior. | LaunchDarkly | Parse check: must be a non-empty string matching a known flag system. Enum check: accepted values include LaunchDarkly, Split.io, Flagsmith, Unleash, ConfigCat, or custom. Null allowed: false. Retry condition: if unrecognized system, prompt model to request clarification. |
[CURRENT_FLAG_STATE] | The full current state of all feature flags in the target environment before the change, used to detect stale flags and conflicting combinations. | flags: enable-new-checkout: rollout: 10 targeting: - attribute: beta op: in values: [internal] legacy-ui: enabled: true | Parse check: must be valid YAML or JSON. Schema check: must contain at least one flag definition with a rollout or enabled field. Null allowed: false. Retry condition: if state is identical to proposed state, flag as no-op change. |
[CODE_PATHS_AFFECTED] | A mapping of feature flag names to the code paths, services, or modules they control, used to assess the blast radius and risk of each flag change. | enable-new-checkout: [checkout-service, payment-gateway, cart-api] legacy-ui: [frontend-app, component-library] | Parse check: must be valid YAML or JSON with string keys and array values. Schema check: every flag name in the diff must have at least one code path entry. Null allowed: false. Retry condition: if a changed flag has no mapped code paths, flag as high-risk unknown. |
[DEPLOYMENT_CONTEXT] | The target environment and release context for the flag change, including whether this is a staged rollout, emergency change, or scheduled release. | environment: production release_type: scheduled stage: canary-1 change_window: 2025-01-15T02:00:00Z | Parse check: must be valid YAML or JSON with environment and release_type fields. Schema check: environment must be one of production, staging, development, or DR. Null allowed: false. Retry condition: if environment is production and release_type is emergency, escalate risk level. |
[OUTPUT_SCHEMA] | The expected JSON schema for the analysis output, defining the structure for findings, risk levels, recommendations, and required approvals. | { "findings": [{ "flag_name": "string", "change_type": "rollout_increase | targeting_change | new_flag | removal", "risk_level": "low | medium | high | critical", "affected_services": ["string"], "blast_radius": "narrow | moderate | wide", "conflicting_flags": ["string"], "stale_flag_candidate": true, "recommendation": "string", "requires_approval": true }], "summary": "string", "overall_risk": "low | medium | high | critical" } | Parse check: must be valid JSON Schema or example JSON. Schema check: must include findings array, summary string, and overall_risk enum. Null allowed: false. Retry condition: if model output does not conform to this schema, trigger output repair prompt. |
[CONSTRAINTS] | Operational constraints and policies that govern flag changes, such as maximum rollout step size, required approval thresholds, and forbidden flag combinations. | max_rollout_increase_percent: 20 require_approval_above: high forbidden_combinations:
| Parse check: must be valid YAML or JSON. Schema check: must include max_rollout_increase_percent as integer, require_approval_above as risk enum, and stale_flag_days_threshold as integer. Null allowed: true. Retry condition: if constraints are null, model should apply conservative defaults. |
[INCIDENT_HISTORY] | Recent incident records related to the affected services or flags, used to detect patterns of instability and adjust risk assessment accordingly. | incidents:
| Parse check: must be valid YAML or JSON with an incidents array. Schema check: each incident must have service, date, severity, and description fields. Null allowed: true. Retry condition: if null, model should note absence of history but not reduce risk assessment. |
Implementation Harness Notes
How to wire the Feature Flag Configuration Change Analysis Prompt into a PR review pipeline, CI/CD workflow, or release management system.
This prompt is designed to be called programmatically as a gate in your CI/CD pipeline, triggered by pull requests that modify feature flag configuration files (e.g., YAML, JSON, TOML in a flags/ directory). The harness should extract the raw diff from the PR, pass it as the [FLAG_CONFIG_DIFF] input, and provide the full current flag state as [CURRENT_FLAG_STATE] to enable stale flag and conflict detection. The model's structured output—a JSON object containing rollout_impact, stale_flag_candidates, conflicting_flags, and high_risk_path_flags—must be parsed and acted upon by subsequent pipeline steps, not just displayed as a comment.
To integrate this into a production system, wrap the model call in a thin service that handles retries, validation, and logging. Use a strict JSON schema validator (e.g., jsonschema in Python or zod in TypeScript) to ensure the model's output conforms to the expected structure before it is consumed. If validation fails, implement a single retry with a repair prompt that includes the validation error message. Log the raw prompt, the model's response, and the validation result to your observability platform for trace analysis. For high-risk flags—those controlling payment processing, authentication, or data deletion paths—the harness should automatically add a requires_human_approval: true label to the PR and block the merge until a designated release engineer acknowledges the rollout_impact assessment.
Model choice matters here: use a model with strong JSON mode and reasoning capabilities, such as claude-3-5-sonnet or gpt-4o, because the analysis requires cross-referencing multiple flag rules and inferring runtime behavior from configuration alone. Do not use a lightweight model for this task; the cost of a missed conflicting flag or a stale flag controlling a deprecated code path is far higher than the token cost. The harness should also implement a caching layer: if the [CURRENT_FLAG_STATE] has not changed since the last analysis, reuse the cached context to reduce latency and cost. Finally, ensure the harness posts the structured findings as a PR comment with a summary table and links to the full JSON payload, so reviewers can quickly see the blast radius without reading raw configuration diffs.
Expected Output Contract
The exact JSON structure, field types, validation rules, and pass/fail conditions for the Feature Flag Configuration Change Analysis output. Use this contract to validate model responses before they enter downstream systems.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
analysis_id | string (UUID v4) | Must parse as valid UUID v4. Regenerate on retry if missing or malformed. | |
flag_changes | array of objects | Array must contain at least 1 item. Each item must conform to the flag_change_object schema below. | |
flag_changes[].flag_key | string | Must match the pattern ^[a-zA-Z0-9_-.]+$. Must correspond to a flag present in [INPUT_DIFF]. | |
flag_changes[].change_type | enum: created | modified | deleted | targeting_updated | rollout_progressed | stale_cleanup_candidate | Must be one of the listed enum values. stale_cleanup_candidate requires evidence of zero active targeting rules or 100% rollout with no kill switch. | |
flag_changes[].risk_level | enum: low | medium | high | critical | critical requires the flag to gate a high-risk code path as defined in [RISK_PATH_REGISTRY]. high requires blast radius > 2 services or a kill-switch removal. | |
flag_changes[].conflicting_flags | array of strings | If present, each string must be a flag_key that appears in [ACTIVE_FLAG_INVENTORY]. Null or empty array allowed when no conflicts detected. | |
flag_changes[].rollout_impact_summary | string (max 280 chars) | Must be non-empty. Must reference at least one affected service, user segment, or environment from [SERVICE_MAP]. No markdown allowed. | |
overall_assessment | object | Must contain fields: go_recommendation (enum: proceed | proceed_with_caution | hold), critical_findings_count (integer >= 0), requires_human_approval (boolean). |
Common Failure Modes
What breaks first when analyzing feature flag configuration changes in production and how to guard against each failure.
Stale Flag Blindness
What to watch: The model treats a flag that has been 100% rolled out for 6 months as an active configuration change, recommending unnecessary rollback plans or risk analysis. This wastes review time and creates noise. Guardrail: Pre-process the diff to filter out flag changes where the targeting rules have been static for more than 30 days and the rollout percentage is already at 100%. Only pass active or recently modified flags to the prompt.
Cross-Flag Conflict Miss
What to watch: The model analyzes each flag change in isolation and misses that two flags control overlapping code paths. Flag A disables a feature while Flag B enables a dependent experiment, creating an untested state. Guardrail: Include a dependency map or flag registration manifest in the prompt context. Add an explicit instruction to check for overlapping targeting rules and flag-to-flag dependencies before producing the final assessment.
Targeting Rule Misinterpretation
What to watch: The model misreads complex targeting rule logic—especially percentage rollouts with multiple user segments, AND/OR nesting, or attribute-based rules—and produces an incorrect blast radius estimate. Guardrail: Require the prompt to output a structured breakdown of affected user segments with explicit counts or percentages. Validate the output against a deterministic rule evaluator before accepting the impact assessment.
High-Risk Code Path Omission
What to watch: The model fails to identify that a flag controls a payment processing path, authentication flow, or data deletion operation because it lacks runtime context about which code paths are gated. Guardrail: Provide a pre-defined registry of high-risk code paths and their associated flag keys as part of the system prompt. Instruct the model to cross-reference every changed flag against this registry and escalate matches to human review.
Rollout Percentage Arithmetic Error
What to watch: The model miscalculates the net effect of a percentage change—for example, treating a change from 5% to 10% as a 100% increase in exposure rather than a 5 percentage point increase—leading to inflated risk severity. Guardrail: Add a structured output field that requires the model to show its math: old percentage, new percentage, absolute delta, and relative delta. Apply a post-processing validation rule that flags any assessment where the severity label doesn't match the calculated delta.
Kill Switch Over-Recommendation
What to watch: The model defaults to recommending a kill switch or immediate rollback for any flag change touching a production path, even when the change is a gradual rollout increase with monitoring in place. This creates alarm fatigue and slows legitimate releases. Guardrail: Include a risk tolerance policy in the prompt that defines when a kill switch is warranted versus when monitoring and gradual rollout are sufficient. Require the model to justify any kill switch recommendation with a specific, evidence-backed failure scenario.
Evaluation Rubric
How to test output quality before shipping this prompt. Run these checks against a golden dataset of known flag changes with expected findings.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Flag Targeting Rule Change Detection | All modified targeting rules in the diff are identified with the correct flag key and rule type | Missing a modified rule or misidentifying the rule type (e.g., percentage rollout vs. user segment) | Diff against golden set of 20 flag config changes with known targeting modifications; require 100% recall on rule identification |
Stale Flag Cleanup Opportunity Identification | Flags meeting staleness criteria (no code references, 100% rollout > 90 days) are flagged with supporting evidence | Flagging active flags as stale or missing flags with zero code references and full rollout | Run against 15 known stale and 15 known active flags; require precision >= 0.90 and recall >= 0.95 |
Conflicting Flag Combination Detection | All flag pairs with overlapping targeting or contradictory default states are identified with conflict explanation | Missing a known conflict pair or reporting a false conflict between independent flags | Test against 10 known conflicting flag pairs and 10 non-conflicting pairs; require 100% recall on true conflicts and <= 1 false positive |
High-Risk Code Path Flag Identification | Flags controlling payment, auth, data deletion, or PII exposure paths are correctly classified as high-risk | Classifying a low-risk UI flag as high-risk or missing a flag that gates a payment processing code path | Run against 25 flags with known code path risk labels; require F1 score >= 0.92 on high-risk classification |
Rollout Impact Assessment Completeness | Each changed flag includes affected user percentage, environment scope, and rollback complexity rating | Output missing affected user count, environment scope, or rollback complexity for any changed flag | Schema validation: assert [OUTPUT_SCHEMA] field presence for all changed flags; null allowed only for rollback_complexity with explicit 'unknown' reason |
Evidence Grounding and Source Attribution | Every finding includes a reference to the specific config line, code path, or flag evaluation point | Finding stated without a source reference or reference points to an unrelated config block | Parse output for source_reference field on all findings; assert non-empty and matches a valid line range in the input diff |
False Positive Rate on Unchanged Flags | No findings reported for flags not present in the configuration diff | Flag listed in findings but absent from the input diff or unchanged from previous state | Inject 5 unchanged flags into test diffs; assert zero findings generated for unchanged flags |
Output Schema Conformance | Output matches [OUTPUT_SCHEMA] exactly: all required fields present, correct types, enums match allowed values | Missing required field, wrong type, or enum value outside allowed set | Validate output against JSON Schema definition; retry prompt once on validation failure, then flag for human review |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Add strict JSON output schema, multi-platform comparison, stale flag detection with age thresholds, and conflicting flag combination checks. Include retry logic for malformed output and log each analysis run with flag version and reviewer identity.
codeAnalyze the following feature flag configuration changes across [PLATFORMS]. Input: [FLAG_CONFIG_DIFF] Output a JSON object with: - "targeting_changes": array of {flag, rule_before, rule_after, affected_segments, rollout_percentage_delta} - "stale_flags": array of {flag, days_since_last_modified, suggested_action} - "conflicting_combinations": array of {flag_pair, conflict_description, shared_code_paths} - "high_risk_flags": array of {flag, controlled_paths, blast_radius_services} - "overall_risk_score": "low" | "medium" | "high" | "critical" Constraints: - Flag staleness threshold: [STALE_DAYS] days - Require evidence for each high-risk code path claim - Flag any rollout percentage change exceeding [ROLLOUT_THRESHOLD]%
Watch for
- Silent format drift when models change output structure
- Missing human review gate for flags controlling auth, billing, or data pipelines
- False positives on flags intentionally kept at 0% or 100% for operational toggles

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us