This prompt is for security and platform engineering teams investigating a confirmed or suspected software supply chain compromise. Use it when you have collected raw evidence—package publish timestamps, commit histories, maintainer account activity, advisory data, and registry audit logs—and need a structured incident narrative. The prompt assumes you are past initial detection and are now in the root cause analysis phase. It synthesizes disparate evidence into a timeline, identifies the likely attack vector, and proposes contributing factors and remediation steps. The ideal user is an incident responder or security engineer who already understands the affected systems and can verify the model's output against ground truth.
Prompt
Supply Chain Incident Root Cause Analysis Prompt

When to Use This Prompt
Defines the operational window, required inputs, and constraints for using the supply chain incident root cause analysis prompt.
Do not use this prompt for real-time intrusion detection, automated blocking decisions, or as a substitute for human-led incident command. It is not a replacement for your SIEM, package registry audit logs, or manual reverse engineering. The prompt works best when you provide concrete, timestamped evidence rather than vague descriptions. For example, include specific commit SHAs, package versions, publish timestamps, and maintainer account names rather than summaries. The output is a structured narrative, not an executable remediation script. Every claim the model makes should be traceable to the evidence you provided; if the model introduces unsupported assertions, that is a failure mode requiring human correction.
Before using this prompt, ensure you have gathered all available evidence and have a clear understanding of the incident's scope. After generating the narrative, validate every timeline entry and causal claim against your source data. Use the output as a starting point for your incident report, not the final version. The next step after this analysis is typically a formal postmortem or a remediation plan that assigns owners and deadlines to each proposed action.
Use Case Fit
Where this prompt works and where it does not. Use these cards to decide if the Supply Chain Incident Root Cause Analysis Prompt fits your current investigation.
Good Fit: Structured Post-Incident Review
Use when: You have a confirmed supply chain compromise with a known malicious package, version, and publish window. The incident timeline, commit history, and advisory data are available. Guardrail: Pre-load all evidence into context; do not ask the model to discover the attack vector from scratch.
Bad Fit: Active Incident Response
Avoid when: You are in the first hour of a live compromise and need immediate containment. This prompt is for post-hoc analysis, not real-time triage. Guardrail: Use an incident runbook prompt for active response; switch to this prompt only after the artifact is quarantined and evidence is collected.
Required Inputs: Evidence Package
What to watch: The prompt requires a complete evidence package: affected package name, version range, publish timestamps, commit diffs, advisory text, and any observed malicious behavior. Missing inputs produce speculative narratives. Guardrail: Validate that all required fields are present before invoking the prompt; abort and request missing evidence if incomplete.
Operational Risk: Speculative Attribution
What to watch: The model may confidently attribute an attack to a specific actor or technique without sufficient evidence, especially when advisory language is ambiguous. Guardrail: Require explicit evidence citation for every causal claim in the output. Flag unsupported attributions for human review before the narrative is shared.
Operational Risk: Stale Advisory Data
What to watch: If the advisory data is outdated or incomplete, the analysis will miss later findings such as additional compromised versions or expanded impact. Guardrail: Pin the advisory source and retrieval timestamp in the prompt context. Re-run the analysis when new advisory information is published.
Operational Risk: Over-Confident Remediation Steps
What to watch: The model may generate remediation steps that sound correct but do not match your specific build pipeline, registry configuration, or deployment topology. Guardrail: Treat all remediation steps as draft recommendations. Require an engineer familiar with the affected system to validate and adapt each step before execution.
Copy-Ready Prompt Template
A reusable prompt template for structured supply chain incident root cause analysis with placeholders for incident data, timeline, and output constraints.
This prompt template is designed for security and platform engineering teams investigating a supply chain compromise. It ingests incident evidence—timelines, affected packages, commit history, publish events, and advisory data—and produces a structured root cause narrative with contributing factors, attack vector tracing, and prioritized remediation steps. The template uses square-bracket placeholders that you replace with incident-specific data before execution. Every placeholder maps to a concrete input source: SIEM logs, package registry APIs, version control history, or incident response notes.
codeYou are a supply chain security investigator analyzing a software supply chain incident. Your task is to produce a structured root cause analysis based on the provided evidence. ## INCIDENT DATA - Affected Packages: [AFFECTED_PACKAGES] - Incident Discovery Time: [DISCOVERY_TIMESTAMP] - Incident Description: [INCIDENT_DESCRIPTION] ## TIMELINE EVIDENCE [INCIDENT_TIMELINE] ## COMMIT AND PUBLISH HISTORY [COMMIT_AND_PUBLISH_HISTORY] ## SECURITY ADVISORIES AND CVEs [ADVISORY_DATA] ## DEPENDENCY GRAPH CONTEXT [DEPENDENCY_GRAPH] ## CONSTRAINTS - Ground every finding in specific evidence from the provided data. Cite timestamps, commit hashes, package versions, or advisory IDs. - Distinguish confirmed facts from hypotheses. Use "Confirmed:" and "Hypothesis:" prefixes. - If evidence is insufficient to determine a causal link, state that explicitly rather than filling gaps with speculation. - Flag any evidence inconsistencies or timeline gaps that require further investigation. ## OUTPUT SCHEMA Return a JSON object with this structure: { "incident_summary": "string (2-3 sentence executive summary)", "attack_vector": { "entry_point": "string (how the attacker gained access to the supply chain)", "technique": "string (e.g., credential theft, maintainer account compromise, build pipeline injection, typo-squatting, dependency confusion)", "evidence": ["string (specific evidence supporting the vector determination)"] }, "timeline_analysis": [ { "timestamp": "string", "event": "string", "significance": "string (why this event matters to the investigation)", "evidence_source": "string" } ], "contributing_factors": [ { "factor": "string", "category": "string (e.g., access control, monitoring gap, process failure, technical vulnerability)", "evidence": "string" } ], "impact_assessment": { "affected_services": ["string"], "data_exposure": "string (what data was potentially exposed, or 'none identified')", "exploitability": "string (active exploitation, proof of concept exists, theoretical)", "confidence": "string (high, medium, low)" }, "remediation_steps": [ { "action": "string", "priority": "string (critical, high, medium, low)", "owner": "string (suggested team or role)", "deadline": "string (immediate, 24h, 1 week, next sprint)" } ], "unresolved_questions": ["string (questions that need further investigation)"], "evidence_gaps": ["string (missing data that would strengthen the analysis)"] } ## RISK LEVEL [RISK_LEVEL] ## ADDITIONAL CONTEXT [ADDITIONAL_CONTEXT]
Adaptation guidance: Replace each placeholder with concrete data before execution. [AFFECTED_PACKAGES] should list package names, versions, and ecosystems. [INCIDENT_TIMELINE] should be a chronologically ordered list of events with timestamps from your SIEM, registry audit logs, or incident response notes. [COMMIT_AND_PUBLISH_HISTORY] should include commit diffs, author information, and publish timestamps retrieved from your version control and package registry APIs. [RISK_LEVEL] accepts values like critical, high, medium, or low to calibrate the depth of analysis. For production use, wrap this prompt in a harness that validates the output JSON against the schema before accepting it. If the model returns malformed JSON or omits required fields, trigger a retry with the validation error message appended. For high-severity incidents, route the output to a human incident commander for review before dissemination.
Prompt Variables
Each variable must be populated before the prompt is sent. Missing or malformed inputs are the most common cause of low-quality root cause analyses. Validate each field against the notes below before wiring this prompt into an automated incident pipeline.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[INCIDENT_TIMELINE] | Chronological log of events, deployments, alerts, and user reports leading up to and during the incident. | 2025-03-15 14:03 UTC: Deploy v2.4.1 to prod 14:07: p95 latency spike 14:12: PagerDuty alert fired | Must be a non-empty string with timestamps. Parse check: at least 3 timestamped entries. Null not allowed. |
[AFFECTED_PACKAGES] | List of dependency packages involved in the incident, including versions and ecosystem. | lodash@4.17.21 (npm) requests@2.31.0 (PyPI) org.apache.logging.log4j:log4j-core@2.17.0 (Maven) | Must be a non-empty array or newline-delimited list. Schema check: each entry must include package name and version. Null not allowed. |
[COMMIT_HISTORY] | Recent commits, tags, and release notes for the affected packages or the application that pulled them in. | abc1234: Bump lodash from 4.17.20 to 4.17.21 def5678: Merge PR #3421 dependency update | Must be a non-empty string. Parse check: at least one commit SHA or tag reference. Null allowed if no commits are available. |
[PUBLISH_EVENTS] | Registry publish timestamps, maintainer identities, and provenance data for the affected package versions. | lodash@4.17.21 published 2025-03-14 09:22 UTC by maintainer jdalton Attestation: SLSA Level 2 verified | Must be a non-empty string. Schema check: each event should include timestamp and package version. Null allowed if publish data is unavailable. |
[ADVISORY_DATA] | Security advisories, CVEs, or vulnerability reports linked to the affected packages. | CVE-2025-12345: Prototype Pollution in lodash <4.17.22 GHSA-xxxx-xxxx-xxxx: High severity | Must be a non-empty string or array. Parse check: each advisory must include an identifier. Null allowed if no advisories are known. |
[DEPENDENCY_GRAPH] | Transitive dependency tree showing how the affected package is pulled into the application. | my-app -> express@4.18.0 -> body-parser@1.20.0 -> qs@6.11.0 (affected) | Must be a non-empty string. Schema check: must show at least one path from application to affected package. Null allowed if graph is unavailable. |
[OBSERVABILITY_SIGNALS] | Metrics, logs, error traces, and alerts correlated with the incident timeline. | Error rate: 12% (baseline 0.3%) Log: TypeError: Cannot read property 'version' of undefined Trace: stack trace pointing to lodash.merge | Must be a non-empty string. Parse check: at least one metric, log line, or trace. Null not allowed. |
[OUTPUT_SCHEMA] | Expected structure for the root cause analysis output, defining required sections and fields. | { "attack_vector": "string", "contributing_factors": ["string"], "remediation_steps": ["string"], "confidence": "low|medium|high" } | Must be a valid JSON Schema or example structure. Schema check: parseable JSON. Must include attack_vector, contributing_factors, remediation_steps, and confidence fields. Null not allowed. |
Implementation Harness Notes
How to wire the root cause analysis prompt into an incident response workflow with validation, evidence grounding, and human review gates.
This prompt is designed to operate as a structured analysis step within a broader incident response pipeline, not as a standalone chatbot. The primary integration point is after initial incident data has been collected—timeline events, affected package manifests, commit logs, publish metadata, and advisory references—but before the final incident report is drafted. The prompt consumes a structured [INPUT] object containing these data sources and produces a [ROOT_CAUSE_ANALYSIS] object that feeds into postmortem documentation, remediation planning, and stakeholder communication. Because supply chain incidents carry security and operational risk, the harness must enforce evidence grounding, flag low-confidence conclusions, and route outputs through human review before any external distribution.
Wire the prompt into an incident management system (e.g., PagerDuty, ServiceNow, or a custom SRE platform) using a serverless function or microservice that assembles the input payload from incident metadata, package registries, version control APIs, and advisory databases. The function should: (1) validate that all required input fields are present and non-empty before calling the model; (2) call the model with a structured output schema matching the expected root cause analysis format; (3) parse and validate the response against that schema, retrying once with a repair prompt if validation fails; (4) log the full prompt, response, and validation result for auditability; and (5) route the validated output to a human review queue if the analysis confidence score falls below a configurable threshold or if the incident severity is critical. Model choice matters here: use a model with strong reasoning capabilities and a large context window (e.g., Claude 3.5 Sonnet or GPT-4o) because the input includes multiple data sources that must be cross-referenced. Avoid smaller or faster models that may miss subtle causal links across the timeline.
The most common failure mode in production is hallucinated causal links when evidence is sparse or contradictory. Mitigate this by requiring the model to cite specific evidence for each causal claim in the output schema, and implement a post-processing check that verifies each citation references an actual input data point. If the model cannot ground a claim, the harness should downgrade the confidence score and flag the finding for human investigation rather than silently accepting it. Do not treat this prompt as a replacement for human incident commanders; it is a hypothesis-generation and evidence-synthesis tool that accelerates analysis but requires expert review before remediation actions are authorized. For high-severity incidents, always route the output through a security engineer or SRE lead before publishing the root cause narrative.
Expected Output Contract
Defines the required fields, types, and validation rules for the structured JSON output of the Supply Chain Incident Root Cause Analysis Prompt. Use this contract to parse, validate, and integrate the model response into your incident management system.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
incident_id | string | Must match the [INCIDENT_ID] input exactly. Fail if null or mismatched. | |
analysis_timestamp | ISO 8601 datetime string | Must be a valid ISO 8601 string. Fail if unparseable. | |
attack_vector | object | Must contain 'entry_point' (string) and 'exploit_mechanism' (string). Both fields required and non-empty. | |
timeline | array of objects | Each object must have 'timestamp' (ISO 8601), 'event' (string), and 'source' (string). Array must not be empty. | |
affected_artifacts | array of objects | Each object must have 'package_name' (string), 'version' (string), and 'publish_integrity' (enum: verified, compromised, unknown). Array must not be empty. | |
contributing_factors | array of strings | Array must contain at least one entry. Each string must be non-empty. Fail if empty array or null. | |
remediation_steps | array of objects | Each object must have 'action' (string), 'priority' (enum: critical, high, medium, low), and 'owner' (string). Array must not be empty. | |
confidence_score | number | Must be a float between 0.0 and 1.0 inclusive. If null, default to 0.0. Fail if out of range. |
Common Failure Modes
Supply chain incident analysis is high-stakes and time-sensitive. These are the most common ways the prompt fails in production and how to prevent them before they reach an incident report.
Temporal Confusion in Commit Logs
What to watch: The model misorders events when timestamps are in different formats or time zones, placing a fix before the malicious commit. Guardrail: Pre-process all timestamps into a single UTC ISO 8601 format before passing them into the prompt. Include an explicit timeline-sorting instruction in the prompt constraints.
Hallucinated Package Metadata
What to watch: The model invents plausible but false maintainer emails, publish dates, or version numbers when the provided context is sparse. Guardrail: Require every factual claim in the output to be followed by a [source: <input_field_name>] citation. Add a post-generation validation step that scans for claims without a matching source anchor.
Ignoring Transitive Compromise
What to watch: The analysis fixates on the directly compromised package and misses that a second-order dependency was the original injection point. Guardrail: The prompt must explicitly instruct the model to trace the full dependency graph, not just the top-level manifest. Include a dedicated output section for "Transitive Dependencies Reviewed" to force the check.
Narrative Bias Toward Known CVEs
What to watch: The model prematurely attributes the incident to a publicly known CVE that matches some symptoms, ignoring contradictory evidence of a novel zero-day. Guardrail: Add a "Contradictory Evidence" section to the output schema. Instruct the model to actively list reasons the known CVE hypothesis might be wrong before concluding.
Over-Confidence in Incomplete Data
What to watch: The model produces a high-confidence root cause analysis even when critical logs or commit histories are missing, failing to flag the uncertainty. Guardrail: Require a mandatory "Evidence Gaps" section in the output that lists what data was requested but unavailable. The final confidence score must be capped based on the number of critical gaps.
Publish Event vs. Git Tag Mismatch
What to watch: The model treats a Git tag and a registry publish event as a single atomic action, missing a time gap where a compromised artifact was published from a clean tag. Guardrail: Instruct the model to compare git_tag_created_at with registry_published_at as a specific check. Flag any discrepancy greater than a configurable threshold as a high-priority anomaly.
Evaluation Rubric
Use this rubric to evaluate the quality of the Supply Chain Incident Root Cause Analysis Prompt's output before shipping it to an incident postmortem or security review. Each criterion targets a specific failure mode common in automated root cause analysis.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Timeline Completeness | All events from [INCIDENT_LOG] and [DEPLOYMENT_EVENTS] are placed on a single, ordered timeline with timestamps. | Events present in the input are missing from the output timeline or are placed in an illogical order. | Diff the set of input timestamps against the output timeline timestamps. Flag any missing or duplicated events. |
Attack Vector Identification | The identified vector (e.g., compromised maintainer account, malicious dependency) is explicitly linked to at least two pieces of evidence from [COMMIT_HISTORY] or [PUBLISH_EVENTS]. | The vector is stated as a conclusion without citing specific evidence, or the cited evidence does not logically support the vector. | Manual review by a security engineer. Check that each cited piece of evidence is present in the input and logically connected to the vector. |
Contributing Factor Specificity | Each contributing factor is a specific, actionable condition (e.g., 'CI pipeline auto-merged without mandatory review') rather than a vague statement (e.g., 'process failure'). | Contributing factors are generic, lack a clear link to the incident, or are phrased as unsolvable problems. | Classify each factor as 'specific' or 'generic' using a secondary LLM call. Fail if more than one factor is classified as 'generic'. |
Remediation Actionability | Each remediation step includes a concrete action, an owner role (e.g., 'Platform Team'), and a success criterion. | Remediation steps are passive voice suggestions without an owner or a way to verify completion. | Parse the output for each remediation step. Fail if any step is missing an 'Action', 'Owner', or 'Success Criterion' field. |
Evidence Grounding | Every factual claim about the incident is backed by a direct quote or a specific reference (e.g., commit SHA, log line ID) from the provided context. | The output contains a claim that cannot be traced back to the provided [CONTEXT] or contains a hallucinated detail. | Use an LLM judge to extract all factual claims. For each claim, perform a substring search in the [CONTEXT]. Fail if any claim is not found. |
Narrative Coherence | The narrative summary logically connects the timeline, attack vector, and contributing factors into a single, causal story. | The summary is a disjointed list of facts that does not explain how events led to the incident. | Ask a separate LLM to summarize the output's causal chain. Fail if the summary cannot reconstruct a clear 'A led to B' sequence. |
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\nUse the base prompt with a single incident report and lighter validation. Focus on narrative structure and timeline extraction. Accept plain-text output without strict schema enforcement.\n\n### Watch for\n- Missing schema checks leading to unstructured output\n- Overly broad instructions producing vague root cause statements\n- No evidence grounding, allowing hallucinated attack vectors

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