This prompt is for infrastructure and reliability engineers who need to verify that data, configuration, or application state is consistent across multiple regions after a replication change, deployment, or failover event. The job-to-be-done is a post-action verification step: you have already collected state snapshots from two or more regions and now need a structured, diffable report to declare the system consistent before resuming normal operations. The ideal user is an SRE, platform engineer, or DBA who understands the replication topology and can gather raw state data but wants the model to perform the analytical comparison, flagging replication lag, data conflicts, and missing records.
Prompt
Multi-Region Consistency Verification Prompt

When to Use This Prompt
Defines the specific job, ideal user, and required context for the multi-region consistency verification prompt, and clarifies when not to use it.
Use this prompt only when you have complete, pre-collected state snapshots from each target region. The prompt assumes the raw data is already gathered and formatted for comparison; it does not connect to live systems, run queries, or perform real-time monitoring. It is a verification gate, not a monitoring tool. This workflow is appropriate for scheduled consistency checks after a maintenance window, a failover test, or a replication topology change. Do not use this prompt for continuous real-time drift detection, as it lacks the timing precision and stateful connection required for operational monitoring. For real-time checks, integrate a dedicated observability pipeline and use this prompt only for point-in-time human-reviewed verification.
Before executing this prompt, ensure you have defined your consistency tolerances. The prompt's value depends on clear constraints: acceptable replication lag windows, conflict resolution rules, and a definition of what constitutes a 'missing' versus 'delayed' record. Without these, the model will apply generic heuristics that may not match your system's operational reality. After receiving the output, a human must review any flagged discrepancies before taking corrective action. This prompt is a decision-support tool, not an autonomous remediator. The next step is to wire the output into your incident review or change approval process, not directly into an automated rollback pipeline.
Use Case Fit
Where the Multi-Region Consistency Verification Prompt works, where it breaks, and what you must provide before wiring it into a production harness.
Good Fit: Post-Replication State Validation
Use when: you need a structured per-region comparison after a replication event, config push, or failover test. The prompt excels at generating diff reports with lag detection and conflict flags. Guardrail: always scope the comparison to a specific time window and set of resources to prevent unbounded analysis.
Bad Fit: Real-Time Consistency Enforcement
Avoid when: you need sub-second consistency guarantees or synchronous write confirmation. This prompt verifies state after the fact; it does not enforce consistency during transactions. Guardrail: pair this prompt with application-level quorum checks and do not use it as a commit gate.
Required Inputs: Region Snapshots and Timestamps
What to watch: the prompt cannot operate on vague descriptions. It requires structured per-region state snapshots, collection timestamps, and expected replication lag windows. Guardrail: build a pre-fetch harness that collects canonical state from each region's API before invoking the prompt. Reject invocation if any region's data is stale or missing.
Operational Risk: False Positives During Eventual Consistency Windows
Risk: the prompt may flag legitimate in-flight replication as a conflict if the consistency window is not configured. This generates noise and erodes trust in the verification pipeline. Guardrail: pass an explicit eventual_consistency_window_seconds parameter and instruct the model to suppress diffs for records updated within that window.
Operational Risk: Silent Failures from Partial Snapshots
Risk: if one region's snapshot fails silently or returns incomplete data, the prompt may report consistency where none exists. Guardrail: the harness must validate snapshot completeness (record counts, collection timestamps) before calling the prompt. On mismatch, escalate to a human with the partial snapshot evidence.
Escalation Boundary: Unresolvable Conflicts
Risk: the prompt identifies a conflict but cannot determine the authoritative source of truth. Letting it guess creates data corruption risk. Guardrail: define a conflict severity threshold. High-severity or multi-region conflicts must route to a human review queue with the full diff and region metadata, never auto-resolved.
Copy-Ready Prompt Template
A reusable prompt for verifying cross-region state consistency after replication changes, with placeholders for your infrastructure data.
This prompt template is designed to be copied directly into your AI harness. It expects structured input describing the expected state, observed state across multiple regions, and your specific consistency requirements. Replace every [PLACEHOLDER] with data from your infrastructure tooling—such as Terraform state outputs, AWS Config rules, or custom observability queries—before sending it to the model. The prompt is engineered to produce a structured comparison report, not a conversational summary, so it can be parsed by downstream automation.
codeYou are an infrastructure verification agent. Your task is to compare the expected state of a multi-region deployment against the observed state in each region and produce a structured consistency report. ## INPUT ### EXPECTED STATE [EXPECTED_STATE] ### OBSERVED STATE PER REGION [OBSERVED_STATE_PER_REGION] ### CONSISTENCY REQUIREMENTS [CONSISTENCY_REQUIREMENTS] ### REPLICATION TOPOLOGY [REPLICATION_TOPOLOGY] ### EVENTUAL CONSISTENCY WINDOW [EVENTUAL_CONSISTENCY_WINDOW] ## OUTPUT SCHEMA Return a JSON object with the following structure: { "report_id": "string", "generated_at": "ISO8601 timestamp", "overall_status": "consistent | inconsistent | partially_consistent", "regions": [ { "region_id": "string", "status": "consistent | lagging | divergent | unreachable", "drifted_resources": [ { "resource_id": "string", "expected_value": "string", "observed_value": "string", "drift_type": "missing | extra | value_mismatch | stale", "severity": "critical | warning | informational" } ], "lag_seconds": "number | null", "last_sync_timestamp": "ISO8601 timestamp | null" } ], "conflicts": [ { "resource_id": "string", "conflict_type": "write_conflict | split_brain | ordering_violation", "regions_involved": ["string"], "description": "string", "recommended_resolution": "string" } ], "remediation_summary": "string", "requires_human_review": "boolean" } ## CONSTRAINTS - Compare every resource in EXPECTED_STATE against every region in OBSERVED_STATE_PER_REGION. - If a resource is missing from a region and the last sync timestamp is older than the EVENTUAL_CONSISTENCY_WINDOW, classify it as `stale`, not `missing`. - Flag any region where two or more regions show divergent values for the same resource as a `split_brain` conflict. - If any region is unreachable, set its status to `unreachable` and exclude it from conflict detection. - Set `requires_human_review` to `true` if any conflict has severity `critical` or if `overall_status` is `inconsistent`. - Do not invent resource IDs or values. Only reference data present in the input. ## EXAMPLES ### Example 1: Consistent State Input: EXPECTED_STATE: { "resources": { "vpc-abc": { "cidr": "10.0.0.0/16" } } } OBSERVED_STATE_PER_REGION: { "us-east-1": { "vpc-abc": { "cidr": "10.0.0.0/16" } }, "eu-west-1": { "vpc-abc": { "cidr": "10.0.0.0/16" } } } CONSISTENCY_REQUIREMENTS: "exact_match" REPLICATION_TOPOLOGY: "active-active" EVENTUAL_CONSISTENCY_WINDOW: "30s" Output: { "overall_status": "consistent", "regions": [ { "region_id": "us-east-1", "status": "consistent", "drifted_resources": [], "lag_seconds": 0 }, { "region_id": "eu-west-1", "status": "consistent", "drifted_resources": [], "lag_seconds": 0 } ], "conflicts": [], "requires_human_review": false } ### Example 2: Lag Within Window Input: EXPECTED_STATE: { "resources": { "sg-xyz": { "rules": ["allow-443"] } } } OBSERVED_STATE_PER_REGION: { "us-east-1": { "sg-xyz": { "rules": ["allow-443"] } }, "ap-southeast-1": { "sg-xyz": { "rules": ["allow-80"] } } } CONSISTENCY_REQUIREMENTS: "exact_match" REPLICATION_TOPOLOGY: "active-passive" EVENTUAL_CONSISTENCY_WINDOW: "300s" LAST_SYNC_AP_SOUTHEAST_1: "2025-01-01T00:04:00Z" CURRENT_TIME: "2025-01-01T00:05:00Z" Output: { "overall_status": "partially_consistent", "regions": [ { "region_id": "us-east-1", "status": "consistent", "drifted_resources": [] }, { "region_id": "ap-southeast-1", "status": "lagging", "drifted_resources": [{ "resource_id": "sg-xyz", "drift_type": "stale", "severity": "warning" }], "lag_seconds": 60 } ], "conflicts": [], "requires_human_review": false } ## INSTRUCTIONS Analyze the input and return only the JSON object conforming to OUTPUT_SCHEMA. Do not include explanatory text outside the JSON.
To adapt this template, replace each placeholder with data from your infrastructure stack. [EXPECTED_STATE] should contain your Infrastructure-as-Code definition or desired configuration in a structured format (JSON works best). [OBSERVED_STATE_PER_REGION] should be populated by querying each region's control plane or state store immediately before invoking the prompt. [CONSISTENCY_REQUIREMENTS] can be a string like "exact_match" or a more detailed policy object. [REPLICATION_TOPOLOGY] should describe your architecture (e.g., "active-active", "active-passive", "multi-leader"). [EVENTUAL_CONSISTENCY_WINDOW] is the maximum acceptable replication lag in seconds. The examples demonstrate how the model should handle lag within the window versus true divergence. Wire the output JSON into a post-processing step that triggers alerts or opens a ticket if requires_human_review is true.
Before deploying, validate that your input data is complete and that the model's output conforms to the schema. A common failure mode is the model hallucinating resource IDs when the observed state is empty; the constraint to only reference input data mitigates this. For high-risk environments, always route outputs with requires_human_review: true to a human operator and log the full prompt and response for audit. Do not use this prompt for real-time transaction consistency (e.g., database row-level checks); it is designed for infrastructure configuration state, not application data integrity.
Prompt Variables
Inputs the prompt needs to work reliably. Validate these before sending the prompt. Missing or malformed inputs are the most common cause of silent failures in consistency verification.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[REGION_LIST] | Ordered list of regions to compare for consistency | ["us-east-1", "eu-west-1", "ap-southeast-1"] | Must be a JSON array of strings. Minimum 2 regions. Validate each region against a known provider region catalog. Reject if empty or contains duplicates. |
[RESOURCE_TYPE] | The infrastructure resource class being verified | "dynamodb_table" | Must be a non-empty string matching a known resource type in the provider's API. Validate against an allowlist of supported resource types. Reject unknown types. |
[RESOURCE_IDENTIFIER] | The logical or physical ID of the resource to verify across regions | "orders-table" | Must be a non-empty string. Validate format against the resource type's naming constraints. Reject if the identifier contains characters illegal for the target resource type. |
[REPLICATION_MODE] | The expected replication topology | "multi-master" | Must be one of an enum: "active-passive", "active-active", "multi-master", "global-table". Reject any value outside this set. Default to "active-passive" if null is allowed. |
[CONSISTENCY_WINDOW_SECONDS] | The maximum acceptable replication lag in seconds | 300 | Must be a positive integer. Validate range: 0 < value <= 86400. Reject negative numbers, zero, or non-integer floats. If null, default to 300 and log a warning. |
[COMPARISON_TIMESTAMP] | The point-in-time for the consistency snapshot | "2025-03-15T10:30:00Z" | Must be an ISO 8601 UTC timestamp string. Validate parseability with Date.parse(). Reject future timestamps. If null, use the current time and note it in the output. |
[CONFLICT_RESOLUTION_POLICY] | The expected conflict resolution strategy for the replication topology | "last-writer-wins" | Must be one of an enum: "last-writer-wins", "custom-lambda", "application-defined", "none". Reject unknown values. If null, default to "last-writer-wins" and flag for human review. |
[OUTPUT_SCHEMA_VERSION] | The version of the expected output schema for parsing | "v2" | Must be a non-empty string matching a supported schema version. Validate against a known set. Reject unsupported versions to prevent downstream parsing failures. |
Implementation Harness Notes
How to wire the Multi-Region Consistency Verification Prompt into an automated reliability workflow with validation, retries, and human escalation.
This prompt is designed to be called by an automation system—such as a post-replication hook, a scheduled consistency job, or an incident response runbook—not by a human typing into a chat window. The harness must supply structured, machine-readable inputs for each region's state snapshot and enforce a strict output schema so that downstream systems can parse the comparison report without manual interpretation. The primary integration points are a data collection layer that gathers region state (e.g., row counts, checksums, last-write timestamps, replication lag metrics) and a decision layer that acts on the verification result.
Input assembly: Before calling the model, collect the following for each region: a region identifier, a timestamped snapshot of key metrics (record counts, checksums, lag in seconds), and any known replication topology context (e.g., primary-region, async-replication). Format these as a JSON object matching the [REGION_STATE] placeholder. Include a [CONSISTENCY_WINDOW_SECONDS] parameter that defines the acceptable eventual-consistency threshold. The [OUTPUT_SCHEMA] placeholder should contain a strict JSON schema requiring: a per-region comparison matrix, a conflict_detected boolean, a lag_violations array of regions exceeding the window, and a recommended_action enum of proceed, hold, or escalate. Validation layer: After the model responds, validate the output against this schema. If parsing fails, retry once with the validation error injected into the [CONSTRAINTS] field. If the second attempt also fails, log the raw output and escalate to a human with a review_queue ticket containing the input snapshots and both failed responses.
Model choice and tool use: This task requires strong structured-output adherence and low hallucination on numeric comparisons. Use a model that supports strict JSON mode or function calling with a defined tool schema matching your output contract. Do not rely on free-text generation. If your infrastructure supports it, provide a calculator tool for checksum and lag comparisons rather than asking the model to perform arithmetic. Retry and escalation logic: If the model returns conflict_detected: true or recommended_action: escalate, the harness should automatically create a human-review ticket with the full comparison report, raw region snapshots, and a pre-populated severity field. Do not allow the automation to proceed past a conflict flag without human acknowledgment. Logging and audit: Log every invocation with the input snapshots, model response, validation result, and escalation decision. This audit trail is critical for post-incident review and for tuning the consistency window threshold over time.
What to avoid: Do not use this prompt for real-time transactional consistency checks where milliseconds matter—this is for near-real-time or periodic verification of eventually consistent systems. Do not skip the output schema validation step; a malformed JSON response that passes a visual check can still break downstream automation. Finally, do not treat the model's recommended_action as an executable command. The harness should treat it as a recommendation that requires a deterministic rule evaluation (e.g., if conflict_detected is true, always escalate regardless of the recommendation string).
Expected Output Contract
Defines the strict JSON schema, field types, and validation rules for the model's response when verifying multi-region consistency. Use this contract to parse, validate, and route the output in your verification harness.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
verification_id | string (UUID v4) | Must match the UUID provided in [VERIFICATION_ID]. Parse check: regex match against UUID v4 pattern. | |
overall_status | string (enum) | Must be one of: 'consistent', 'inconsistent', 'degraded', 'unknown'. Schema check: strict enum validation. Default to 'unknown' if confidence is low. | |
confidence_score | number (0.0-1.0) | Must be a float between 0.0 and 1.0. If below [CONFIDENCE_THRESHOLD], escalate for human review. Retry condition: if null or out of range, request a corrected output. | |
regions_checked | array of strings | Must contain at least 2 region codes matching the [TARGET_REGIONS] input list. Validation: array length >= 2 and all elements present in the input. | |
lag_detected | boolean | Must be true if any region's [LAST_SYNC_TIMESTAMP] differs beyond the [LAG_TOLERANCE_MS] window. Parse check: boolean type. | |
conflict_flags | array of objects | If present, each object must have 'region' (string), 'resource' (string), and 'conflict_type' (string enum: 'version_mismatch', 'missing_record', 'orphaned_record'). Null allowed if no conflicts found. | |
per_region_report | array of objects | Each object must contain 'region' (string), 'status' (string enum: 'synced', 'lagging', 'error'), and 'last_checked_iso8601' (string). Schema check: array length must equal length of regions_checked. | |
remediation_hint | string or null | If overall_status is 'inconsistent', this field must be a non-empty string. If 'consistent', it should be null. Approval required: any generated hint must be reviewed before automated execution. |
Common Failure Modes
Multi-region consistency verification fails in predictable ways. These are the most common failure modes and how to guard against them before they reach production.
Stale Snapshot Comparison
What to watch: The prompt compares a fresh snapshot from one region against a stale cached snapshot from another, producing false drift alarms. This happens when verification runs before all region snapshots are refreshed. Guardrail: Include a snapshot_timestamp field per region in the input schema and instruct the model to reject comparisons where timestamps differ by more than the configured skew tolerance window.
Eventual Consistency Window Misinterpretation
What to watch: The model flags legitimate in-flight replication lag as a consistency failure because it does not account for the configured eventual consistency window. This generates noise and erodes trust in the verification pipeline. Guardrail: Pass the consistency_window_ms parameter explicitly in the prompt context and instruct the model to classify lags within that window as status: "replicating" rather than status: "conflict".
Schema Drift Between Regions
What to watch: Regions running different schema versions produce structurally different payloads. The model misinterprets missing or extra fields as data inconsistency rather than schema mismatch, leading to incorrect conflict flags. Guardrail: Include a schema_version field per region in the input. Instruct the model to perform a schema compatibility check first and report schema_mismatch: true before comparing data fields, suppressing false data-diff alerts.
Tombstone and Deletion Propagation Lag
What to watch: A record deleted in one region still appears in another due to tombstone propagation delay. The model reports a false positive conflict, treating the undeleted record as an inconsistency rather than a deletion in flight. Guardrail: Include a deletion_marker or tombstone field in the record schema. Instruct the model to check for pending tombstones in the source region and classify the unmatched record as status: "awaiting_tombstone_propagation" with a grace period.
Large Payload Truncation
What to watch: Large records or high-cardinality datasets exceed the model's context window or output token limit, causing silent truncation of the comparison report. Missing regions or records go undetected. Guardrail: Implement a pre-flight token budget check in the harness. If the combined payload exceeds a safe threshold, split the verification into sharded comparisons by key range or region pair, and aggregate results in a post-processing step outside the model call.
Conflict Resolution Ambiguity
What to watch: The model detects a genuine conflict but cannot determine which region's value is authoritative, producing an ambiguous or non-actionable conflict report that leaves operators without clear remediation steps. Guardrail: Include a resolution_policy parameter in the prompt (e.g., source_of_truth_region, last_write_wins, manual_review). Instruct the model to apply the policy to recommend a specific resolution action and only escalate to manual_review when the policy cannot resolve the conflict automatically.
Evaluation Rubric
How to test output quality before shipping. Run these checks against a golden dataset of known state comparisons.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Region Coverage Completeness | Every region in [TARGET_REGIONS] appears in the output with a dedicated section and status. | A region from the input list is missing from the report, or its status is null. | Parse the output JSON. Extract all region keys. Assert set equality with the [TARGET_REGIONS] input array. |
Lag Detection Accuracy | Reported replication lag for each region matches the ground-truth lag injected in the golden dataset within a ±5-second tolerance. | A region's reported lag deviates from the known injected lag by more than the tolerance, or a lag is reported where none exists. | For each region in the golden dataset, compare the output's |
Conflict Flag Precision | No false positive conflict flags. A conflict is only raised for regions where the golden dataset has a known data mismatch. | A conflict flag is | Iterate over regions. Assert |
Conflict Flag Recall | All known injected conflicts in the golden dataset are detected and flagged in the output. | A region with a known injected conflict has | Iterate over regions with known conflicts. Assert |
Output Schema Validity | The output is valid JSON that strictly conforms to the [OUTPUT_SCHEMA] with all required fields present and correctly typed. | JSON parsing fails, a required field like | Validate the output string against the [OUTPUT_SCHEMA] using a JSON schema validator. Assert |
Eventual Consistency Window Adherence | For regions within their configured [CONSISTENCY_WINDOW_SECONDS], the status is reported as | A region within its consistency window is incorrectly reported as | For each region, if |
Handling of Unreachable Region | A simulated unreachable region in the golden dataset results in a clear | An unreachable region is reported with a numeric lag value, a | Identify the unreachable region in the golden dataset. Assert |
Idempotency Check | Running the prompt twice with the same input produces semantically identical output with no new conflicts or changed statuses. | A second run flips a conflict flag, changes a status from | Execute the prompt twice with the same golden dataset input. Perform a deep comparison of the two outputs. Assert they are identical. |
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
Use the base prompt with a single model call and manual review of the output. Remove strict schema enforcement and accept plain-text comparison tables. Replace [REGION_LIST] with a hardcoded pair of regions. Skip the lag-detection harness and focus on whether the model correctly identifies obvious mismatches.
Prompt modification
- Remove the [OUTPUT_SCHEMA] constraint and ask for a markdown table instead.
- Add: "If you are unsure about any comparison, note it as UNCERTAIN rather than guessing."
- Reduce [CONSISTENCY_WINDOW_SECONDS] to a single hardcoded value like 300.
Watch for
- Hallucinated record counts when the model cannot access live data
- Overly broad "all regions match" conclusions without per-resource evidence
- Missing conflict flags when timestamps are close but not identical

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