Inferensys

Prompt

Configuration Drift Risk Scoring Prompt

A practical prompt playbook for platform and security teams assigning consistent risk scores to configuration drift findings for compliance reporting and remediation prioritization.
Risk analyst performing AI risk assessment on laptop, risk matrices visible, casual office risk session.
PROMPT PLAYBOOK

When to Use This Prompt

Understand the job-to-be-done, the ideal user, required inputs, and the boundaries where this prompt should not be applied.

This prompt is designed for platform engineering and security teams who need to assign consistent, defensible risk scores to configuration drift findings before they enter a compliance report or remediation queue. It takes a structured drift finding as input and produces a risk-scored output with likelihood, impact, and composite risk ratings aligned to an organizational risk taxonomy. Use this prompt when you have already detected drift through IaC reconciliation, runtime snapshot comparison, or audit tooling, and you need to transform raw findings into a prioritized, auditor-ready inventory. The core job-to-be-done is risk normalization: converting heterogeneous drift signals from multiple detection sources into a single, scored format that remediation teams and compliance reviewers can trust.

This prompt does not detect drift itself. It scores findings that have already been identified and structured. It assumes each input finding includes the resource identifier, the property that drifted, the expected value, the actual value, and the environment where drift was detected. Before invoking this prompt, you must have completed drift detection and structured your findings into a consistent JSON schema. If your input is raw terraform plan output, live API responses, or unstructured log lines, use a detection or extraction prompt first. Do not use this prompt for real-time alert triage where latency is critical; it is designed for batch or sequential scoring of findings that have already been collected. For high-security environments, always route the scored output through a human review step before it reaches an auditor or triggers automated remediation.

The ideal user is a platform engineer, SRE, or security analyst who owns configuration compliance and needs to produce risk-scored reports for stakeholders. The prompt requires that your organization has defined a risk taxonomy—or is willing to adopt the one embedded in the prompt—so that likelihood and impact ratings are consistent across teams. If your organization lacks a defined risk taxonomy, invest time in customizing the [RISK_LEVEL] and [CONSTRAINTS] placeholders before running this prompt at scale. Next, proceed to the prompt template section to copy the ready-to-use template, or jump to the implementation harness to learn how to wire this prompt into a production scoring pipeline with validation, retries, and logging.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Configuration Drift Risk Scoring Prompt delivers reliable, auditable results—and where it introduces operational risk.

01

Good Fit: Compliance Reporting

Use when: generating a risk-scored drift inventory for audit evidence or regulatory review. The prompt excels at applying a consistent risk taxonomy across many findings. Guardrail: always ground scores in a provided organizational risk matrix and require human sign-off before submission.

02

Bad Fit: Real-Time Alerting

Avoid when: the output must drive automated paging or incident creation without human review. LLM-generated risk scores can be inconsistent under latency pressure. Guardrail: use deterministic severity rules in the alerting pipeline and reserve this prompt for asynchronous triage and reporting.

03

Required Input: Risk Taxonomy

Risk: without a defined likelihood × impact matrix, the model invents scoring criteria that won't match organizational policy. Guardrail: provide a structured risk taxonomy as part of [CONTEXT] with explicit definitions for each severity level, likelihood band, and impact category.

04

Required Input: Drift Findings

Risk: the prompt cannot detect drift; it only scores findings from an upstream detection system. Feeding it incomplete or stale data produces misleading risk scores. Guardrail: validate that [INPUT] contains resource ID, property diff, environment, and detection timestamp for every finding before scoring.

05

Operational Risk: Score Drift

Risk: the same finding scored at different times may receive different risk ratings due to model non-determinism, undermining audit credibility. Guardrail: pin temperature to 0, use a strict [OUTPUT_SCHEMA], and run eval checks comparing scores across multiple runs for the same input.

06

Operational Risk: Blind Trust

