This prompt is designed for infrastructure and platform engineers who need to convert raw, human-readable configuration drift reports into structured, machine-actionable log entries. The primary job-to-be-done is normalization: taking the output of a drift detection tool (such as a diff between desired state and actual state) and producing a strictly-typed JSON record suitable for ingestion into a centralized inventory, a compliance dashboard, or an automated remediation pipeline. The ideal user is an engineer building a reliability or security workflow where drift events must be tracked, queried, and audited over time, not just observed in a terminal.
Prompt
Configuration Drift Detection Log Prompt

When to Use This Prompt
Understand the ideal job-to-be-done, required context, and operational boundaries for the Configuration Drift Detection Log Prompt.
Use this prompt when your drift detection system already identifies a discrepancy but expresses it in an unstructured format like a diff output, a CLI summary, or a notification message. The prompt enforces a controlled vocabulary for drift severity (CRITICAL, HIGH, MEDIUM, LOW) and requires a machine-readable representation of the resource's expected and actual state. It is critical that you provide the raw drift report as the [DRIFT_REPORT] input and specify the resource identifier format you require in [RESOURCE_ID_SCHEMA]. Do not use this prompt as a real-time alerting replacement; it is a post-detection normalization step. It does not replace your detection engine (e.g., Terraform, Pulumi, or a custom operator) and should not be the sole trigger for paging on-call engineers.
Before wiring this into a production pipeline, ensure you have a clear contract for the [OUTPUT_SCHEMA] that your downstream systems expect. The prompt is most effective when the target schema is provided inline, allowing the model to map the messy drift report directly to your required fields. Avoid using this prompt for resources whose state cannot be cleanly serialized into the expected JSON structure, or where the drift report contains ambiguous, incomplete data that requires human interpretation. In those cases, route the event to a human review queue instead.
Use Case Fit
Where the Configuration Drift Detection Log Prompt delivers reliable structured output—and where it introduces operational risk.
Good Fit: Infrastructure-as-Code Reconciliation
Use when: comparing Terraform/Pulumi state against live cloud resource configurations. The prompt excels at producing structured drift records with resource identifiers, expected vs. actual state, and detection timestamps. Guardrail: always provide the IaC desired state as [EXPECTED_STATE] and the live API response as [ACTUAL_STATE] to prevent the model from hallucinating configuration values.
Good Fit: Scheduled Compliance Scanning
Use when: running periodic configuration audits that feed into compliance dashboards or ticketing systems. The prompt's structured output with consistent severity levels and timestamps integrates directly into automated remediation workflows. Guardrail: pair with a cron-triggered retrieval step that gathers current state before invoking the prompt—never rely on the model's training data for live config values.
Bad Fit: Real-Time Configuration Enforcement
Avoid when: the system must block or revert configuration changes in real time. This prompt generates detection records for downstream analysis, not enforcement decisions. Latency and hallucination risk make it unsuitable for inline policy enforcement points. Guardrail: route real-time enforcement through OPA/Kyverno rules; use this prompt only for post-hoc drift documentation and audit trails.
Bad Fit: Multi-Resource Dependency Mapping
Avoid when: the task requires understanding complex inter-resource dependencies or blast-radius analysis. The prompt detects per-resource drift but does not reason about cascading impacts across security groups, IAM policies, or network topologies. Guardrail: use a dedicated architecture analysis prompt for dependency mapping; feed individual resource drift records from this prompt as input evidence.
Required Inputs: Canonical State Sources
Risk: without explicit expected and actual state inputs, the model may invent plausible but incorrect configuration values. Guardrail: always supply [EXPECTED_STATE] from version-controlled IaC definitions and [ACTUAL_STATE] from a live API query or configuration snapshot. Never prompt the model to recall configurations from memory. Validate resource identifier format before invoking the prompt.
Operational Risk: Silent Schema Drift in Output
Risk: the prompt may produce structurally valid JSON that still breaks downstream consumers due to field reordering, timestamp format shifts, or enum value changes across model versions. Guardrail: implement post-generation schema validation against a locked JSON Schema contract. Run regression tests with golden drift records before model version upgrades. Monitor field presence and enum distribution in production traces.
Copy-Ready Prompt Template
A reusable prompt with square-bracket placeholders for generating structured configuration drift detection log entries.
This prompt template is designed to be pasted directly into your system prompt or user message. It instructs the model to analyze two configuration states—an expected state and an observed actual state—and produce a structured drift detection record. The output is a JSON object that identifies the resource, the specific drifted properties, and the detection timestamp, making it suitable for direct ingestion into an infrastructure monitoring pipeline or a compliance audit system.
textYou are a configuration drift detection engine. Your task is to compare an expected configuration state with an actual observed state for a single resource and produce a structured drift record. ## Inputs - Expected Configuration: [EXPECTED_CONFIG] - Actual Configuration: [ACTUAL_CONFIG] - Resource Identifier: [RESOURCE_ID] - Resource Type: [RESOURCE_TYPE] - Detection Timestamp: [DETECTION_TIMESTAMP] ## Output Schema Return a single JSON object with the following structure: { "resource_id": "string", "resource_type": "string", "detection_timestamp": "string (ISO 8601 format)", "drift_detected": "boolean", "drifted_properties": [ { "property_path": "string", "expected_value": "string", "actual_value": "string", "severity": "string (enum: CRITICAL, HIGH, MEDIUM, LOW)" } ], "drift_summary": "string (concise human-readable summary of all detected drift)" } ## Constraints - If no differences are found, `drift_detected` must be `false` and `drifted_properties` must be an empty array. - The `property_path` should use dot-notation to indicate nested fields (e.g., `spec.replicas`). - `expected_value` and `actual_value` must be string representations of the values. - The `severity` field must be one of the specified enum values. Assign `CRITICAL` for security group or IAM role changes, `HIGH` for instance size or capacity changes, `MEDIUM` for tag or metadata changes, and `LOW` for description or comment changes. - The `drift_summary` must be a single sentence that is safe for use in a Slack alert or an incident ticket title. - Do not include any text outside the JSON object.
To adapt this template, replace the bracketed placeholders with your actual data. The [EXPECTED_CONFIG] and [ACTUAL_CONFIG] placeholders can accept a JSON or YAML string representing the full resource configuration. For high-risk environments, such as production infrastructure or regulated systems, always pair this prompt with a post-generation validation step that checks the output against the defined JSON Schema and verifies that the resource_id matches the input. A human operator should review any drift record with a CRITICAL severity before automated remediation is triggered.
Prompt Variables
Required inputs for the Configuration Drift Detection Log Prompt. Each placeholder must be populated before the prompt is assembled. Validation notes describe how to verify the input is well-formed before sending it to the model.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[RESOURCE_ID] | Unique identifier for the resource being checked for drift | arn:aws:ec2:us-east-1:123456789012:instance/i-0abcdef1234567890 | Must match the resource identifier format of the target platform. Validate with regex for ARN, UUID, or resource path patterns before injection. |
[RESOURCE_TYPE] | Category of infrastructure resource under inspection | AWS::EC2::Instance | Must come from a controlled vocabulary of supported resource types. Reject any value not present in the allowed-resource-types enum. |
[EXPECTED_STATE] | The desired configuration state as defined in IaC or policy | {"instanceType": "t3.medium", "monitoring.enabled": true} | Must be valid JSON. Parse and validate against the resource type schema before injection. Null or empty object is allowed only when the resource is expected not to exist. |
[ACTUAL_STATE] | The observed configuration state from the live environment | {"instanceType": "t3.large", "monitoring.enabled": false} | Must be valid JSON. Parse and validate against the same schema as [EXPECTED_STATE]. Field presence must match expected state fields for meaningful drift comparison. |
[DETECTION_TIMESTAMP] | ISO 8601 timestamp when drift detection was executed | 2025-01-15T14:32:00Z | Must be valid ISO 8601 with timezone. Reject timestamps in the future or older than the configured detection window. Use UTC for consistency. |
[SOURCE_SYSTEM] | System or tool that performed the drift detection | terraform-state-s3://prod/terraform.tfstate | Must identify the source of truth for expected state. Validate format as a URI with scheme. Reject ambiguous values like 'manual' without additional context. |
[DRIFT_SEVERITY_THRESHOLD] | Minimum severity level that triggers a drift record | MEDIUM | Must be one of CRITICAL, HIGH, MEDIUM, LOW, or INFO. Reject any value outside this enum. Controls whether minor drift is logged or suppressed. |
[TRACE_ID] | Distributed trace identifier for correlating this detection across systems | trace-4f3a2b1c-9d8e-7f6a-5b4c-3d2e1f0a9b8c | Must be a valid trace ID format per the observability backend. Validate with regex for UUID, W3C trace context, or custom trace ID pattern. Null is allowed if tracing is not configured. |
Implementation Harness Notes
How to wire the Configuration Drift Detection Log Prompt into a production observability or compliance pipeline.
This prompt is designed to be called by an automated scanner, not a human chat interface. The typical harness runs after a configuration audit tool (e.g., a Terraform plan diff, an AWS Config snapshot comparison, or a Kubernetes kubectl diff output) detects a discrepancy. The raw diff text is passed as the [DRIFT_DETAIL] input, while the [EXPECTED_STATE] is sourced from the Infrastructure-as-Code (IaC) repository or a golden configuration database. The model's job is to normalize this raw technical data into a structured, machine-readable drift record that can be ingested by your SIEM, compliance database, or on-call alerting platform.
To wire this into an application, wrap the prompt in a function that enforces a strict contract. The function should accept the expected state and the actual state as arguments, format them into the prompt template, and call a model with a low temperature (0.0–0.2) and JSON mode enabled. The response must be parsed and validated against a JSON Schema that checks for the presence of required fields (resource_id, drift_type, detected_timestamp), the format of the timestamp (RFC 3339), and the controlled vocabulary for drift_type (e.g., ADDED, REMOVED, MODIFIED). If validation fails, implement a single retry with the validation error message appended to the prompt as a correction instruction. Log both the raw model output and the validation result before writing the final record to your event bus. For high-risk resources like IAM policies or security groups, route the record to a human approval queue before automated remediation is triggered.
Do not use this prompt for real-time blocking decisions. The model's interpretation of a diff can be lossy, and a hallucinated resource identifier could suppress a critical alert. Instead, use the structured output to enrich an existing deterministic drift detection pipeline. The model adds value by normalizing messy state representations and generating a human-readable summary, but the source of truth for the drift event must always be the deterministic diff tool. Ensure your harness treats the model's output as an annotation on a known event, not as the primary event generator itself.
Expected Output Contract
Fields, types, and validation rules for the Configuration Drift Detection Log. Use this contract to validate model output before ingestion into your CMDB or observability pipeline.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
resource_id | string (ARN or UID) | Must match pattern ^(arn:[a-z-]+:[a-z0-9-]*:[0-9]{12}:.+)|([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})$ | |
drift_timestamp | string (ISO 8601 UTC) | Must parse to valid UTC datetime; must not be in the future | |
expected_state | object (key-value pairs) | Must be a non-empty JSON object; keys must be strings; values must be strings, numbers, or booleans | |
actual_state | object (key-value pairs) | Must be a non-empty JSON object; must differ from expected_state by at least one key-value pair | |
drifted_fields | array of strings | Must contain at least one element; each element must be a key present in both expected_state and actual_state | |
severity | string (enum) | Must be one of: CRITICAL, HIGH, MEDIUM, LOW, INFO | |
detection_source | string | Must be a non-empty string; recommended format: 'tool_name:vX.Y.Z' or 'manual:reviewer_id' | |
remediation_hint | string or null | If present, must be a non-empty string; null allowed when severity is INFO |
Common Failure Modes
What breaks first in configuration drift detection prompts and how to guard against it in production.
State Representation Inconsistency
What to watch: The model describes the same configuration state differently across runs—using 'enabled: true' in one record and 'status: active' in another for the same resource property. This breaks downstream diffing and alerting logic that expects consistent field-level representation. Guardrail: Provide a strict output schema with controlled vocabulary for state fields. Add an eval that compares state representation across multiple runs of the same input and flags variation exceeding a threshold.
Resource Identifier Format Drift
What to watch: The model generates resource IDs that don't match your organization's naming conventions—mixing ARN formats with short names, dropping account IDs, or inventing identifiers when the source data is ambiguous. This causes correlation failures in downstream systems that join drift records with asset inventories. Guardrail: Include explicit resource ID format rules and examples in the prompt. Add a post-generation validator that checks every resource ID against a regex pattern or lookup against a known resource catalog before the record is accepted.
Timestamp Normalization Failure
What to watch: The model outputs timestamps in inconsistent formats—ISO 8601 in one field, Unix epoch in another, or relative expressions like '2 hours ago' when the prompt requires absolute timestamps. This breaks time-series correlation in observability platforms. Guardrail: Specify a single timestamp format (e.g., ISO 8601 with UTC offset) for all temporal fields. Add a validation step that parses every timestamp field and rejects records with non-conforming formats before ingestion.
Expected vs. Actual State Reversal
What to watch: The model swaps the expected and actual state fields, reporting the desired configuration as the observed state and vice versa. This causes drift alerts to fire in the wrong direction or miss real configuration changes entirely. Guardrail: Use semantically distinct field names ('desired_state' vs. 'observed_state') and include a few-shot example that clearly labels which is which. Add an eval that checks whether the drift direction matches a known ground-truth change.
Missing Null Field Handling
What to watch: When a configuration property is absent from the actual state, the model omits the field entirely instead of explicitly marking it as null or absent. This creates ambiguity—did the model forget the field, or is the property genuinely not set? Guardrail: Require explicit null or 'ABSENT' sentinel values for missing properties in the output schema. Add a field-completeness eval that verifies every expected property appears in the output, even when the value is absent.
Drift Severity Inflation or Suppression
What to watch: The model overestimates drift severity for minor changes (e.g., a comment change flagged as CRITICAL) or suppresses severity for meaningful changes (e.g., a security group rule change marked as LOW). This causes alert fatigue or missed incidents. Guardrail: Define explicit severity classification rules tied to resource type and property criticality. Include a calibration eval that compares model-assigned severity against human-labeled examples and flags deviations beyond one severity level.
Evaluation Rubric
Criteria for evaluating the quality of a Configuration Drift Detection Log Prompt output before integrating it into a production pipeline. Use these tests to catch state representation inconsistencies, identifier format errors, and timestamp issues early.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Resource Identifier Format | [RESOURCE_ID] matches the expected ARN, URN, or path pattern defined in the system contract. | Output contains a bare resource name, an invalid account ID segment, or a malformed ARN prefix. | Regex validation against a known resource identifier pattern (e.g., |
State Representation Consistency | [EXPECTED_STATE] and [ACTUAL_STATE] are represented using the same schema, data types, and key ordering. | One state block is a raw string while the other is a structured JSON object, or keys are mismatched. | Structural diff: parse both state fields as JSON and compare top-level key sets and value types. |
Timestamp Format Compliance | [DETECTED_TIMESTAMP] is in RFC 3339 format and includes a timezone offset. | Timestamp is missing a timezone, uses an ambiguous format like MM/DD/YYYY, or is a Unix epoch integer. | Parse the timestamp string with a strict RFC 3339 parser and check for a non-null offset. |
Drift Severity Classification | [DRIFT_SEVERITY] is one of the predefined controlled vocabulary values: | Output contains an unlisted severity like | Enum check against the allowed set. For a known critical drift scenario, assert the value is |
Required Field Presence | All fields in the output contract are present and non-null unless explicitly marked as optional. | A required field like [RESOURCE_ID] or [DETECTED_TIMESTAMP] is missing or null. | Schema validation: deserialize the output and check for the presence of all required keys. |
Drift Detail Completeness | [DRIFT_DETAILS] contains a non-empty array of objects, each with | The array is empty when [EXPECTED_STATE] and [ACTUAL_STATE] are different, or a detail object is missing a | Assert that |
Source Attribution | [SOURCE_SYSTEM] identifies the tool or system that detected the drift, matching a registered source name. | The field contains a generic placeholder like | Check the value against a pre-approved list of source system identifiers. |
Idempotency Key Uniqueness | [DRIFT_EVENT_ID] is a UUID or similarly unique identifier that changes on every generation for the same logical event. | The ID is a hash of the content, a static string, or a sequential integer that would collide on regeneration. | Generate two outputs for the same input and assert that [DRIFT_EVENT_ID] values are different. |
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
Start with the base prompt and a single resource type. Drop strict schema enforcement in favor of a Markdown table or simple key-value pairs. Use a lightweight script to validate resource IDs and timestamps post-generation.
codeYou are a configuration drift detector. Given a resource definition and its current state, produce a drift record with: - resource_id: [RESOURCE_ID] - expected_state: [EXPECTED_STATE] - actual_state: [ACTUAL_STATE] - detected_at: [DETECTED_TIMESTAMP] - drift_summary: [DRIFT_SUMMARY] Output as a Markdown table.
Watch for
- Missing resource identifier format validation
- Timestamps in inconsistent timezones
- Drift summaries that are too vague to act on

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