This prompt is designed for on-call engineers, SREs, and triage teams who receive raw bug reports describing suspected concurrency issues. Concurrency bugs arrive through multiple channels: user reports of data corruption, automated alerts for deadlocks, support tickets describing intermittent failures, or logs showing race conditions. These reports are often unstructured, missing critical reproduction details, and routed to the wrong team on first pass. This prompt transforms that chaos into a structured triage ticket that classifies the bug type, extracts symptoms, identifies the likely owning component, and justifies routing.
Prompt
Concurrency Bug Triage and Routing Prompt

When to Use This Prompt
Defines the ideal user, required context, and boundaries for the Concurrency Bug Triage and Routing Prompt.
Use this prompt when you need to standardize concurrency bug intake and reduce misrouted tickets. The ideal input is a raw bug report containing any combination of user descriptions, stack traces, log excerpts, timestamps, and observed symptoms. The prompt works best when the report includes at least one concrete symptom—such as a deadlock error message, a data inconsistency example, or a timing-dependent failure description. Reports that include thread dumps, goroutine stacks, or database transaction logs will produce significantly more accurate classifications and routing decisions. The prompt expects to produce a structured JSON output that can be ingested directly by ticketing systems like Jira, linear, or ServiceNow, with fields for severity, component ownership, reproduction steps, and routing justification.
Do not use this prompt for general crash reports, network timeouts, or bugs where concurrency is not the suspected root cause. If the report describes a deterministic null pointer exception, a configuration error, or a simple logic bug with no concurrent execution involved, this prompt will waste tokens and may produce misleading classifications. Similarly, avoid using this prompt for performance issues that are purely single-threaded bottlenecks without any shared state or synchronization concerns. For those cases, use a general bug triage prompt or a performance-specific analysis prompt instead. When in doubt, check whether the report mentions multiple threads, goroutines, async tasks, locks, transactions, or timing-dependent behavior—if none of these signals are present, route the report through a different triage path.
Use Case Fit
Where the Concurrency Bug Triage and Routing Prompt works, where it fails, and what you must provide before relying on it in production.
Good Fit: Structured Triage from Unstructured Reports
Use when: on-call engineers receive bug reports via chat, email, or ticketing systems that mix symptoms, logs, and user complaints. The prompt excels at extracting structured data (bug type, severity, affected component) from messy natural language. Guardrail: Always require a human to confirm the extracted reproduction steps before routing, as the model may hallucinate missing details to fill gaps in the report.
Bad Fit: Real-Time Production Diagnosis
Avoid when: you need millisecond-level diagnosis of a live incident directly from raw metrics or traces. This prompt is designed for post-report triage, not for acting as a real-time monitoring agent. Guardrail: Route raw telemetry to your observability stack first. Use this prompt only after a human or automated system has created a textual summary of the incident.
Required Inputs: Symptom Data and System Context
What to watch: The prompt's accuracy drops sharply without a stack trace, error message, or a description of the unexpected behavior. A vague report like 'the app is slow' will produce a low-confidence, generic classification. Guardrail: Implement a pre-processing check that rejects input lacking specific keywords (e.g., 'deadlock', 'race condition', 'corrupted data') or structured log snippets, and asks the reporter for more detail.
Operational Risk: Routing to the Wrong Team
Risk: The model may confidently route a database deadlock bug to the application team if the report mentions an API timeout, missing the underlying infrastructure cause. Misrouting delays resolution and erodes trust in the triage system. Guardrail: Always include a 'routing justification' field in the output schema. Require the receiving team to acknowledge or reject the ticket within a short SLA, creating a feedback loop to measure and correct routing accuracy.
Operational Risk: Severity Inflation or Deflation
Risk: The model may classify a minor, non-impacting race condition as a SEV-1 incident, or conversely, downplay a data-corrupting bug due to polite language in the report. Guardrail: Pair the prompt with a strict severity rubric based on objective criteria (e.g., 'data corruption = SEV-1', 'performance degradation = SEV-2'). Use a second LLM call or a deterministic rules engine to validate the severity against the extracted symptoms before creating the ticket.
Bad Fit: Replacing Concurrency Expertise
Avoid when: you expect the prompt to definitively diagnose a novel or highly complex concurrency bug. The prompt classifies and routes based on known patterns; it cannot perform a deep, creative root cause analysis that requires a senior engineer's intuition. Guardrail: Frame the output as a 'preliminary triage and routing suggestion.' The routed team must be empowered to re-classify the bug type and severity after their own investigation.
Copy-Ready Prompt Template
A reusable triage prompt that extracts symptoms, classifies the bug, and routes it to the correct owning team.
This is the core prompt you will send to the model for every incoming concurrency bug report. It is designed to be stateless and idempotent: given the same raw report, it should produce the same structured triage ticket. The prompt forces the model to separate symptoms from speculation, classify the concurrency primitive involved, and justify its routing decision with explicit evidence from the input. Before copying this into your production triage workflow, ensure you have defined your team routing map, severity matrix, and the schema your ticketing system expects.
textYou are an expert on-call triage engineer specializing in concurrency and distributed systems bugs. Your task is to analyze an incoming bug report, extract structured information, classify the concurrency defect, and route it to the correct team. ## INPUT Bug Report: [BUG_REPORT] ## TEAM ROUTING MAP [TEAM_ROUTING_MAP] ## SEVERITY MATRIX [SEVERITY_MATRIX] ## INSTRUCTIONS 1. Extract all described symptoms, error messages, stack traces, and reproduction steps from the bug report. Do not invent details not present in the input. 2. Classify the concurrency bug type from this closed list: `race_condition`, `deadlock`, `livelock`, `thread_safety_violation`, `goroutine_leak`, `channel_blocking`, `lock_contention`, `transaction_boundary_violation`, `non_atomic_compound_operation`, `memory_ordering_violation`, `thread_pool_exhaustion`, `asynchronous_race`, `other`. 3. Identify the most likely owning component and map it to a team using the TEAM ROUTING MAP. If the component is ambiguous, list the top two candidates with confidence scores. 4. Assign a severity level from the SEVERITY MATRIX based on data corruption risk, production exposure, and reproducibility. Justify the severity with specific evidence from the report. 5. If reproduction steps are missing or incomplete, flag this explicitly and do not fabricate them. 6. If the report describes a symptom that could be caused by a non-concurrency issue (e.g., a plain logic error), note this as an alternative hypothesis. ## OUTPUT SCHEMA Return a single JSON object with this exact structure: { "triage_ticket": { "ticket_id": "string, generate a unique ID prefixed with CONC-", "source_report": "string, the original bug report text", "extracted_symptoms": ["string, list of observed symptoms"], "extracted_errors": ["string, list of error messages or stack traces"], "reproduction_steps": ["string, list of steps or null if missing"], "reproduction_completeness": "complete | incomplete | absent", "concurrency_bug_type": "string, from the closed classification list", "concurrency_primitive_suspected": "string, e.g., mutex, channel, atomic, lock, transaction, goroutine, thread_pool", "owning_component": "string, the most likely component", "routing_target_team": "string, the team from the routing map", "alternative_teams": [{"team": "string", "confidence": 0.0}], "severity": "string, from the severity matrix", "severity_justification": "string, evidence-based justification", "alternative_hypotheses": ["string, non-concurrency explanations if applicable"], "requires_immediate_escalation": true or false, "escalation_reason": "string or null" } } ## CONSTRAINTS - Do not include any text outside the JSON object. - Use null for any field where information is absent, never omit fields. - Confidence scores must be between 0.0 and 1.0. - If the bug report is too vague to classify, set concurrency_bug_type to "other" and note the ambiguity in alternative_hypotheses.
To adapt this prompt for your environment, replace [TEAM_ROUTING_MAP] with a structured mapping of components, code paths, or services to your on-call teams. The [SEVERITY_MATRIX] should reflect your organization's actual incident severity definitions, including criteria for data corruption, customer impact, and reproducibility. If your ticketing system uses a different schema, modify the OUTPUT_SCHEMA block to match your API contract. Always validate the model's output against your schema before creating a ticket. For high-severity classifications, route the triage ticket to a human on-call for confirmation before paging the target team.
Prompt Variables
Inputs the Concurrency Bug Triage and Routing Prompt needs to work reliably. Each variable must be validated before the prompt is assembled to prevent misrouting or incomplete triage tickets.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[BUG_REPORT] | Raw bug report text from the reporting channel (ticket, chat, email). May be unstructured. | We're seeing intermittent 500 errors on the checkout service after the last deploy. Seems worse under load. | Must be a non-empty string. If null or whitespace-only, abort prompt assembly and return an error to the caller. |
[REPORT_TIMESTAMP] | ISO-8601 timestamp when the bug was reported. Used for correlation with deploys and logs. | 2025-03-15T14:32:00Z | Must parse as a valid ISO-8601 datetime. If missing, use the current system time and flag the ticket as having an inferred timestamp. |
[REPORTING_CHANNEL] | Source of the report: slack, jira, pagerduty, email, or manual. Influences routing priority. | pagerduty | Must be one of the allowed enum values. If unrecognized, default to 'manual' and add a note to the triage output. |
[ON_CALL_TEAMS] | JSON array of current on-call team names and their ownership domains. Used for routing. | [{"team":"checkout-squad","domain":"payment processing"},{"team":"platform-sre","domain":"infrastructure"}] | Must be a valid JSON array. If empty or null, the prompt must still produce a classification but flag routing as 'unresolved'. |
[RECENT_DEPLOYS] | JSON array of recent deployments with service name, version, and timestamp. Used for correlation. | [{"service":"checkout-api","version":"v2.4.1","deployed_at":"2025-03-15T14:15:00Z"}] | Must be a valid JSON array. If empty, the prompt should note that no recent deploy data is available and rely on symptom analysis alone. |
[KNOWN_BUG_DB] | JSON array of known concurrency bugs with symptoms and owning teams. Used for duplicate detection. | [{"id":"BUG-421","symptoms":"checkout timeout under load","owner":"checkout-squad"}] | Must be a valid JSON array. If empty, skip duplicate detection and note that the known-bug database was unavailable. |
[SEVERITY_MATRIX] | JSON object defining severity levels based on user impact, data corruption risk, and reproducibility. | {"sev1":{"user_impact":"complete outage","data_corruption":true},"sev2":{"user_impact":"degraded","data_corruption":false}} | Must be a valid JSON object with at least one severity level defined. If missing, use a default three-tier severity model and flag that defaults were applied. |
Implementation Harness Notes
How to wire the Concurrency Bug Triage and Routing Prompt into an on-call or ticketing workflow with validation, retries, and human-in-the-loop checkpoints.
Integrating this prompt into a production triage pipeline requires treating it as a structured classification step, not a free-form chat. The prompt expects a raw bug report as [BUG_REPORT] and a [SERVICE_CATALOG] mapping components to owning teams. The output is a JSON object with fields like bug_classification, severity, owning_team, routing_justification, and reproduction_steps. Wire this prompt behind an API endpoint or a webhook receiver that ingests bug reports from Slack, email, or a ticketing system. Before calling the LLM, sanitize the input to strip PII and normalize whitespace, but preserve stack traces, timestamps, and log excerpts exactly as reported—these are critical signals for concurrency classification.
Validation must happen immediately after the model responds. Parse the JSON output and check that severity is one of the allowed enum values (SEV1 through SEV5), that owning_team matches an entry in your service catalog, and that reproduction_steps is a non-empty array. If validation fails, retry once with the same prompt but append the validation error message as a [PREVIOUS_ERROR] field. If the retry also fails, route the ticket to a human triage queue with the raw bug report and both failed attempts attached. For model choice, use a model with strong structured output support (e.g., GPT-4o, Claude 3.5 Sonnet) and set response_format to json_object or use tool-calling with a strict schema to enforce the output shape. Temperature should be set low (0.0–0.2) to maximize classification consistency across similar bug reports.
Human-in-the-loop checkpoints are non-negotiable for SEV1 and SEV2 classifications. Even if the model assigns a high-confidence critical severity, the ticket must be held for human approval before paging an on-call engineer. Implement this as a two-stage workflow: the prompt classifies and routes, but the actual notification action (PagerDuty, Opsgenie) is gated on a human clicking 'Confirm and Page.' For SEV3 and below, auto-routing to the suggested team's backlog is acceptable, but log the model's confidence and routing justification for audit. Track metrics like classification override rate, validation failure rate, and mean time from report to routed ticket. These metrics will tell you when the prompt needs retuning—for example, if a particular service team consistently overrides the model's severity calls, add few-shot examples for that team's bug patterns.
Finally, treat the [SERVICE_CATALOG] as a dynamic variable sourced from your live infrastructure registry, not a hardcoded list in the prompt. When services change ownership or new components are added, the prompt must reflect those changes immediately. Build a prompt assembly step that fetches the current catalog and injects it into the template before each invocation. Avoid the failure mode where a correctly classified bug is routed to a disbanded team because the catalog was stale. If your organization lacks a formal service catalog, start with a simple JSON file in version control and require that concurrency bug routing updates it within the same change management process.
Expected Output Contract
Fields, format, and validation rules for the structured triage ticket produced by the Concurrency Bug Triage and Routing Prompt. Use this contract to parse, validate, and route the model output in your incident management pipeline.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
triage_id | string (UUID v4) | Must be a valid UUID v4 string. Reject if missing or malformed. | |
bug_type | enum string | Must match one of: race_condition, deadlock, livelock, thread_safety, atomicity_violation, lock_contention, goroutine_leak, channel_deadlock, async_race, pool_exhaustion, synchronization_misuse, lock_free_error, other. Reject unknown values. | |
severity | enum string | Must be one of: sev1_critical, sev2_high, sev3_medium, sev4_low, sev5_cosmetic. Reject if not in enum. | |
owning_component | string | Must be a non-empty string matching a known service or component name in the service catalog. Validate against catalog if available; otherwise, require non-empty. | |
routing_team | string | Must be a non-empty string matching a known team identifier. Validate against team registry if available. | |
reproduction_steps | array of strings | Must be a non-empty array. Each element must be a non-empty string. Minimum 1 step required. | |
symptoms_summary | string | Must be a non-empty string between 20 and 500 characters. Reject if outside bounds. | |
routing_justification | string | Must be a non-empty string between 20 and 300 characters explaining why this team owns the bug. |
Common Failure Modes
What breaks first when triaging concurrency bugs with an LLM and how to guard against it. These are the most common ways this prompt fails in production.
Symptom Hallucination
What to watch: The model invents specific symptoms, stack traces, or reproduction steps not present in the bug report. This is especially dangerous in concurrency bugs where fabricated timing details can send engineers on wild goose chases. Guardrail: Require the model to quote the source report for every extracted symptom. Add a validator that checks symptom strings against the input text and flags any claim without a direct match.
Wrong Concurrency Primitive Blame
What to watch: The model attributes the bug to a specific primitive (e.g., 'missing mutex') when the report only describes a generic race condition. Concurrency bugs have many root causes, and premature classification leads to misrouting. Guardrail: Force the model to list differential diagnoses with confidence scores. Route to the owning team only when confidence exceeds a threshold; otherwise, route to a general concurrency triage queue for human review.
Severity Inflation or Deflation
What to watch: The model assigns Critical severity to a cosmetic race condition or Low severity to a data-corrupting deadlock. Concurrency severity depends on blast radius, reproducibility, and data integrity risk—factors the model often misweights. Guardrail: Use a structured severity rubric with explicit criteria (data loss, crash, incorrect results, reproducibility percentage). Require the model to justify the severity against each criterion before assigning a final level.
Routing to the Wrong Team
What to watch: The model routes a database deadlock to the API team or a goroutine leak to the infrastructure team because it pattern-matches on surface keywords rather than understanding component ownership. Guardrail: Provide an up-to-date component ownership map in the prompt context. Require the model to cite the specific component and its documented owner in the routing justification. Add a human approval step for any route that changes the owning team from the previous similar bug.
Missing Reproduction Preconditions
What to watch: The model extracts the visible symptom but omits the environmental preconditions (Go version, GOMAXPROCS setting, specific deployment region, concurrent load level) that are essential to reproduce a concurrency bug. Guardrail: Add a required output field for 'Reproduction Environment' and prompt the model to mark any missing preconditions as 'UNKNOWN—must be collected from reporter.' Never allow the model to guess environment details.
Duplicate Detection Failure
What to watch: The model fails to recognize that a new bug report describes the same underlying race condition as an existing ticket, creating duplicate work and splitting the investigation across teams. Concurrency duplicates are especially hard because symptoms vary by timing. Guardrail: Before routing, require the model to search for existing bugs with the same affected component and concurrency primitive. If similarity exceeds a threshold, flag as a potential duplicate and link to the existing ticket instead of creating a new route.
Evaluation Rubric
Run these checks against a golden dataset of 20-50 known concurrency bug reports with known correct classifications and routing. Each row defines a specific quality criterion, the standard for passing, what failure looks like, and how to test it.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Bug Type Classification Accuracy | Exact match to golden label for race condition, deadlock, thread leak, or atomicity violation in >= 90% of cases | Output class does not match golden label; confusion between deadlock and lock contention is common | Automated comparison of [BUG_TYPE] field against golden dataset labels; compute precision/recall per class |
Severity Assignment | Severity level matches golden severity in >= 85% of cases; off-by-one errors count as partial failure | Critical data corruption bug classified as low severity; cosmetic issue escalated to critical | Compare [SEVERITY] field to golden severity; track mean absolute error and off-by-one rate |
Component Ownership Routing | Owning team or component matches golden routing target in >= 90% of cases | Database deadlock routed to frontend team; goroutine leak routed to infrastructure instead of owning service | Exact match of [OWNING_COMPONENT] or [ROUTING_TARGET] against golden routing label |
Reproduction Step Completeness | Output contains all key reproduction elements from source report: trigger condition, timing window, observed symptom | Missing the specific interleaving or timing condition needed to reproduce; generic steps that don't capture the race | Manual review of [REPRODUCTION_STEPS] against source report; check for presence of trigger, timing, and symptom |
Hallucinated Details | Zero fabricated bug details, code paths, or symptoms not present in the source report | Prompt invents a lock name, file path, or function that doesn't exist in the report; adds symptoms the reporter never described | Diff [OUTPUT] fields against source report; flag any entity not grounded in the input text |
Duplicate Detection Signal | When source report describes a known duplicate, [IS_DUPLICATE] is true and [DUPLICATE_OF] references the correct ticket ID | Duplicate flag is false for a report that matches a known issue; or flag is true but references wrong ticket | Compare [IS_DUPLICATE] and [DUPLICATE_OF] against golden duplicate annotations; compute duplicate recall |
Routing Justification Quality | Routing justification cites specific symptom-to-component reasoning, not generic statements | Justification says 'this is a concurrency bug' without explaining why it belongs to the specific team; circular reasoning | Manual review of [ROUTING_JUSTIFICATION]; check for presence of symptom-to-component chain and absence of circular logic |
Output Schema Compliance | All required fields present with correct types; no extra fields; enum values match allowed set | Missing [SEVERITY] field; [BUG_TYPE] contains value not in allowed enum; extra unstructured text outside schema | JSON Schema validation against expected output contract; check field presence, types, and enum membership |
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 the base triage prompt but remove strict output schema requirements. Use a simpler classification taxonomy (e.g., just bug type and severity). Accept free-text routing suggestions instead of requiring structured team assignments. This lets you test classification accuracy before investing in integration plumbing.
codeClassify this concurrency bug report into type and severity. Bug Report: [BUG_DESCRIPTION] Return: type, severity, suggested_team (free text)
Watch for
- Inconsistent bug type labels across runs without an enum constraint
- Missing reproduction step extraction when the report is vague
- Overly broad routing suggestions that don't map to real team boundaries
- No duplicate detection, so repeat reports create noise

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