Risk: teams may treat the composite risk score as ground truth and skip human review for high-severity findings. Guardrail: flag any finding with a composite score above a defined threshold for mandatory human review and log the scoring rationale for auditability.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready prompt for scoring configuration drift findings by likelihood, impact, and composite risk, aligned to your organization's risk taxonomy.

This prompt template assigns a structured risk score to each drift finding in your inventory. It is designed to be wired into a drift detection pipeline where raw findings—such as an IAM policy change, a missing environment variable, or a Terraform state deviation—have already been identified. The prompt takes those findings plus your organization's risk taxonomy and produces a scored inventory with likelihood, impact, composite risk ratings, and a brief justification per finding. Use this when you need consistent, auditable risk scores for compliance reporting, remediation prioritization, or operational review queues.

text
You are a configuration drift risk scorer for a platform engineering team. Your task is to assign a risk score to each drift finding using the organization's risk taxonomy.

## INPUT
- Drift Findings: [DRIFT_FINDINGS]
- Risk Taxonomy: [RISK_TAXONOMY]
- Environment Context: [ENVIRONMENT_CONTEXT]

## DRIFT FINDINGS SCHEMA
Each finding in [DRIFT_FINDINGS] is a JSON object with:
- finding_id: string
- resource_type: string (e.g., IAM_POLICY, ENV_VAR, K8S_DEPLOYMENT, TERRAFORM_RESOURCE)
- resource_id: string
- drift_description: string (what changed, what was expected, what was observed)
- detection_timestamp: ISO 8601 string
- affected_environments: array of strings (e.g., ["production", "staging"])
- blast_radius: string (description of affected services, users, or data)
- is_security_related: boolean
- is_compliance_related: boolean
- manual_change_evidence: string or null (evidence of intentional manual intervention)

## RISK TAXONOMY
[RISK_TAXONOMY] defines the scoring dimensions and levels. It includes:
- Likelihood levels with definitions (e.g., RARE, UNLIKELY, POSSIBLE, LIKELY, ALMOST_CERTAIN)
- Impact levels with definitions (e.g., NEGLIGIBLE, MINOR, MODERATE, MAJOR, CATASTROPHIC)
- Composite risk matrix mapping likelihood + impact to a risk rating (e.g., LOW, MEDIUM, HIGH, CRITICAL)
- Any domain-specific overrides for security, compliance, or production environments

## ENVIRONMENT CONTEXT
[ENVIRONMENT_CONTEXT] provides additional information about the environments:
- environment_tier: production, staging, development, or other
- deployment_freeze_active: boolean
- recent_incidents: array of related incident summaries
- change_window_status: open, closed, or emergency

## OUTPUT SCHEMA
Return a JSON object with a single key "scored_findings" containing an array of objects. Each object must have:
- finding_id: string (from input)
- likelihood: string (must match a level in the risk taxonomy)
- likelihood_rationale: string (1-2 sentences explaining why this likelihood was chosen)
- impact: string (must match a level in the risk taxonomy)
- impact_rationale: string (1-2 sentences explaining why this impact was chosen)
- composite_risk: string (must match a level in the risk taxonomy matrix)
- requires_immediate_action: boolean (true if composite_risk is HIGH or CRITICAL, or if security-related with MEDIUM or above)
- remediation_priority: integer (1 = highest priority, based on composite_risk, security flags, and environment tier)
- justification_summary: string (2-3 sentences summarizing the risk assessment for audit trail)

## CONSTRAINTS
- Use ONLY the levels defined in [RISK_TAXONOMY]. Do not invent new levels.
- If a finding is security_related AND affects production, impact must be at least MAJOR unless strong evidence justifies otherwise.
- If manual_change_evidence is present and credible, likelihood should be adjusted downward but impact remains unchanged.
- If environment_tier is production and deployment_freeze_active is true, flag any HIGH or CRITICAL finding with requires_immediate_action = true.
- Do not hallucinate additional findings. Score only the findings provided in [DRIFT_FINDINGS].
- If insufficient information exists to score a dimension, use the most conservative level (highest likelihood, highest impact) and note the uncertainty in the rationale.

