Engineering platforms that accept bug reports, support tickets, or feedback through a shared intake channel need a reliable way to separate security-sensitive reports from general bugs before they hit the wrong queue. A general bug report about a UI glitch and a vulnerability disclosure describing an authentication bypass require different handling, different SLAs, different access controls, and different downstream workflows. This prompt classifies incoming reports as either a security incident or a general bug, producing a structured routing decision with a severity signal and a confidentiality flag. Use it as a pre-processor before dispatching to your bug tracker, security incident response tool, or human triage queue. It is designed for text-based reports and works best when the input contains enough detail to distinguish accidental misbehavior from intentional exploitability.
Prompt
Security Incident vs. General Bug Classification Prompt

When to Use This Prompt
Understand the routing problem this prompt solves, the ideal input conditions, and the operational boundaries where it should not be deployed.
The ideal input is a single, self-contained report with a clear description of observed behavior, expected behavior, and steps to reproduce. The prompt performs best when the reporter describes impact—data exposure, privilege escalation, denial of service, or integrity violations signal security relevance, while cosmetic issues, performance degradation without security implications, and feature requests signal general bugs. Reports that mention CVEs, attack patterns (XSS, SQLi, CSRF, path traversal), authentication bypass, or unauthorized data access are strong security signals. Reports focused on visual defects, confusing UX, slow load times without data risk, or missing functionality are general bug signals. The prompt also detects mixed signals—a performance bug that could enable a race condition, for example—and uses the confidentiality flag to restrict distribution when the report contains potentially exploitable details.
Do not use this prompt when the input is a raw stack trace without narrative context, an automated scanner output without human interpretation, or a multi-issue dump containing dozens of unrelated findings. It is not designed for real-time attack detection from log streams or SIEM alerts—those require different temporal reasoning and threat intelligence integration. Avoid relying on this prompt as the sole decision-maker for regulated incident reporting where legal or compliance obligations require deterministic, auditable classification rules. In those cases, use the prompt's structured output as a recommendation that a human reviews before the report enters a confidential security workflow. The prompt also should not replace a proper vulnerability disclosure program with defined scope, safe harbor language, and researcher communication templates—it is a routing aid, not a policy engine.
Use Case Fit
Where this prompt works and where it does not. Use these cards to decide if the Security Incident vs. General Bug Classification Prompt fits your routing architecture.
Good Fit: Security-Sensitive Ingress
Use when: you have a single intake channel (form, API, chatbot) that receives both standard bug reports and potential vulnerability disclosures. Guardrail: the prompt must route security-sensitive items to a confidential, access-controlled queue before any public-facing triage or notification occurs.
Bad Fit: Post-Exploitation Forensics
Avoid when: you need to analyze confirmed breach artifacts, memory dumps, or exploit payloads. This prompt classifies reports, not raw evidence. Guardrail: use a separate evidence-analysis pipeline with sandboxed execution and human-in-the-loop review for forensic artifacts.
Required Inputs
What you need: the full unstructured report text, a defined security taxonomy (e.g., injection, auth bypass, data exposure), and a severity scale with routing rules. Guardrail: missing taxonomy definitions cause inconsistent classification. Provide the taxonomy in the system prompt, not just the user message.
Operational Risk: Misrouting Severity
What to watch: a critical remote code execution report classified as a low-priority UI bug and routed to the general backlog. Guardrail: implement a confidence threshold below which items route to a manual security review queue. Never auto-close items classified below high confidence.
Operational Risk: Confidentiality Leakage
What to watch: security report details appearing in public issue trackers, Slack channels, or customer-facing status pages because routing failed. Guardrail: the routing destination must enforce access controls. Verify that the security queue is not integrated with public-facing notification systems.
Variant: Multi-Tenant Platforms
What to watch: a single intake serves multiple organizations, and a security report for one tenant must not be visible to another. Guardrail: combine this prompt with a tenant-domain classification step before routing. Validate tenant isolation at the queue level, not just in the prompt output.
Copy-Ready Prompt Template
A copy-paste-ready prompt template for classifying engineering reports as security incidents or general bugs, with strict output schema enforcement.
The following prompt template is designed to be dropped directly into your classification pipeline. It forces the model to reason about exploitability, impact, and security boundaries before committing to a label. The template uses square-bracket placeholders that you must replace with your actual report text, output schema, and any additional constraints before sending the request. Do not leave placeholders unresolved in production calls.
textClassify the following report as a security incident or a general bug. A security incident involves potential unauthorized access, data exposure, privilege escalation, injection, authentication bypass, denial of service, or any behavior that could be intentionally exploited to compromise confidentiality, integrity, or availability. A general bug is unintended behavior that does not present a plausible security impact, such as cosmetic issues, non-security performance problems, or functional defects without exploitability. [REPORT] [CONSTRAINTS] Use the output schema exactly as specified. [OUTPUT_SCHEMA]
Adapt this template by replacing [REPORT] with the full text of the bug report, vulnerability disclosure, or incident description. The [CONSTRAINTS] placeholder is where you inject additional rules, such as 'If uncertain, classify as a security incident and flag for human review' or 'Ignore severity ratings in the report; classify based on described behavior only.' The [OUTPUT_SCHEMA] placeholder must contain your exact expected JSON structure, including field names, types, and enum values. A typical schema includes classification (enum: security_incident or general_bug), confidence (float 0-1), and reasoning (string with specific evidence from the report). For high-stakes environments, add a requires_human_review boolean field that triggers when confidence is below your threshold or when the report contains indicators of active exploitation. Test this prompt against a golden dataset of 50-100 labeled reports before deployment, measuring both precision and recall on the security incident class, since false negatives here carry the highest risk.
Prompt Variables
Required inputs for the Security Incident vs. General Bug Classification Prompt. Each placeholder must be populated before the prompt is sent to the model. Validation notes describe how to verify the input is well-formed before execution.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[BUG_REPORT_TEXT] | The raw, unstructured bug report or ticket body submitted by the user or system | I found a way to access other users' account data by modifying the user ID in the profile URL. No authentication check happens after the initial login. | Must be non-empty string. Check length > 0. Sanitize for null bytes and control characters before prompt assembly. Truncate to 8000 tokens if using context window limits. |
[REPORT_SOURCE] | Origin channel of the report to weight severity and handling requirements | Must match one of the allowed source values in your routing config: security@, bug-bounty, support-ticket, automated-scanner, internal-employee. Reject unknown sources or route to manual review queue. | |
[COMPANY_DOMAIN] | The primary domain or product scope for context grounding | api.company.com | Must be a valid domain string matching your registered product surfaces. Used to filter out reports about third-party services. Validate against allowlist of owned domains before prompt assembly. |
[SECURITY_SIGNAL_TERMS] | Curated list of terms that indicate potential security impact, used as a reference baseline for the classifier | ["injection", "auth bypass", "data exposure", "privilege escalation", "PII leak", "token leak", "SSRF", "XSS", "CSRF"] | Must be a valid JSON array of strings. Each term should be lowercase and normalized. Review and update this list quarterly based on new attack patterns and false-positive analysis. Empty array is allowed but degrades classification recall. |
[OUTPUT_SCHEMA] | The expected JSON structure the model must return, including classification label, confidence, and evidence fields | {"classification": "security_incident", "confidence": 0.92, "evidence": ["direct access to other user data without auth check"], "severity_estimate": "high"} | Must be a valid JSON Schema or example object. Validate that required fields include: classification (enum: security_incident, general_bug, needs_review), confidence (float 0-1), evidence (array of strings). Reject prompt assembly if schema is malformed. |
[CONFIDENCE_THRESHOLD] | Minimum confidence score required for auto-routing. Scores below this threshold route to human review. | 0.75 | Must be a float between 0.0 and 1.0. Default 0.75. Lower values increase auto-routing rate but risk misclassification. Validate as numeric and in range. Log threshold changes for audit trail. |
[MAX_EVIDENCE_ITEMS] | Maximum number of evidence snippets the model should extract from the report to support its classification | 3 | Must be a positive integer. Default 3. Controls output verbosity and prevents the model from quoting the entire report. Validate as integer >= 1 and <= 10. |
Implementation Harness Notes
How to wire the Security Incident vs. General Bug Classification Prompt into a production triage pipeline with validation, routing, and human review.
This prompt is designed to sit at the ingress point of an engineering ticketing or alerting system, before any automated actions are taken. The implementation harness must treat the model's output as a routing signal, not a final decision. Wire the prompt into a pre-processing middleware that receives the raw report text, injects it into the [INPUT] placeholder along with your organization's [SECURITY_SIGNAL_DEFINITIONS], and parses the JSON response. The harness should validate that the output contains the required fields (classification, confidence_score, security_signals_detected, requires_immediate_escalation, reasoning) and that classification is strictly one of the allowed enum values: security_incident, general_bug, or ambiguous.
For production deployment, implement a validation layer that rejects malformed JSON or missing fields and triggers a single retry with a repair prompt that includes the raw output and the validation error. If the retry also fails, escalate the entire report to a human triage queue with the raw input and both failed attempts logged. When classification is security_incident or requires_immediate_escalation is true, the harness must route the report to a confidential security channel, bypassing any public-facing or general-access bug trackers. Log the full prompt, model response, and routing decision to an immutable audit store for post-incident review. For model choice, prefer a model with strong instruction-following and JSON mode support (e.g., GPT-4o, Claude 3.5 Sonnet) and set temperature to 0 to maximize classification consistency.
Before shipping, build an eval harness using a golden dataset of at least 50 labeled reports that includes confirmed security incidents, general bugs, and deliberately ambiguous edge cases. Measure precision and recall separately for the security_incident class, as false negatives here carry the highest risk. Set a minimum recall threshold of 0.95 for security incidents before enabling automated routing. Monitor production drift by sampling classified reports weekly and having a security engineer review a random subset, comparing human labels to model decisions. If confidence scores show systematic miscalibration (e.g., high confidence on incorrect classifications), adjust the [SECURITY_SIGNAL_DEFINITIONS] or add few-shot examples targeting the failure patterns. Never allow this prompt's output to directly trigger destructive actions, disclosure, or public posting without a human-in-the-loop checkpoint for all security_incident classifications.
Expected Output Contract
The prompt must return a structured JSON object. Use this contract to validate the output before routing. Any field that fails validation should trigger a retry or escalation.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
classification | enum: SECURITY_INCIDENT | BUG | AMBIGUOUS | Must be exactly one of the three enum values. Reject any other string. | |
confidence_score | number (0.0 - 1.0) | Must be a float between 0 and 1 inclusive. If < 0.7, route to manual review queue. | |
reasoning | string | Must be non-empty. Must contain specific evidence from [INPUT_TEXT] that supports the classification. | |
severity | enum: CRITICAL | HIGH | MEDIUM | LOW | NONE | Required if classification is SECURITY_INCIDENT. Must be NONE if classification is BUG. Reject mismatches. | |
cwe_id | string or null | If provided, must match pattern CWE-\d{1,4}. Null allowed for BUG classification. Reject invalid formats. | |
requires_immediate_escalation | boolean | Must be true if severity is CRITICAL. Must be false if classification is BUG. Reject logical contradictions. | |
suggested_routing_queue | string | Must be one of: security_soc, bug_triage, manual_review. Must align with classification and confidence_score. | |
pii_detected | boolean | Must be true if [INPUT_TEXT] contains potential PII. Triggers confidential handling flag in downstream system. |
Common Failure Modes
Security incident classification fails silently and dangerously. These are the most common production failure patterns and the specific guardrails that catch them before a vulnerability report lands in the general bug queue.
Security Language Normalization Failures
What to watch: Attackers and experienced reporters often use neutral, technical language that avoids obvious security keywords like 'vulnerability' or 'exploit.' A report describing 'unexpected behavior with crafted input that bypasses the auth check' may read like a general bug to a naive classifier. Guardrail: Include few-shot examples of security reports written in understated engineering language. Test the prompt against real disclosure reports from your bug bounty program, not just synthetic examples with obvious security vocabulary.
Severity Misclassification Under Urgency Bias
What to watch: The model overweights urgency language ('critical,' 'blocking,' 'production down') and classifies high-urgency general bugs as security incidents, or conversely misses genuine security reports that lack urgency signals. A Sev-1 outage in the billing system is not a security incident, but a calmly written report about persistent XSS is. Guardrail: Require the prompt to separate urgency assessment from security classification. Add a constraint that urgency language alone must not trigger security routing. Validate with test pairs that isolate urgency from security signals.
Confidentiality Marker Leakage
What to watch: The prompt correctly classifies a report as a security incident but fails to enforce confidential handling. The output routes to the right queue but includes the full vulnerability details in a summary field that gets posted to a shared Slack channel or public issue tracker. Guardrail: The output schema must separate routing metadata from content. Never include the raw report or detailed reproduction steps in fields that downstream systems might expose. Add a post-processing rule that strips sensitive fields before any notification or integration action.
Attack Pattern vs. Bug Symptom Confusion
What to watch: The model classifies based on surface symptoms rather than root cause indicators. A report saying 'users can see other users' data by changing the ID in the URL' is an authorization bypass, not a general data display bug. The classifier sees 'data display issue' and routes to the frontend team. Guardrail: Include explicit attack pattern definitions in the system prompt: privilege escalation, auth bypass, injection, information disclosure, denial of service. Require the model to match against these patterns before falling back to general bug classification. Test with reports where the symptom and the attack pattern diverge.
Multi-Intent Report Splitting Failures
What to watch: A single report contains both a security vulnerability and a general bug. The classifier picks one label and the other issue is lost. A report that says 'the export feature is broken and also exposes PII in the CSV headers' gets routed as a general bug, and the PII exposure is never triaged. Guardrail: Design the output schema to support multiple classifications with confidence scores. Add a post-classification rule that any input with a security classification above a low threshold must route to the security queue, even if another classification has higher confidence. Test with compound reports.
False Negative Drift After Taxonomy Changes
What to watch: The security team adds a new vulnerability category or renames an existing one. The prompt taxonomy is updated, but the few-shot examples and eval set still reflect the old categories. The classifier silently misses reports matching the new category because it has no examples to anchor against. Guardrail: Version-lock the prompt, examples, and eval set together. Require that any taxonomy change triggers a full eval rerun against a golden set that includes examples of the new category. Gate deployment on passing the updated eval suite.
Evaluation Rubric
Use this rubric to test the Security Incident vs. General Bug Classification Prompt before shipping. Each criterion targets a known failure mode in security-sensitive routing. Run these checks against a golden dataset of 50-100 labeled examples, including edge cases where security language is subtle, ambiguous, or embedded in non-security reports.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Security Recall |
| Security incident classified as general bug or unknown | Run against labeled security incident dataset; count false negatives |
Security Precision |
| General bug or non-security input flagged as security incident | Run against labeled non-security dataset; count false positives |
Confidentiality Flag Accuracy | Confidentiality flag matches ground truth in >= 95% of cases | Confidential report not flagged or public report incorrectly flagged | Cross-reference [CONFIDENTIALITY_FLAG] output against labeled confidentiality ground truth |
Severity Score Calibration | Predicted severity within 1 level of ground truth for >= 90% of security incidents | Critical incident scored as low or informational scored as critical | Compare [SEVERITY_SCORE] output to human-labeled severity on security subset |
Abstention Rate on Ambiguous Inputs | Abstention triggered on >= 90% of deliberately ambiguous test cases | Model forces classification on inputs designed to span security and non-security boundaries | Inject 20 ambiguous test cases; verify [NEEDS_HUMAN_REVIEW] = true and confidence < 0.70 |
Evidence Grounding Completeness |
| Security classification with empty or generic evidence field | Parse [EVIDENCE] field; check for non-empty, input-specific string on security-positive predictions |
Output Schema Compliance | 100% of outputs parse as valid JSON matching the defined schema | Missing required fields, wrong types, or unparseable JSON | Validate all outputs against [OUTPUT_SCHEMA] using JSON Schema validator; reject any parse failures |
Latency Under Load | 95th percentile response time < 2 seconds for single classification | Timeouts or > 5 second responses under concurrent load | Run 100 concurrent classification requests; measure p50 and p95 latency |
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 classification prompt and a simple JSON output schema. Use a single model call without tool definitions or structured output APIs. Accept that you'll get occasional markdown-wrapped JSON or extra commentary. Focus on getting the classification logic right before hardening the harness.
Strip the prompt down to:
- The classification task description
- The two-class taxonomy (security_incident vs general_bug)
- A few fixed examples
- A simple
{"classification": "...", "confidence": "...", "reasoning": "..."}output instruction
Watch for
- Model wrapping JSON in markdown fences despite instructions
- Over-classifying anything with the word 'security' as an incident
- Missing severity signals buried in long descriptions
- No validation on output shape, so downstream code breaks on format drift

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