Inferensys

Prompt

Security Event Risk Scoring Prompt Template

A practical prompt playbook for SOC analysts and detection engineers who need to score security events for triage priority. Produces a severity score with MITRE ATT&CK mapping, asset criticality weighting, and confidence indicators. Includes eval checks for consistency across analysts and alert fatigue measurement.
Risk analyst performing AI risk assessment on laptop, risk matrices visible, casual office risk session.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the job-to-be-done, ideal user, required context, and operational boundaries for the Security Event Risk Scoring prompt.

This prompt is designed for SOC analysts and detection engineers who need to convert raw security event data into a structured, explainable risk score for triage prioritization. Use it when you have event telemetry, log data, or alert payloads that require consistent severity assessment before routing to investigation queues. The prompt produces a composite score that combines threat intelligence mapping, asset context, and confidence indicators so that downstream automation or human reviewers can act on a standardized output.

Do not use this prompt for real-time blocking decisions where latency below 500ms is required; it is built for triage and review workflows, not inline prevention. The prompt assumes you have already extracted and normalized the event fields before calling the model. You should also avoid using it when the event lacks critical fields such as source IP, target asset, or event type, as the model will be forced to guess rather than reason from evidence. For high-severity events that may require immediate containment, pair this prompt with a separate escalation playbook that triggers paging or automated isolation before the scoring step completes.

Before integrating this prompt into a production pipeline, validate that your event normalization layer consistently populates the required input fields. Run the prompt against a golden dataset of 50–100 historical events with known outcomes to measure score calibration and inter-rater reliability across analysts. If the prompt produces inconsistent severity labels for similar events, revisit your asset criticality mappings or add few-shot examples that anchor the scoring behavior. Once calibrated, wire the output into your SIEM or SOAR queue with a human review gate for any event scoring above your defined escalation threshold.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works and where it does not. Use these cards to decide if the Security Event Risk Scoring Prompt Template fits your operational context.

01

Good Fit: SOC Triage Pipelines

Use when: You have a stream of security events that need consistent severity scoring before analyst review. The prompt produces MITRE ATT&CK mapping, asset criticality weighting, and confidence indicators that feed directly into triage queues. Guardrail: Validate that the prompt's output schema matches your SIEM or SOAR ingestion contract before deploying to production.

02

Bad Fit: Real-Time Blocking Decisions

Avoid when: The scoring output directly triggers automated blocking, quarantining, or connection termination without human review. This prompt is designed for triage prioritization, not inline enforcement. Guardrail: Insert a human approval gate between the risk score and any irreversible action. Use the High-Risk Action Approval Prompts pillar for blocking workflows.

03

Required Inputs: Event Context and Asset Data

What you need: The prompt requires structured event data (log source, timestamp, indicators), asset criticality mappings, and a defined severity scale. Without asset context, the scoring cannot weight events by business impact. Guardrail: Build a pre-processing step that enriches raw events with asset tags and criticality tiers before calling the prompt. Reject events with missing enrichment.

04

Operational Risk: Alert Fatigue Amplification

What to watch: If the prompt's severity distribution skews high across all events, it amplifies alert fatigue instead of reducing it. Over-scoring erodes analyst trust and slows real incident response. Guardrail: Monitor severity score distribution in production. Set a calibration checkpoint that compares prompt-assigned scores against analyst ground-truth labels weekly. Trigger recalibration if drift exceeds 15%.

05

Operational Risk: Inconsistent Analyst Overrides

What to watch: Different analysts may override the prompt's scores inconsistently, creating audit gaps and undermining the scoring model's feedback loop. Guardrail: Require structured override justifications with a fixed set of reason codes. Route all overrides through the Override Justification and Audit Prompts content group to maintain an auditable trail.

06

Operational Risk: Stale MITRE ATT&CK Mappings

What to watch: The prompt maps events to MITRE ATT&CK techniques, but the framework updates periodically. Stale mappings cause misclassification and missed coverage for new TTPs. Guardrail: Version-lock the ATT&CK framework reference in your prompt template and schedule a quarterly review to update technique mappings. Include a confidence downgrade when an event matches no known technique.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A production-ready prompt for scoring security events with structured severity, MITRE ATT&CK mapping, and confidence indicators.