## EXAMPLES
Example input finding:
{
  "finding_id": "drift-001",
  "resource_type": "IAM_POLICY",
  "resource_id": "arn:aws:iam::123456789:policy/ReadOnlyAccess-Prod",
  "drift_description": "Policy gained s3:PutObject permission not present in Terraform definition. Expected: read-only. Observed: read-write.",
  "detection_timestamp": "2025-01-15T08:30:00Z",
  "affected_environments": ["production"],
  "blast_radius": "All production S3 buckets in account 123456789",
  "is_security_related": true,
  "is_compliance_related": true,
  "manual_change_evidence": null
}

Example output scoring:
{
  "finding_id": "drift-001",
  "likelihood": "ALMOST_CERTAIN",
  "likelihood_rationale": "The drift is confirmed and currently active in production. No evidence of planned change.",
  "impact": "MAJOR",
  "impact_rationale": "Unauthorized write access to all production S3 buckets violates least-privilege and could lead to data tampering or exfiltration.",
  "composite_risk": "CRITICAL",
  "requires_immediate_action": true,
  "remediation_priority": 1,
  "justification_summary": "Active IAM policy drift in production grants write access contrary to declared read-only intent. Security and compliance impact is immediate with broad blast radius. Requires urgent remediation and incident review."
}

## INSTRUCTIONS
1. Parse [DRIFT_FINDINGS] and validate each finding has all required fields.
2. For each finding, evaluate likelihood based on drift confirmation status, manual change evidence, and environment context.
3. Evaluate impact based on resource_type, blast_radius, security flags, compliance flags, and environment tier.
4. Map likelihood + impact to composite_risk using the matrix in [RISK_TAXONOMY].
5. Set requires_immediate_action and remediation_priority based on composite_risk, security flags, and environment context.
6. Write concise rationales and a justification summary suitable for audit review.
7. Return the complete scored_findings array as valid JSON.

Before wiring this prompt into production, replace [DRIFT_FINDINGS] with the actual JSON array of drift findings from your detection pipeline, [RISK_TAXONOMY] with your organization's documented risk levels and matrix, and [ENVIRONMENT_CONTEXT] with current environment state. Validate that the output JSON strictly conforms to the schema by running a structural validator after the model responds. For high-stakes compliance workflows, route CRITICAL findings to a human reviewer before the scored inventory is finalized. If the model returns a likelihood or impact level not present in your taxonomy, treat it as a validation failure and retry with an explicit reminder of the allowed levels in the retry prompt.

IMPLEMENTATION TABLE

Prompt Variables

Each placeholder must be populated before the prompt is sent to the model. Validation notes describe what the model expects and what breaks if the input is malformed.

PlaceholderPurposeExampleValidation Notes

[DRIFT_FINDINGS]

Array of raw drift detection results from upstream tools (e.g., Terraform plan, kubectl diff, config auditor)

[{"resource_id": "aws_iam_role.admin", "property": "assume_role_policy", "expected": "{...}", "actual": "{...}", "detection_source": "terraform_plan"}]

Must be valid JSON array. Each object requires resource_id, property, expected, actual, and detection_source fields. Null or empty array triggers empty output; validate with JSON schema before prompt assembly.

[RISK_TAXONOMY]

Organization-specific risk categories, severity definitions, and scoring criteria for likelihood and impact

{"categories": ["security", "compliance", "availability", "cost"], "likelihood_levels": {"low": "<10% probability of exploit", "medium": "10-50%", "high": ">50%"}, "impact_levels": {"low": "minor config deviation", "medium": "degraded service", "high": "outage or breach"}}

Must be valid JSON object with categories array and likelihood/impact level definitions. Missing taxonomy causes inconsistent scoring; validate structure matches org risk framework. If null, prompt should use default generic taxonomy.

