Use this prompt when you need a security engineer or architect to produce a consistent, structured threat assessment for a described system, component, or architecture. The core job-to-be-done is transforming a natural-language system description into a repeatable threat model that identifies attack vectors, estimates business impact, and proposes concrete mitigations. This prompt is ideal for design reviews, security backlog grooming, and internal security documentation where the primary goal is to teach a reasoning pattern through worked examples rather than exhaustive instruction sets. The ideal user is a security practitioner or platform engineer who can provide a clear system boundary, a data flow summary, and a trust model, and who will review the output for accuracy before it enters any decision pipeline.
Prompt
Threat Analysis Reasoning Pattern Transfer Prompt

When to Use This Prompt
Defines the ideal use cases, required inputs, and critical limitations for the Threat Analysis Reasoning Pattern Transfer Prompt.
The prompt requires a specific set of inputs to function reliably. You must provide a [SYSTEM_DESCRIPTION] that includes components, data flows, trust boundaries, and external dependencies. You must also supply a curated set of [WORKED_EXAMPLES] that demonstrate the exact threat-to-mitigation reasoning pattern you want the model to replicate. Each example should show a system snippet, a structured threat analysis, and the logical connection between them. Without high-quality, domain-relevant examples, the model will default to generic threat lists that miss system-specific risks. The prompt is designed for offline or asynchronous analysis, not for real-time incident response, automated blocking decisions, or any workflow where a false negative could cause immediate harm without human review. In those high-stakes scenarios, the model's output must be treated as a suggestion that requires human approval before action.
Do not use this prompt when the system description is too vague to establish a clear trust boundary, when you lack the expertise to validate the output, or when the analysis must meet a formal compliance standard such as PCI DSS or SOC 2 without further human attestation. The prompt is a reasoning accelerator, not a replacement for a qualified security reviewer. The most common failure modes—overestimation of low-probability threats, underestimation of insider risks, and complete blindness to entire threat categories like supply chain or physical attacks—are mitigated by the example set, but they are not eliminated. Before putting this prompt into a production harness, you must pair it with an evaluation rubric that checks for missing STRIDE categories, impact inflation, and mitigation vagueness. The next step after reading this section is to prepare your system description and select at least three worked examples that represent the threat diversity you expect in production.
Use Case Fit
Where the Threat Analysis Reasoning Pattern Transfer Prompt works, where it fails, and the operational prerequisites for production use.
Good Fit: Structured Threat Modeling Sessions
Use when: Security teams need consistent threat descriptions with attack vectors, impact, and mitigations during design reviews. Guardrail: Lock the output schema to a structured format (e.g., STRIDE or custom taxonomy) and validate that every threat includes all required fields before accepting the response.
Bad Fit: Novel Zero-Day Discovery
Avoid when: The goal is to discover entirely new vulnerability classes or zero-day exploits. The model reasons by analogy to demonstrated patterns. Guardrail: Pair this prompt with external threat intelligence feeds and require a human security researcher to review any finding flagged as novel before it enters an incident response pipeline.
Required Input: System Architecture Context
Risk: Without a detailed system description, data flow diagram, or trust boundary map, the model produces generic threats that waste review time. Guardrail: Gate the prompt behind a context completeness check—if trust boundaries, external dependencies, or data classifications are missing, refuse to generate threats and request the missing context first.
Required Input: Worked Threat Examples
Risk: The reasoning pattern transfer depends entirely on the quality and coverage of the few-shot examples provided. Poor examples teach the model to miss entire threat categories. Guardrail: Maintain a curated example set that spans all relevant threat categories (spoofing, tampering, repudiation, information disclosure, denial of service, elevation of privilege) and update it when new attack patterns emerge in your domain.
Operational Risk: Threat Overestimation
Risk: The model inflates severity or invents plausible-sounding but unrealistic attack chains to match the demonstrated reasoning depth. Guardrail: Require a second-pass verification prompt that asks the model to identify the weakest assumption in each threat and rate its real-world feasibility. Flag threats where the feasibility rating is low for human review.
Operational Risk: Missing Threat Categories
Risk: The model over-indexes on the threat types shown in examples and silently omits categories not represented in the few-shot set. Guardrail: After threat generation, run a coverage check that maps output threats to a standard taxonomy and flags missing categories. If coverage gaps exceed a threshold, re-prompt with examples from the missing categories.
Copy-Ready Prompt Template
A reusable prompt template for teaching structured threat assessment through worked examples, ready to adapt with your system context, examples, and input.
This prompt template encodes a reasoning pattern for structured threat analysis. Instead of describing how to think about threats, it demonstrates the pattern through a worked example, then asks the model to apply the same reasoning structure to a new target. Replace each square-bracket placeholder with your specific context before sending to the model. The template is designed for security teams who need consistent threat descriptions covering attack vectors, impact, and mitigations, with explicit checks against overestimation, underestimation, and missing threat categories.
textSYSTEM: You are a security analyst conducting structured threat assessments. Follow the reasoning pattern demonstrated in the example. Do not skip steps. For each threat you identify, you must provide: (1) the threat description, (2) the attack vector, (3) the potential impact, (4) suggested mitigations, and (5) a confidence level. After listing all threats, perform a self-check for overestimation, underestimation, and missing threat categories. If the target system description is insufficient to assess a category, state that explicitly rather than guessing. EXAMPLE INPUT: [EXAMPLE_SYSTEM_DESCRIPTION] EXAMPLE OUTPUT: [EXAMPLE_THREAT_ASSESSMENT] TARGET INPUT: [TARGET_SYSTEM_DESCRIPTION] OUTPUT SCHEMA: { "threats": [ { "id": "string", "description": "string", "attack_vector": "string", "impact": "string", "mitigations": ["string"], "confidence": "low|medium|high" } ], "self_check": { "overestimation_risks": ["string"], "underestimation_risks": ["string"], "missing_categories": ["string"], "insufficient_information": ["string"] } } CONSTRAINTS: - Do not invent threats for which there is no evidence in the target description. - If the target description lacks detail for a standard threat category, note it under insufficient_information. - Confidence must reflect the specificity of the target description, not general possibility. - Limit the assessment to [MAX_THREATS] threats, prioritizing by likelihood and impact. - [ADDITIONAL_CONSTRAINTS]
To adapt this template, replace [EXAMPLE_SYSTEM_DESCRIPTION] with a concise description of a system similar to what you'll assess in production, and [EXAMPLE_THREAT_ASSESSMENT] with a complete, correct threat assessment following the output schema exactly. The example is the teaching mechanism—invest effort here. Replace [TARGET_SYSTEM_DESCRIPTION] with the actual system you want assessed. Set [MAX_THREATS] to a reasonable bound for your use case. Add any domain-specific threat categories or compliance requirements under [ADDITIONAL_CONSTRAINTS]. Before deploying, validate that the example output matches the schema exactly and that the reasoning pattern transfers correctly by testing against at least three known target descriptions with expected threat profiles. For high-risk security assessments, always route outputs through human review before actioning mitigations.
Prompt Variables
Inputs the prompt needs to work reliably. Validate each before sending.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[THREAT_DOMAIN] | Defines the scope of the threat analysis to prevent the model from mixing IT, physical, and geopolitical threats. | Cloud infrastructure misconfiguration | Must match a value from an approved domain enum. Reject empty strings or overly broad values like 'security'. |
[SYSTEM_DESCRIPTION] | Provides the target system's architecture, data flows, and trust boundaries for the model to reason over. | A multi-tenant Kubernetes cluster hosting a customer data API with a public-facing ingress and a PostgreSQL backend. | Minimum 50 characters. Must contain at least one trust boundary keyword (e.g., 'public', 'internal', 'admin'). Reject if it is just a product name. |
[ASSET_INVENTORY] | Lists critical assets and their sensitivity levels to prioritize threat impact assessment. | Customer PII (High), API Keys (Critical), Payment Logs (High), System Metrics (Low). | Must be a structured list. Each asset requires a sensitivity label from a controlled vocabulary. Reject if no 'Critical' or 'High' asset is present. |
[WORKED_EXAMPLE_INPUT] | A demonstration of a similar system description and asset list to prime the reasoning pattern. | System: A serverless image processing pipeline. Assets: Raw user photos (High), Thumbnail cache (Low). | Must be a valid JSON object matching the input schema. Validate structural parity with the real [SYSTEM_DESCRIPTION] and [ASSET_INVENTORY] fields. |
[WORKED_EXAMPLE_OUTPUT] | A demonstration of the exact threat analysis output format expected, including reasoning trace. | Threat: Unauthorized access to raw photos via pre-signed URL brute-force. Attack Vector: ... | Must be a valid JSON object matching the [OUTPUT_SCHEMA]. The reasoning trace must explicitly reference elements from the [WORKED_EXAMPLE_INPUT]. |
[OUTPUT_SCHEMA] | The strict JSON schema the final output must conform to, including required fields for threat, vector, impact, and mitigation. | { 'type': 'object', 'properties': { 'threats': { 'type': 'array' ... } } } | Must be a valid, parseable JSON Schema (Draft 7 or later). Reject if the 'threats' array definition is missing or if 'additionalProperties' is not set to false. |
[CONSTRAINTS] | Hard behavioral rules to prevent common failure modes like overestimation or missing threat categories. | Do not speculate on physical security. If no high-severity threat is found, state 'No critical threats identified' explicitly. | Must include an explicit instruction for handling the 'no threat found' case. Reject if it contains contradictory instructions like 'be creative' alongside 'be conservative'. |
Implementation Harness Notes
How to wire the Threat Analysis Reasoning Pattern Transfer Prompt into a security review application or workflow.
This prompt is designed to be integrated into a security operations or threat modeling pipeline, not used as a standalone chat interface. The core implementation pattern involves a pre-processing stage to assemble the system context, a model invocation stage with strict output validation, and a post-processing stage that logs the structured threat assessment and routes it for human review. Because the output directly informs security decisions, the harness must treat the model's response as a draft analysis that requires expert validation before it becomes an actionable finding.
The application layer should construct the [SYSTEM_CONTEXT] variable by pulling data from asset inventories, architecture diagrams, or previous threat models. The [WORKED_EXAMPLE] placeholder should be populated from a curated library of high-quality, peer-reviewed threat analyses stored in a database, ensuring the example format exactly matches the desired output schema. After the model responds, the harness must validate the output against a strict JSON schema that enforces the presence of required fields (attack_vector, impact, mitigations, risk_level). A failed validation should trigger a single retry with the validation error message injected into the [CONSTRAINTS] field. If the retry also fails, the task must be escalated to a human analyst queue with the raw output attached for manual repair.
For production deployment, use a model with strong reasoning capabilities and a large context window, such as claude-sonnet-4-20250514 or gpt-4o, to handle the detailed worked example and system context. Implement structured logging that captures the prompt version, the specific example used, the raw model output, and the final validated threat object. This trace is critical for regression testing when the prompt or example library is updated. To guard against the common failure modes of overestimation and underestimation, implement a post-hoc evaluator prompt that scores the output on a severity_alignment rubric, comparing the assigned risk level against the described impact. Any output with a low alignment score should be flagged for mandatory human review before it enters the case management system.
Expected Output Contract
Defines the fields, types, and validation rules for the structured threat analysis object the model must return. Use this contract to build a post-processing validator or retry loop.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
threat_id | string | Must match pattern THREAT-[YYYYMMDD]-[0-9]{4}. Parse check. | |
title | string | Length between 10 and 120 characters. Not null or empty. | |
description | string | Must contain at least one complete sentence describing the threat scenario. Length > 50 chars. | |
attack_vector | string | Must reference a specific technique, entry point, or method. Check against a known taxonomy like MITRE ATT&CK if applicable. | |
impact_assessment | object | Must contain 'confidentiality', 'integrity', and 'availability' sub-fields, each with a value of 'low', 'moderate', or 'high'. | |
affected_assets | array of strings | Minimum 1 item. Each item must be a non-empty string. Null or empty array triggers retry. | |
proposed_mitigations | array of objects | Each object must have 'action' (string) and 'priority' (enum: 'critical', 'high', 'medium', 'low') fields. Minimum 1 item. | |
confidence_score | number | Must be a float between 0.0 and 1.0. Values below 0.5 should trigger a human review flag in the application layer. |
Common Failure Modes
When transferring threat analysis reasoning patterns through examples, these failures emerge first in production. Each card pairs a specific failure with a concrete guardrail.
Pattern Overfitting to Example Threats
What to watch: The model reproduces threat categories, attack vectors, or severity levels that appear in the examples but don't apply to the new input. It mirrors example structure without adapting reasoning to the actual system under analysis. Guardrail: Include at least one counterexample where a threat category from the examples is explicitly marked as not applicable, with reasoning for why it was excluded. Validate outputs by checking for threat categories absent from the input context.
Threat Severity Inflation
What to watch: The model systematically overestimates impact or likelihood, especially when examples contain high-severity threats. It learns that dramatic assessments match the demonstration pattern and applies inflated ratings to mundane findings. Guardrail: Include calibrated examples spanning the full severity range, with explicit severity criteria in each demonstration. Add a post-processing check that flags outputs where all threats are rated critical or high without proportional justification.
Missing Threat Categories Outside Example Distribution
What to watch: The model fails to identify threat types that don't appear in any example, even when evidence for them exists in the input. Novel attack surfaces, uncommon vulnerability classes, or domain-specific risks are silently omitted. Guardrail: Include a structured threat taxonomy reference in the prompt alongside examples, and add an explicit instruction to flag any potential threats that fall outside the demonstrated categories. Test with inputs containing threat types deliberately excluded from examples.
Reasoning Trace Drift Under Input Complexity
What to watch: When inputs are longer or more complex than the examples, the model's chain-of-thought degrades—skipping steps, merging distinct threats, or losing the structured attack-vector-to-impact-to-mitigation mapping demonstrated in simpler cases. Guardrail: Include at least one complex, multi-system example in the demonstration set. Validate output structure by checking that each identified threat has all required reasoning fields populated, and trigger a retry with explicit step-by-step instructions if fields are missing.
Mitigation-Example Mismatch
What to watch: The model proposes mitigations that match the pattern of example mitigations rather than the actual threat. It recommends generic controls from the demonstrations instead of analyzing the specific attack vector and system constraints in the input. Guardrail: Require each mitigation to reference a specific attack vector from the same threat entry. Add a validation step that checks whether mitigations address the identified vector or are templated responses. Include examples where similar threats receive different mitigations due to system context differences.
False Consensus Across Ambiguous Evidence
What to watch: When input evidence is incomplete or ambiguous, the model defaults to the confidence level and decisiveness shown in examples rather than expressing appropriate uncertainty. It presents speculative threats as confirmed findings. Guardrail: Include examples with explicit uncertainty markers, evidence gaps, and confidence qualifiers. Add an output validation rule that flags threat entries lacking uncertainty language when input evidence is thin. Require a confidence level field in the output schema and test with deliberately incomplete inputs.
Evaluation Rubric
Score each dimension on a pass/fail basis using a set of 10-20 test system descriptions with known threat profiles. Each criterion targets a specific failure mode observed in threat analysis reasoning transfer.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Threat Category Coverage | Output identifies threat categories matching the known profile within one category of ground truth | Missing entire threat categories present in the known profile; over-indexing on a single category | Compare extracted threat categories against labeled ground truth for 20 test systems |
Attack Vector Specificity | Each threat includes at least one concrete attack vector with entry point, method, and prerequisite | Vague vectors like 'network attack' or 'social engineering' without specific technique or entry point | Parse output for attack vector objects; check that [METHOD], [ENTRY_POINT], and [PREREQUISITE] fields are non-null and non-generic |
Impact Severity Calibration | Severity rating matches ground truth within one level on a 5-point scale for 90% of test cases | Systematic overestimation of low-severity threats or underestimation of critical threats by two or more levels | Calculate severity delta between output and ground truth across 20 test cases; flag if mean absolute error exceeds 1.0 |
Mitigation Relevance | Each mitigation directly addresses the identified attack vector and is actionable by the system owner | Mitigations that are generic security advice unrelated to the specific vector; missing mitigations for high-severity threats | Map each mitigation to its corresponding attack vector; verify relevance through keyword overlap and actionability check |
Reasoning Trace Completeness | Chain-of-thought includes explicit steps connecting system description to threat identification to impact assessment | Skipped reasoning steps where threat appears without intermediate analysis; conclusion without supporting evidence from system description | Parse reasoning trace for required segments: [OBSERVATION], [HYPOTHESIS], [EVIDENCE], [CONCLUSION]; fail if any segment is empty or missing |
False Positive Rate | No more than one hallucinated threat per test case that does not exist in the ground truth profile | Inventing threats with no basis in the system description; fabricating vulnerabilities for components not mentioned in input | Cross-reference each output threat against ground truth; count threats with zero evidence in [SYSTEM_DESCRIPTION] |
Evidence Grounding | Every threat claim references a specific element from the system description as supporting evidence | Threat claims stated as fact without citation to system component, configuration, or property from input | Extract evidence references from output; verify each maps to a substring or entity in [SYSTEM_DESCRIPTION]; fail if any threat lacks grounding |
Boundary Refusal Handling | Output explicitly notes when insufficient information prevents threat assessment and declines to speculate | Confidently assessing threats for system components or scenarios not described in the input; filling gaps with assumptions | Check for presence of [UNCERTAINTY_FLAG] or explicit abstention when [SYSTEM_DESCRIPTION] lacks detail on a domain; fail if model invents details |
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 2-3 worked examples covering a high-severity, a low-severity, and an ambiguous threat scenario. Use the base prompt with minimal output constraints—accept free-text threat descriptions initially. Focus on reasoning pattern transfer rather than schema compliance.
code[SYSTEM]: You are a security analyst reviewing a system for threats. [EXAMPLE INPUT]: A public-facing API accepts user file uploads and stores them in an S3 bucket processed by a serverless function. [EXAMPLE OUTPUT]: ... [INPUT]: [NEW_SYSTEM_DESCRIPTION]
Watch for
- Overestimation when examples all show high-severity threats
- Missing threat categories not represented in your few-shot examples
- Model copying example structure but not the reasoning depth
- No validation on output format, making downstream parsing brittle

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