This prompt template is designed for SOC analysts and detection engineers who need to triage security events consistently. It enforces a structured JSON output, requires evidence grounding for every score component, and instructs the model to flag low-confidence assessments rather than guessing. The template uses square-bracket placeholders that you must replace with real data before each call. The output includes a severity score, MITRE ATT&CK technique mapping, asset criticality weighting, and explicit confidence indicators for each field.

text
SYSTEM: You are a security event risk scoring assistant. Your task is to analyze a security event and produce a structured risk assessment. You must ground every score in the provided evidence. If evidence is insufficient for any field, set the confidence to 'low' and explain what is missing. Do not invent details. Do not guess.

USER:
Analyze the following security event and return a JSON object conforming to the [OUTPUT_SCHEMA] below.

## EVENT DETAILS
[EVENT_DETAILS]

## ASSET CONTEXT
[ASSET_CONTEXT]

## ENVIRONMENTAL CONTEXT
[ENVIRONMENTAL_CONTEXT]

## OUTPUT SCHEMA
{
  "event_id": "string",
  "severity": {
    "score": "number (0.0 to 10.0)",
    "label": "'critical' | 'high' | 'medium' | 'low' | 'informational'",
    "confidence": "'high' | 'medium' | 'low'"
  },
  "mitre_attack": [
    {
      "technique_id": "string (e.g., T1059.001)",
      "technique_name": "string",
      "relevance": "'direct' | 'indirect' | 'potential'",
      "evidence": "string (quote or reference from event details)",
      "confidence": "'high' | 'medium' | 'low'"
    }
  ],
  "asset_criticality": {
    "level": "'critical' | 'high' | 'medium' | 'low'",
    "weighting_factor": "number (0.0 to 1.0)",
    "justification": "string",
    "confidence": "'high' | 'medium' | 'low'"
  },
  "risk_factors": [
    {
      "factor": "string",
      "impact": "'increases_risk' | 'decreases_risk' | 'neutral'",
      "evidence": "string",
      "confidence": "'high' | 'medium' | 'low'"
    }
  ],
  "recommended_action": {
    "action": "'escalate' | 'investigate' | 'monitor' | 'close'",
    "urgency": "'immediate' | 'within_1_hour' | 'within_24_hours' | 'none'",
    "rationale": "string"
  },
  "low_confidence_fields": ["string (list field names where confidence is 'low')"],
  "overall_confidence": "'high' | 'medium' | 'low'"
}

## CONSTRAINTS
- Every field in the output must be populated.
- For any field where evidence is insufficient, set confidence to 'low' and explain what is missing in the justification or evidence field.
- Do not assign a severity score above 7.0 unless you can cite specific evidence of active exploitation or confirmed compromise.
- If the event is a known false-positive pattern, set severity to 'informational' and explain the pattern match.
- Map to MITRE ATT&CK techniques only when you can cite supporting evidence from the event details.
- The asset_criticality.weighting_factor must be justified by the provided asset context.
- If overall_confidence is 'low', recommended_action.action must be 'escalate' or 'investigate'.

To adapt this template, replace the three input placeholders with real data on each call. [EVENT_DETAILS] should contain the raw alert, log entry, or event description. [ASSET_CONTEXT] should include information about the affected system such as its business function, data classification, and exposure. [ENVIRONMENTAL_CONTEXT] should provide broader situational awareness such as active campaigns, recent incidents, or known vulnerabilities. The output schema is designed to be parsed by downstream automation. If your SIEM or SOAR expects a different field structure, adjust the schema but preserve the confidence indicators and evidence grounding requirements. For high-severity events, route the output to a human reviewer before taking automated action. Test the prompt against a golden dataset of known events with expected severity labels to measure inter-rater reliability before deploying to production.

IMPLEMENTATION TABLE

Prompt Variables