[ENVIRONMENT_CONTEXT]

Deployment environment metadata including tier, data classification, blast radius, and regulatory scope

{"environment": "production", "tier": "tier-1", "data_classification": "pci", "regulatory_frameworks": ["PCI-DSS", "SOC2"], "blast_radius_services": 12}

Must be valid JSON object. Required fields: environment, tier. Optional: data_classification, regulatory_frameworks, blast_radius_services. Missing environment field causes incorrect risk weighting; validate required fields present.

[CHANGE_HISTORY]

Recent change records from audit logs, Git history, or change management system for the affected resources

[{"resource_id": "aws_iam_role.admin", "changed_at": "2024-01-15T14:30:00Z", "changed_by": "pipeline-deploy-123", "change_type": "automated"}]

Must be valid JSON array or null. Each record requires resource_id, changed_at (ISO 8601), and changed_by. Used for likelihood scoring; null allowed if no history available but reduces scoring accuracy.

[COMPLIANCE_REQUIREMENTS]

Specific compliance controls, frameworks, or policy IDs that apply to the environment and resources

[{"framework": "PCI-DSS", "control_id": "7.2.1", "requirement": "Access control systems must be in place"}, {"framework": "SOC2", "control_id": "CC6.1"}]

Must be valid JSON array or null. Each object requires framework and control_id. Used to weight compliance impact; null allowed for non-regulated environments. Validate framework names against org-approved list.

[OUTPUT_SCHEMA]

Expected JSON schema for the risk-scored drift inventory output

{"type": "object", "properties": {"findings": {"type": "array", "items": {"properties": {"resource_id": {"type": "string"}, "risk_score": {"type": "number", "minimum": 0, "maximum": 100}, "likelihood": {"type": "string", "enum": ["low", "medium", "high"]}, "impact": {"type": "string", "enum": ["low", "medium", "high"]}, "rationale": {"type": "string"}}}}}}

Must be valid JSON Schema. Used to enforce output structure via schema validation post-generation. Missing schema causes unstructured output; validate schema is parseable before prompt assembly. Retry with schema error feedback if output fails validation.

[MAX_FINDINGS]

Maximum number of scored findings to return, used to control token usage and response size

50

Must be positive integer between 1 and 500. Controls output truncation; values above 500 risk token overflow. Default to 100 if not specified. Validate as integer before prompt assembly.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Configuration Drift Risk Scoring Prompt into an application or workflow with validation, retries, logging, and human review.

The Configuration Drift Risk Scoring Prompt is designed to be called as a scoring microservice within a larger drift management pipeline. The typical integration pattern is: a drift detection system (e.g., a Terraform plan diff, a Kubernetes reconciler, or an environment audit tool) produces a list of raw drift findings. Each finding is then sent to this prompt—either individually for low-volume, high-criticality workflows or in small batches of 5–10 findings for higher throughput—to assign a risk score. The prompt expects a structured [DRIFT_FINDING] object and an [ORGANIZATIONAL_RISK_TAXONOMY] definition that encodes your team's severity levels, impact categories, and likelihood criteria. The output is a JSON object containing likelihood_score, impact_score, composite_risk_score, and a risk_rationale string. This output should be stored alongside the raw finding in your drift inventory database for compliance reporting and prioritization.

To wire this into a production application, wrap the LLM call in a validation and retry layer. The output schema is strict: likelihood_score and impact_score must be integers within the ranges defined in your taxonomy, and composite_risk_score must equal the product or weighted sum (depending on your taxonomy) of the two. Implement a JSON schema validator that rejects malformed responses and triggers a single retry with the same input plus the validation error message appended as context. If the retry also fails, log the raw response and flag the finding for human review rather than silently accepting a bad score. For high-compliance environments, consider a second LLM call with a judge prompt that evaluates whether the risk_rationale is consistent with the assigned scores and the evidence in the finding; flag discrepancies for manual audit. Model choice matters: use a model with strong structured output capabilities (e.g., GPT-4o, Claude 3.5 Sonnet) and set temperature=0 to maximize scoring consistency across findings. Do not use this prompt with small or local models that struggle with multi-factor scoring rubrics unless you have calibrated their performance on your specific taxonomy.

