Security engineers and DevSecOps teams use this prompt to move from a raw list of static analysis findings to a risk-prioritized action queue. The core job is exploitability triage: determining whether a specific finding represents a viable attack path in a production deployment. This prompt is designed for the moment after a SAST scan completes and before findings are assigned to development teams. It prevents alert fatigue by filtering out findings that are theoretically interesting but practically unreachable due to authentication gates, network segmentation, input validation layers, or deployment architecture. The ideal user is a security engineer or senior developer who can provide the finding details, relevant code snippets, and a description of the deployment context.
Prompt
SAST Finding Exploitability Assessment Prompt

When to Use This Prompt
Defines the job-to-be-done, ideal user, required context, and boundaries for the SAST exploitability assessment prompt.
To use this prompt effectively, you must supply three categories of input. First, the finding itself: the tool name, rule ID, severity, description, and the exact file paths and line numbers involved. Second, code context: the vulnerable code, any calling functions, and relevant validation or sanitization logic. Third, deployment and architecture context: how the application is deployed, which services are publicly exposed, what authentication and authorization mechanisms are in place, and what network controls exist. Without this context, the model cannot assess reachability or input controllability and will default to theoretical severity, which defeats the purpose of the assessment. The prompt is not a replacement for penetration testing, dynamic analysis, or runtime verification. It is a structured reasoning tool that helps you make faster, more consistent triage decisions at scale.
Do not use this prompt for findings where you lack deployment context or where the code is too complex to describe in a single prompt. It is also unsuitable for findings that require dynamic confirmation, such as deserialization gadgets that depend on runtime classpaths or vulnerabilities that require chaining multiple obscure components. For findings in regulated environments, always route the output through a human review step before closing or suppressing any alert. The next section provides the copy-ready prompt template you can adapt for your specific SAST tool and deployment environment.
Use Case Fit
Where this prompt works, where it fails, and what you must provide before trusting the output.
Good Fit: Context-Rich Findings
Use when: the SAST tool provides data flow paths, source-sink traces, or code snippets. The prompt excels at reasoning about reachability and control flow when evidence is present. Avoid when: the finding is a single-line alert with no surrounding context or data flow graph.
Bad Fit: Zero-Context Alerts
Avoid when: the finding lacks code context, variable definitions, or call paths. Without evidence, the model hallucinates plausible but incorrect exploit chains. Guardrail: require a minimum context window of the full function or file before invoking the prompt.
Required Inputs
Must provide: the raw SAST finding (rule ID, severity, message), the flagged code block, and the deployment architecture context (public/internal, auth model, network boundaries). Guardrail: if any input is missing, route to a human triage queue instead of generating an assessment.
Operational Risk: Overconfidence
What to watch: the model may assert exploitability with high confidence even when critical runtime details are unknown. Guardrail: require explicit confidence scoring per finding and flag any assessment above 'Medium' confidence for human review before it reaches a remediation backlog.
Operational Risk: Architecture Drift
What to watch: the prompt relies on deployment context that may be stale. A finding assessed as 'not exploitable' in a private VPC becomes critical after a network policy change. Guardrail: timestamp the architecture context used and re-assess findings when deployment topology changes.
Not a Replacement for Penetration Testing
What to watch: teams may treat the prompt's exploitability rating as equivalent to a manual pentest finding. Guardrail: label all outputs as 'static analysis interpretation, not verified exploitation.' Require manual validation for any finding rated 'Likely Exploitable' before it drives a security incident response.
Copy-Ready Prompt Template
A copy-ready prompt for assessing whether a static analysis finding represents an exploitable vulnerability in a production context.
This prompt template is designed for security engineers who need to move beyond raw SAST severity scores and determine if a finding is actually reachable and exploitable by an attacker. It forces structured reasoning about the attack path, required preconditions, and existing defenses before producing a final rating. The template is self-contained and can be pasted directly into an LLM interface after replacing the placeholders with real data from your SAST tool and deployment context.
codeYou are a senior application security engineer triaging a static analysis finding. Your task is to assess whether this finding represents a genuinely exploitable vulnerability in the target production environment, or whether it is a false positive, unreachable, or mitigated by existing controls. ## INPUT ### Finding - **Tool:** [SAST_TOOL_NAME] - **Rule ID:** [RULE_ID] - **Rule Description:** [RULE_DESCRIPTION] - **Severity:** [TOOL_SEVERITY] - **File:** [FILE_PATH] - **Line:** [LINE_NUMBER] - **Code Snippet:** ```[LANGUAGE] [CODE_SNIPPET]
- Data Flow Trace (if available): [DATA_FLOW_TRACE]
Deployment Context
- Service Name: [SERVICE_NAME]
- Exposure: [INTERNET_FACING | INTERNAL_ONLY | ADMIN_ONLY | OTHER]
- Authentication Required: [YES | NO | PARTIAL]
- Authorization Model: [DESCRIBE_AUTHZ]
- Data Sensitivity: [PII | FINANCIAL | HEALTH | INTERNAL | PUBLIC | OTHER]
- Existing Mitigations: [WAF | INPUT_VALIDATION | SANITIZATION | RATE_LIMITING | NETWORK_SEGMENTATION | OTHER]
- Threat Model Notes: [ANY_RELEVANT_THREAT_MODEL_CONTEXT]
CONSTRAINTS
- Do not assume an attacker has already bypassed authentication unless the finding itself enables authentication bypass.
- Consider the full attack path from entry point to impact, not just the flagged line.
- If the code is in a test file, dead code path, or unreachable internal utility, note this explicitly.
- Distinguish between "exploitable in theory" and "exploitable given the current deployment context."
- If you lack sufficient information to make a determination, state what is missing rather than guessing.
OUTPUT_SCHEMA
Return a JSON object with the following structure: { "finding_id": "[RULE_ID]@[FILE_PATH]:[LINE_NUMBER]", "exploitability_rating": "EXPLOITABLE | LIKELY_EXPLOITABLE | UNLIKELY_EXPLOITABLE | NOT_EXPLOITABLE | INSUFFICIENT_EVIDENCE", "attack_path_reachable": true | false | "unknown", "attack_path_description": "Step-by-step description of how an attacker would reach and exploit this code path, or why it is unreachable.", "preconditions": ["List of conditions that must be true for exploitation to succeed"], "existing_defenses": ["List of existing controls that mitigate or prevent exploitation"], "impact_if_exploited": "Description of the worst-case impact if this finding were successfully exploited.", "confidence": "HIGH | MEDIUM | LOW", "evidence_chain": ["Ordered list of evidence supporting the rating, from code patterns to deployment facts"], "missing_information": ["List of facts that would change the assessment if known"], "recommended_next_steps": ["Concrete actions: manual review, dynamic testing, code fix, suppress finding, escalate"] }
EXAMPLES
Example 1: SQL Injection in Internal Admin Tool
Input: SQL injection finding in an internal admin dashboard behind VPN and SSO, with parameterized queries already used in 95% of the codebase but one concatenation found in a reporting endpoint. Output: { "finding_id": "java/sql-injection@ReportsController.java:142", "exploitability_rating": "UNLIKELY_EXPLOITABLE", "attack_path_reachable": true, "attack_path_description": "An authenticated admin user could craft a malicious report parameter that reaches the string concatenation in buildReportQuery(). However, the endpoint is only accessible after SSO authentication and VPN connection.", "preconditions": ["Valid admin SSO credentials", "Active VPN session", "Knowledge of the internal report parameter structure"], "existing_defenses": ["VPN restricts network access to employees only", "SSO enforces MFA for all admin accounts", "Audit logging captures all report queries"], "impact_if_exploited": "An authenticated insider could extract arbitrary data from the reporting database, which contains aggregated business metrics but no PII.", "confidence": "MEDIUM", "evidence_chain": ["Code review confirms string concatenation in query builder", "Deployment config confirms VPN-only access", "IAM policy confirms SSO enforcement", "Data classification confirms no PII in reporting DB"], "missing_information": ["Whether the reporting database has read-replica access to sensitive tables", "Whether audit logs are reviewed for anomalous queries"], "recommended_next_steps": ["Fix the string concatenation to use parameterized query for consistency", "No emergency escalation required", "Add to next sprint backlog as low-priority hardening"] }
codeCopy the template above into your LLM interface. Replace every `[PLACEHOLDER]` with real data from your SAST tool output and deployment context. The more complete your deployment context, the more accurate the exploitability assessment will be. If your SAST tool provides a data flow trace, include it verbatim—the model can reason about taint propagation and sanitizer placement better when it sees the full path.
After running the prompt, validate the output JSON against the schema before using the result in any automated pipeline. If the exploitability_rating is INSUFFICIENT_EVIDENCE, route the finding to a human security engineer with the missing_information list as an investigation guide. For findings rated EXPLOITABLE or LIKELY_EXPLOITABLE, the evidence_chain field serves as documentation for your vulnerability management system and should be preserved alongside the finding for auditability.
Prompt Variables
Each placeholder must be populated for reliable output. Missing or vague variables degrade assessment quality.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[SAST_FINDING] | The raw static analysis finding including rule ID, message, file path, line number, and code snippet | {"rule_id": "java/tainted-path", "message": "Untrusted data reaches a sink", "file": "src/auth/Login.java", "line": 42, "snippet": "String query = request.getParameter("user"); executeQuery(query);"} | Must contain file path, line number, and code snippet. Reject if snippet is truncated or line number is missing. |
[REPOSITORY_CONTEXT] | Surrounding code context including imports, class definition, method signatures, and callers within 50 lines of the finding | import javax.servlet.http.*; public class Login extends HttpServlet { protected void doPost(...) { ... } } | Must include at least 30 lines of surrounding code. Reject if context is empty or only contains the flagged line. |
[DEPLOYMENT_CONTEXT] | Deployment environment details: network exposure, authentication requirements, data classification, and runtime protections | {"network": "internal-vpc", "auth_required": true, "data_classification": "PII", "runtime_protections": ["WAF", "input_validation_filter"]} | Must include network exposure and auth_required fields. Null allowed for runtime_protections if unknown. |
[THREAT_MODEL] | Relevant threat model entries describing the asset, trust boundaries, and threat actors for the component under review | {"asset": "user_session_token", "trust_boundary": "web-to-app", "threat_actors": ["unauthenticated_remote"], "impact": "account_takeover"} | Must reference the asset affected by the finding. Reject if threat_model references unrelated components. |
[EXISTING_MITIGATIONS] | List of existing security controls, sanitizers, validators, or compensating controls in the code path | ["input_validation_filter at line 28", "prepared_statement at line 55", "csrf_token_check at line 12"] | Must be specific to the code path in the finding. Empty array allowed if no mitigations exist. Reject if mitigations reference unrelated code. |
[OUTPUT_SCHEMA] | Expected JSON schema for the exploitability assessment output including rating, evidence chain, and confidence fields | {"exploitability_rating": "enum:high|medium|low|none", "attack_path_reachable": "boolean", "auth_required": "boolean", "input_controllable": "boolean", "evidence_chain": "string[]", "confidence": "float:0.0-1.0"} | Must include exploitability_rating enum and confidence float. Reject if schema allows ratings outside the defined enum. |
[CONSTRAINTS] | Operational constraints: maximum token budget, required evidence citations, uncertainty thresholds, and human-review triggers | {"max_tokens": 2000, "require_line_citations": true, "min_confidence_for_auto_close": 0.85, "human_review_threshold": "medium_or_higher"} | Must specify human_review_threshold. Reject if constraints conflict with output schema requirements. |
Implementation Harness Notes
How to wire this prompt into a security triage application or CI/CD pipeline.
This prompt is designed to operate as a decision-support step inside a larger SAST triage pipeline, not as a standalone chatbot. The model receives a single finding, its surrounding code context, and deployment metadata, then returns a structured exploitability assessment. The calling application is responsible for fetching the right context, enforcing the output schema, and deciding what happens next based on the assessment. Do not expose this prompt directly to end users or allow free-form follow-up questions without guardrails.
Wire the prompt into your pipeline by building a thin orchestration layer that performs the following steps for each finding: (1) Fetch the finding details from your SAST tool's API or export. (2) Retrieve the relevant source file snippet, including the flagged line and 20-30 lines of surrounding context. (3) Pull deployment context from your CMDB or infrastructure-as-code repo: is the affected service internet-facing? What authentication and authorization controls sit in front of it? What WAF, input validation, or sanitization layers exist? (4) Assemble these into the [FINDING_DETAILS], [CODE_CONTEXT], and [DEPLOYMENT_CONTEXT] placeholders. (5) Call the model with the prompt template and validate the response against the expected JSON schema before proceeding. (6) Route the result: findings rated EXPLOITABLE or LIKELY_EXPLOITABLE should create a high-priority ticket or block the release; UNLIKELY findings can be logged for periodic review; NOT_EXPLOITABLE findings with strong evidence can be auto-suppressed with an audit trail.
Validation and retry logic are critical because the output drives security decisions. Implement a JSON schema validator that checks for the required fields (exploitability_rating, attack_path_summary, evidence_chain, confidence_score) and enforces the enum values for exploitability_rating. If validation fails, retry once with the same input and an added instruction to correct the specific schema error. If the second attempt fails, log the finding for human review and do not auto-suppress. For model choice, use a model with strong reasoning capabilities (GPT-4o, Claude 3.5 Sonnet, or equivalent) because exploitability assessment requires multi-step causal reasoning about attack paths and control interactions. Avoid smaller or faster models for this task unless you have calibrated their performance on your specific finding types and codebase.
Human review gates are non-negotiable for findings rated EXPLOITABLE or LIKELY_EXPLOITABLE. The model's assessment should accelerate triage, not replace security engineering judgment. Route these findings to a review queue with the full model output, the original finding, and a link to the code. For UNCERTAIN findings, batch them for weekly review by the security team to identify patterns and improve the prompt's context or examples. Log every assessment with the model version, prompt version, input context, and output for auditability. This log becomes your evidence trail for compliance reviews and your dataset for evaluating prompt changes over time.
Do not use this prompt in a fully automated blocking pipeline without a human review step for high-severity findings. The model can misjudge exploitability when deployment context is incomplete, when custom framework behaviors are not described in the code context, or when novel attack techniques are involved. Start with a shadow mode deployment where the model's assessments are logged alongside human triage decisions for 2-4 weeks. Compare agreement rates, identify systematic errors, and tune the prompt's [CONSTRAINTS] and [EXAMPLES] sections before moving to partial automation. Even after tuning, maintain the human review gate for EXPLOITABLE findings and periodically audit NOT_EXPLOITABLE classifications to catch drift.
Expected Output Contract
The model must return a JSON object matching this schema. Validate before accepting the response. Reject or retry on schema violations.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
finding_id | string | Must match the [FINDING_ID] from the input. Non-empty. | |
exploitability_rating | enum string | Must be one of: exploitable, likely_exploitable, unlikely_exploitable, not_exploitable, insufficient_evidence. Case-sensitive. | |
attack_path_reachable | boolean | Must be true or false. If true, attack_path_description is required. | |
attack_path_description | string or null | Required if attack_path_reachable is true. Must describe the entry point, path, and target. Null allowed otherwise. | |
authentication_required | boolean | Must be true or false. If true, auth_context must describe the required role or privilege level. | |
auth_context | string or null | Required if authentication_required is true. Must specify role, privilege, or access level needed. Null allowed otherwise. | |
input_controllability | enum string | Must be one of: full, partial, none, unknown. Describes attacker control over the vulnerable input. | |
existing_defenses | array of strings | Must be an array. Each element must be a non-empty string naming a defense-in-place (e.g., WAF rule, input sanitizer, authz gate). Empty array allowed. | |
evidence_chain | array of objects | Must be a non-empty array. Each object must contain source (string), observation (string), and relevance (string). Minimum 1 element. | |
confidence_score | number | Must be a float between 0.0 and 1.0 inclusive. Values below 0.6 should trigger a human-review flag in the calling system. | |
remediation_priority | enum string | Must be one of: critical, high, medium, low, informational. Derived from exploitability_rating and asset criticality context. | |
human_review_required | boolean | Must be true if confidence_score < 0.6 or exploitability_rating is insufficient_evidence. Otherwise false. |
Common Failure Modes
What breaks first when assessing SAST finding exploitability in production and how to guard against it.
Overestimating Exploitability
What to watch: The model inflates severity by assuming worst-case attack paths without verifying reachability, authentication gates, or existing compensating controls. Guardrail: Require the prompt to explicitly list required preconditions for exploitation and flag any unmet preconditions as mitigating factors before assigning a final rating.
Underestimating Chained Vulnerabilities
What to watch: The model assesses a finding in isolation and misses that a low-severity bug becomes critical when combined with another finding elsewhere in the codebase. Guardrail: Include a cross-finding correlation step in the prompt that asks whether this finding enables or amplifies any other known vulnerability before finalizing the rating.
Ignoring Deployment Context
What to watch: The model produces a generic exploitability rating without considering whether the vulnerable code path is actually reachable in the deployed configuration, exposed on a public interface, or behind an authentication wall. Guardrail: Inject deployment context into the prompt template, including network exposure, auth requirements, and runtime configuration, and instruct the model to downgrade findings unreachable in production.
Hallucinated Attack Paths
What to watch: The model invents plausible-sounding but non-existent code paths, function calls, or data flows to justify an exploitability claim. Guardrail: Require every step in the attack path to cite a specific source location from the provided SAST finding or code snippet. Add a validator that rejects paths referencing code not present in the input.
Inconsistent Rating Scales
What to watch: The model drifts from the defined exploitability scale across multiple findings, making prioritization unreliable when comparing outputs. Guardrail: Embed the exact rating scale definitions in the prompt with concrete examples for each level. Add a post-processing check that verifies the output rating label matches one of the allowed enum values.
Missing Evidence Chain
What to watch: The model asserts exploitability or non-exploitability without connecting the claim to specific evidence from the SAST tool output, code context, or deployment configuration. Guardrail: Structure the output schema to require an evidence array where each claim is linked to a source. Add an eval that flags outputs with empty or circular evidence chains for human review.
Evaluation Rubric
Test output quality before shipping. Run these checks against a golden dataset of 20-30 findings with known exploitability ground truth.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Exploitability Rating Accuracy | Rating matches ground truth for >= 85% of golden dataset findings | Accuracy below 85% or systematic misclassification of reachable/unreachable paths | Run prompt against golden dataset; compute F1 score per rating class; flag any class with F1 < 0.80 |
Attack Path Reachability Correctness | Reachable/Unreachable determination matches ground truth for >= 90% of findings | Reachable findings labeled unreachable or vice versa in more than 2 of 20 samples | Compare [REACHABLE] output field against golden dataset labels; count mismatches |
Authentication Requirement Assessment | Auth requirement classification (none/user/admin/no-auth-check) matches ground truth for >= 90% of findings | Misclassification of auth level in more than 2 findings; missing auth analysis when endpoint is public | Spot-check [AUTH_REQUIRED] and [AUTH_LEVEL] fields against known endpoint auth configurations |
Input Controllability Judgment | Controllable/Partially/Uncontrollable rating matches ground truth for >= 85% of findings | User-controlled input labeled as uncontrollable; missing analysis of input sanitization or validation gates | Compare [INPUT_CONTROLLABLE] field against golden dataset; verify sanitizer presence is noted in [EXISTING_DEFENSES] |
Existing Defense Recognition | All documented defenses (WAF rules, sanitizers, auth guards, rate limits) are identified in >= 80% of cases | Missing a known defense that neutralizes the finding; failing to list a compensating control that changes exploitability | Audit [EXISTING_DEFENSES] array against known defense inventory for each golden sample; count omissions |
Evidence Chain Completeness | Every exploitability rating includes >= 3 concrete evidence points from code, config, or deployment context | Ratings with 0-1 evidence points; evidence that references code paths not present in the finding; hallucinated mitigations | Parse [EVIDENCE_CHAIN] array; verify each entry references a real file path, config key, or deployment fact from the input |
Confidence Score Calibration | Confidence scores correlate with correctness: high-confidence predictions are correct >= 90% of the time | High-confidence (>= 0.8) predictions with wrong ratings; low-confidence predictions that are always correct suggesting miscalibration | Bin predictions by confidence decile; compute accuracy per bin; flag if high-confidence bin accuracy < 0.90 |
Uncertainty Flagging for Edge Cases | Findings with insufficient context or ambiguous reachability are flagged with confidence < 0.6 and routed to human review | Ambiguous findings receiving high-confidence ratings; missing [HUMAN_REVIEW_REQUIRED] flag on findings with incomplete data | Identify golden samples with intentionally incomplete context; verify [CONFIDENCE] < 0.6 and [HUMAN_REVIEW_REQUIRED] is true |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet) and manual review of each output. Skip strict schema enforcement initially. Focus on getting the exploitability reasoning chain right before adding validation layers.
Replace [OUTPUT_SCHEMA] with a simple markdown structure:
code## Exploitability Rating: [HIGH/MEDIUM/LOW/UNCERTAIN] ## Attack Path Summary ## Key Assumptions ## Evidence Gaps
Watch for
- Overconfident ratings without evidence chains
- Missing authentication boundary analysis
- Model hallucinating deployment context not provided in
[DEPLOYMENT_CONTEXT]

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