Each placeholder must be populated before the prompt is sent to the model. Incomplete or malformed inputs are the most common cause of low-confidence outputs.

PlaceholderPurposeExampleValidation Notes

[EVENT_LOG]

Raw security event data requiring risk scoring

{"event_type": "failed_login", "source_ip": "10.0.1.25", "timestamp": "2025-01-15T08:22:11Z", "user": "jdoe", "count": 47}

Must be valid JSON. Reject if empty or missing timestamp field. Parse check before prompt assembly.

[ASSET_INVENTORY]

Current asset criticality mappings for weighting risk scores

{"assets": [{"hostname": "db-prod-01", "criticality": "high", "data_classification": "PII"}, {"hostname": "dev-workstation-12", "criticality": "low"}]}

Must contain criticality field per asset. Schema check: required keys are hostname and criticality. Null allowed if asset context unavailable; flag as low-confidence input.

[THREAT_INTEL_CONTEXT]

Relevant threat intelligence feeds or IOC lists for enrichment

{"iocs": [{"indicator": "45.33.32.156", "type": "ip", "confidence": 85, "source": "CrowdStrike"}], "campaigns": ["APT29"]}

Optional field. If provided, must include source and confidence per indicator. Null allowed; model must note absence of enrichment in output confidence.

[DETECTION_RULES]

Active detection rule definitions that triggered or relate to the event

{"rules": [{"rule_id": "BRUTE-FORCE-001", "threshold": 10, "window_minutes": 5, "severity": "medium"}]}

Must include rule_id and threshold if provided. Schema check: reject if rule_id is missing when rules array is non-empty. Null allowed for ad-hoc scoring.

[HISTORICAL_BASELINE]

User or entity behavioral baselines for anomaly comparison

{"user": "jdoe", "avg_failed_logins_per_hour": 0.2, "typical_source_ips": ["10.0.1.25"], "baseline_period_days": 30}

Must include baseline_period_days if provided. Staleness check: reject baselines older than 90 days. Null allowed; model must flag missing baseline as increased uncertainty.

[SCORING_POLICY]

Organizational risk scoring rubric and threshold definitions

{"thresholds": {"low": 0.3, "medium": 0.6, "high": 0.8, "critical": 0.95}, "weights": {"asset_criticality": 0.3, "threat_intel_match": 0.25, "anomaly_score": 0.25, "rule_severity": 0.2}}

Must contain thresholds and weights objects. Range check: all weights must sum to 1.0 ± 0.01. Reject if thresholds are not monotonically increasing. Null not allowed; this is a required input.

[PREVIOUS_EVENTS]

Correlated events from the same session or entity for context

[{"event_id": "evt-001", "event_type": "successful_login", "timestamp": "2025-01-15T08:21:45Z", "source_ip": "10.0.1.25", "user": "jdoe"}]

Must be a JSON array. Timestamp ordering check: warn if events are out of chronological order. Null allowed for isolated events; model must note lack of correlation context.

[OUTPUT_SCHEMA]

Expected structure for the risk score response

{"severity_score": "float", "severity_label": "low|medium|high|critical", "mitre_attack_mapping": ["T1110.001"], "confidence": "float", "explanation": "string"}

Must define severity_score, confidence, and explanation fields. Enum check: severity_label must match one of the defined labels. Schema validation required before response is accepted.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Security Event Risk Scoring prompt into a production security workflow with validation, retries, logging, and human review routing.

The prompt template is a single component in a larger security triage pipeline. In production, the harness must enforce output schema compliance, handle model failures gracefully, and route high-severity or low-confidence results to a human review queue. Treat the prompt as an unreliable function that can return malformed JSON, hallucinate MITRE ATT&CK technique IDs, or produce inconsistent severity scores across similar events. The harness is responsible for catching these failures before a score reaches an analyst or an automated response playbook.