The most common production failure mode is taxonomy drift: the [ORGANIZATIONAL_RISK_TAXONOMY] passed at runtime becomes stale relative to your team's actual risk policies. Mitigate this by storing the taxonomy as a versioned configuration artifact in your drift management system, not hardcoded in the prompt template. Log the taxonomy version alongside every scored finding so you can retroactively re-score findings if your risk framework changes. A second failure mode is context overload: drift findings often contain verbose resource configurations or long diff outputs. Truncate the [DRIFT_FINDING] input to the essential fields—resource type, property name, old value, new value, and a brief impact description—before passing it to the prompt. Avoid including full JSON blobs of cloud resource state unless the taxonomy explicitly requires that detail for impact assessment. Finally, never use this prompt to score drift findings that involve secrets or credentials; redact sensitive values upstream before they enter the prompt context, and flag any finding where redaction removes information needed for accurate scoring as requiring manual review.

IMPLEMENTATION TABLE

Expected Output Contract

The model must return a JSON object matching this schema. Validate these fields before accepting the output in your drift scoring pipeline.

Field or ElementType or FormatRequiredValidation Rule

drift_id

string

Matches pattern DRIFT-[0-9a-f]{8}

resource_id

string

Non-empty, matches source system ARN or resource identifier format

finding_summary

string

Non-empty, 10-200 characters

likelihood_score

integer

Integer 1-5 inclusive

impact_score

integer

Integer 1-5 inclusive

composite_risk_score

number

Calculated as likelihood_score * impact_score, range 1-25

risk_category

string

One of: critical, high, medium, low, informational

evidence_references

array of strings

Array contains at least 1 non-empty string; each references a source log, snapshot, or manifest entry

PRACTICAL GUARDRAILS

Common Failure Modes

When scoring configuration drift risk in production, these failure modes degrade consistency, trust, and audit readiness. Each card pairs a common breakage with a concrete guardrail.

01

Inconsistent Severity Scoring

What to watch: The model assigns 'Critical' to a dev environment port mismatch and 'Low' to a production IAM privilege escalation. Without a calibrated taxonomy, scores become meaningless across resources. Guardrail: Provide a strict scoring rubric in [RISK_TAXONOMY] with concrete examples per level. Validate score distribution against a golden set before accepting output.

02

Missing Blast Radius Assessment

What to watch: The prompt scores a single resource drift in isolation, ignoring that a security group change affects 47 downstream services. Risk scores that omit blast radius underrepresent true impact. Guardrail: Require dependency mapping in [RESOURCE_DEPENDENCY_GRAPH] and instruct the model to escalate scores when blast radius exceeds a threshold defined in [CONSTRAINTS].

03

Hallucinated Compliance Citations

What to watch: The model fabricates SOC 2 or PCI DSS control references to justify a risk score. Auditors will reject unverifiable claims. Guardrail: Restrict compliance mapping to an approved [COMPLIANCE_FRAMEWORK] list provided in the prompt. Require exact control IDs, not paraphrased descriptions. Flag any citation not found in the provided framework for human review.

04

Stale Evidence Grounding

What to watch: The prompt scores drift based on a Terraform state file from last week, but a manual hotfix changed the resource yesterday. Scores based on stale inputs create a false sense of security. Guardrail: Include a [DATA_FRESHNESS_TIMESTAMP] for each input source. Instruct the model to downgrade confidence and flag findings when input age exceeds the threshold in [MAX_STALENESS_MINUTES].

05

Normalization Failures Across Resource Types

What to watch: A Kubernetes ConfigMap diff and an IAM policy diff produce risk scores on different scales because the model interprets 'change' differently per resource type. Guardrail: Define resource-type-agnostic impact dimensions in [OUTPUT_SCHEMA] (e.g., 'Security Impact', 'Availability Impact', 'Compliance Impact') and require the model to score each dimension independently before computing a composite risk score.

06

Overfitting to Remediation Urgency

What to watch: The model conflates 'easy to fix' with 'low risk.' A trivial port misconfiguration gets scored lower than a complex IAM drift, even when the port exposure is the active attack vector. Guardrail: Separate the scoring pass from the remediation planning pass. Use a dedicated [DRIFT_SEVERITY_TRIAGE] prompt for prioritization, and instruct the risk scoring prompt to ignore remediation difficulty entirely.

IMPLEMENTATION TABLE

Evaluation Rubric

Test output quality before shipping. Run these checks on a golden dataset of 20-50 drift findings with known expected scores assigned by a senior platform engineer.

CriterionPass StandardFailure SignalTest Method

Likelihood Score Accuracy

Likelihood score matches senior engineer's score within ±1 on a 1-5 scale for ≥90% of cases

Systematic overestimation of likelihood for low-evidence findings or underestimation for findings with clear audit trail

Calculate mean absolute error (MAE) between model-assigned and expected likelihood scores across golden dataset

Impact Score Accuracy

Impact score matches senior engineer's score within ±1 on a 1-5 scale for ≥90% of cases

Inflated impact scores for non-production resources or deflated scores for security-critical configurations

Calculate MAE between model-assigned and expected impact scores; flag any finding where security impact is scored below 3

Composite Risk Rating Alignment

Composite risk rating (Critical/High/Medium/Low) matches expected rating for ≥85% of findings

Composite rating disagrees with expected rating by more than one severity tier

Confusion matrix comparing model-assigned vs expected risk ratings; measure weighted F1 score with higher weight on Critical and High categories

Risk Taxonomy Consistency

Risk category label matches organizational taxonomy for ≥95% of findings

Model invents risk categories not in the defined taxonomy or misclassifies security drift as operational drift

Exact string match against allowed taxonomy values; flag any output containing undefined risk categories

Evidence Grounding

Every risk score is supported by at least one specific, verifiable reference to the drift finding details

Scores assigned without citing any evidence from the input finding or citing evidence that contradicts the assigned score

Parse output for evidence references; verify each reference exists in the input finding; flag scores with zero evidence citations

Boundary Case Handling

Findings with incomplete data receive conservative scores with explicit uncertainty notes rather than confident high-risk scores

Missing impact data leads to default high-risk classification or missing likelihood data is ignored

Inject 5 boundary cases with intentionally incomplete fields into golden dataset; verify uncertainty language and conservative scoring

Output Schema Compliance

100% of outputs parse successfully against the expected JSON schema with all required fields present

Missing required fields, extra fields not in schema, or type mismatches in numeric score fields

Automated schema validation on all golden dataset outputs; reject any output that fails JSON Schema validation

Scoring Justification Quality

Justification text explains the reasoning chain connecting evidence to score using concrete finding details

Justification contains only generic statements like 'this is a high risk finding' without specific evidence linkage

LLM-as-judge evaluation comparing justification specificity against human-written justifications; pass if ≥80% rated as sufficiently specific

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a simple CSV or JSON list of drift findings. Remove strict schema enforcement and use natural-language scoring instructions. Focus on getting consistent severity labels before adding numeric scores.

code
Score each drift finding as LOW, MEDIUM, HIGH, or CRITICAL based on:
- Security impact
- Outage risk
- Compliance exposure

Drift findings:
[DRIFT_LIST]

Watch for

  • Inconsistent severity labels across similar finding types
  • Over-scoring low-impact cosmetic drift
  • Missing rationale that makes scores hard to audit
Prasad Kumkar

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.