Wire the prompt into an application function that accepts a structured security event payload and returns a validated risk score object. Before calling the model, assemble the prompt with the event's raw log data, asset criticality from your CMDB, and the current MITRE ATT&CK reference context. After receiving the model response, run a strict JSON schema validator that checks required fields (severity_score, confidence, mitre_techniques, reasoning), enforces enum values for severity levels, and verifies that MITRE technique IDs match the expected T#### pattern. If validation fails, retry once with the validation error message appended to the prompt as a correction hint. If the retry also fails, log the failure and route the event to a manual triage queue with the raw event data and partial model output attached.

For high-risk security workflows, implement a human review gate based on two conditions: severity score above your defined threshold (e.g., severity_score >= 7) or model confidence below your minimum (e.g., confidence < 0.7). When either condition triggers, do not automatically create an incident or trigger a SOAR playbook. Instead, package the scored event into a review queue item with the full prompt response, the raw log evidence, and a pre-formatted summary for the SOC analyst. Log every scoring decision—including model, prompt version, input hash, output, validation result, and review routing decision—to your security data lake for auditability and drift monitoring. Run periodic eval batches using golden datasets of known incidents and benign events to measure score calibration, inter-run consistency, and alert fatigue rate before deploying prompt or model changes.

IMPLEMENTATION TABLE

Expected Output Contract

The model must return a JSON object matching this schema. Downstream systems depend on every field being present and correctly typed.

Field or ElementType or FormatRequiredValidation Rule

severity_score

number (0.0-10.0)

Must be a float within the inclusive range. Parse check; reject if out of bounds or non-numeric.

severity_label

string (enum)

Must be one of: 'CRITICAL', 'HIGH', 'MEDIUM', 'LOW', 'INFO'. Schema check against allowed enum values.

confidence

number (0.0-1.0)

Must be a float between 0 and 1. If below 0.6, flag for human review and set [ESCALATION_FLAG] to true.

mitre_attack_mapping

array of objects

Each object must contain 'tactic_id' (string) and 'technique_id' (string). Validate IDs against a known MITRE ATT&CK lookup table if available; otherwise, check format pattern (e.g., TAxxxx, Txxxx).

asset_criticality

string (enum)

Must be one of: 'CRITICAL', 'HIGH', 'MEDIUM', 'LOW'. Schema check; reject if missing or invalid.

evidence_summary

string

Must be a non-empty string. Check length > 0. If null or empty, retry prompt or escalate with a missing-evidence error.

escalation_required

boolean

Must be true if confidence < [CONFIDENCE_THRESHOLD] or severity_score >= [ESCALATION_THRESHOLD]. Parse check; reject if not a strict boolean.

recommended_action

string

Must be a non-empty string. Validate against a list of allowed actions (e.g., 'ESCALATE_TO_HUMAN', 'AUTO_CONTAIN', 'MONITOR') if a policy list is provided; otherwise, check length > 0.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when scoring security events in production and how to guard against it. Each failure mode includes a detection method and a remediation step.

01

Score Drift Across Analysts

What to watch: Different analysts or model runs assign inconsistent severity scores to similar events, eroding triage trust. Guardrail: Embed a calibration set of 5-10 canonical events with expected scores in the prompt. Validate output against these anchors on every run and flag variance above 1 severity level for human review.

02

Alert Fatigue from Over-Scoring

What to watch: The prompt defaults to high severity when uncertain, flooding the SOC with false positives and causing real threats to be missed. Guardrail: Require the prompt to output a confidence indicator alongside the score. Route low-confidence, high-severity events to a review queue rather than triggering an immediate alert.

03

Stale MITRE ATT&CK Mapping

What to watch: The model maps events to deprecated or irrelevant technique IDs because its training data lags behind the current ATT&CK framework version. Guardrail: Provide the current technique list and relevant sub-techniques as part of the prompt context. Add a post-processing check that rejects any technique ID not present in the provided list.

04

Ignoring Asset Criticality Weighting

What to watch: The model treats a phishing alert on a public blog and a domain controller as equally severe, missing the blast radius context. Guardrail: Supply a structured asset criticality lookup table as a tool or context block. Instruct the prompt to explicitly cite the asset tier in its reasoning and weight the score accordingly.

05

Hallucinated Evidence Citations

What to watch: The model fabricates log entries, source IPs, or file hashes to justify its score, leading analysts on a wild goose chase. Guardrail: Constrain the output schema to require verbatim quotes from the provided log data for each evidence claim. Implement a post-generation check that verifies quoted strings exist in the input.

06

Context Window Truncation

What to watch: Large raw log dumps exceed the context window, causing the model to score an event based on only the first portion of the data and miss critical indicators later in the payload. Guardrail: Pre-process logs to extract and summarize relevant fields before prompting. If truncation is unavoidable, add a truncation_warning flag to the output schema and downgrade the confidence score.

IMPLEMENTATION TABLE

Evaluation Rubric

How to test output quality before shipping. Run these checks against a golden dataset of 50 events with known-good scores from senior analysts.

CriterionPass StandardFailure SignalTest Method

Severity Score Calibration

Score is within ±1 of the senior analyst's score for 90% of the golden dataset

Scores deviate by 2+ points on more than 5 events; systematic over-scoring or under-scoring on specific event types

Calculate mean absolute error across the 50-event golden dataset; flag events where deviation exceeds threshold

MITRE ATT&CK Mapping Accuracy

Primary technique matches the analyst-assigned technique for 85% of events; secondary techniques are plausible

Hallucinated technique IDs not present in the MITRE framework; technique assigned to wrong tactic category

Validate technique IDs against the official MITRE ATT&CK STIX dataset; check tactic-to-technique parent relationships

Asset Criticality Weighting Consistency

Asset criticality modifier is applied correctly per the defined asset classification table in 100% of cases

Critical asset modifier omitted for a known critical asset; low-value asset receives high-criticality weighting without justification

Cross-reference [ASSET_CONTEXT] field against the asset criticality lookup table; verify modifier arithmetic in the score breakdown

Confidence Indicator Honesty

Confidence is LOW when evidence is missing, contradictory, or based on a single weak signal; HIGH only when multiple corroborating sources exist

HIGH confidence assigned to events with a single log source; confidence remains HIGH despite explicit uncertainty notes in the output

Parse the [CONFIDENCE] field; check that the number of evidence sources and their reliability ratings support the stated confidence level

Evidence Source Grounding

Every claim in the justification references a specific log field, alert ID, or observable from the [INPUT_EVENT]

Justification contains claims not traceable to any field in the input; fabricated timestamps or user identities appear

Extract all factual claims from the justification; grep each claim against the raw [INPUT_EVENT] payload; flag unmatched claims

Escalation Recommendation Correctness

Escalation flag matches the analyst's decision for 95% of events; no critical events are missed for escalation

Critical-severity event with confirmed indicators of compromise receives a do-not-escalate recommendation; low-severity false positive triggers escalation

Compare the [ESCALATE] boolean against the golden dataset label; measure recall on critical events and precision on low-severity events

Output Schema Compliance

Response parses as valid JSON matching the [OUTPUT_SCHEMA] on the first attempt with no missing required fields

Missing required field such as severity_score or justification; enum value outside allowed set; trailing text after JSON closing brace

Validate output against the JSON Schema definition; check enum membership for all constrained fields; reject responses that fail strict parsing

Inter-Analyst Consistency

Score distribution across the 50 events has a standard deviation below 1.5 when compared to the pool of senior analyst scores

Wide variance on the same event type across multiple runs; model assigns severity 2 and severity 8 to semantically similar events

Run the prompt 3 times per event with temperature=0; measure score variance per event; flag events with variance > 2 for prompt revision

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a single event type. Remove strict schema enforcement and focus on getting a reasonable severity score and MITRE mapping. Use a lightweight JSON output without nested validation.

code
Score this security event on a 1-10 severity scale.
Event: [EVENT_JSON]
Return: {"severity": number, "rationale": string}

Watch for

  • Scores drifting toward the middle (5-7) without clear differentiation
  • MITRE mappings that sound plausible but are wrong
  • No consistency between identical events scored at different times
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.