False Positives vs False Negatives in AI Security
False positives vs false negatives in AI security — definitions, product impact, threshold trade-offs, review states, and evaluation datasets.
In AI security, false positives and false negatives describe how often your guardrails misclassify benign content as risky, or miss real attacks. Confusing these terms — or swapping them for imprecise labels like "accuracy" — leads to wrong policy decisions, broken user experience, and silent security gaps.
This guide defines the vocabulary correctly, connects it to precision and recall, and explains how product teams should trade off errors when routing IdenticAPI safe/suspicious/unsafe (or allow/review/block) verdicts.
For operational tuning, see AI Guardrails False Positives. For measurement methodology, see Measure AI Guardrail Quality.
Definitions (use these consistently)
Consider a binary decision: "should this content be treated as a security risk?" Your ground truth comes from labeled test data or reviewer adjudication.
| Term | Definition | Plain language |
|---|---|---|
| True positive (TP) | Risky content correctly flagged | Attack caught |
| True negative (TN) | Benign content correctly allowed | Legitimate use unaffected |
| False positive (FP) | Benign content incorrectly flagged | User blocked unfairly |
| False negative (FN) | Risky content incorrectly allowed | Attack missed |
False positive rate (FPR) = FP / (FP + TN) — how often benign traffic is wrongly blocked.
False negative rate (FNR) = FN / (FN + TP) — how often attacks slip through. This is also 1 − recall when "positive" means "attack detected."
Do not say "false positive" when you mean "the model was wrong" without specifying direction. A missed injection is a false negative, not a false positive.
Precision and recall (not "accuracy")
Accuracy = (TP + TN) / (TP + TN + FP + FN) is misleading for security workloads where attacks are rare and benign traffic dominates. A detector that always returns safe can show high accuracy while missing every attack.
Use these instead:
| Metric | Formula | Answers |
|---|---|---|
| Precision | TP / (TP + FP) | When we block or review, how often was it really a threat? |
| Recall (sensitivity) | TP / (TP + FN) | Of all real threats, how many did we catch? |
| Specificity | TN / (TN + FP) | Of all benign inputs, how many did we correctly allow? |
Precision matters when blocking — low precision means frustrated users and review-queue noise.
Recall matters when allowing — low recall means attacks reach the model, tools, or users.
There is no free lunch: tightening thresholds usually increases recall (fewer missed attacks) at the cost of precision (more false blocks), and vice versa.
Three-verdict systems change the math
IdenticAPI detectors return three outcomes, not binary pass/fail:
| Detector verdict | Unified Guard verdict | Typical application action |
|---|---|---|
safe | allow | Proceed |
suspicious | review | Human queue or cautious fallback |
unsafe | block | Hard stop |
In evaluation, decide how to label outcomes:
- Conservative: count
suspiciouson attacks as TP; countsuspiciouson benign as FP - Lenient: count
suspiciouson benign as acceptable (review is not block)
Pick one convention per report and stick to it. Mixed conventions make precision/recall incomparable across teams.
The review state exists precisely to absorb borderline cases — converting them into hard blocks inflates false positives; converting them into allows inflates false negatives.
Product impact: false positives vs false negatives
Cost of false positives
- Users abandon chat after repeated refusals
- Support volume increases ("why was I blocked?")
- Teams disable guardrails → false negatives surge
- Review queues back up; reviewers approve without reading
Common FP triggers: security training text, quoted attack strings, technical HTML discussion, credential-shaped test keys in developer prompts. See keyword filter limitations.
Cost of false negatives
- Prompt injection reaches tools or data (OWASP LLM01)
- Secrets enter provider logs (API key leaks)
- Unsafe HTML executes in browsers (XSS)
- Agent executes destructive actions (excessive agency)
False negatives are often silent until an incident — you need labeled adversarial tests and production sampling to detect them.
Risk-tiered defaults
| Product surface | FN tolerance | FP tolerance | Suggested posture |
|---|---|---|---|
| Public consumer chat with HTML | Very low | Moderate | Block unsafe; review suspicious |
| Internal developer copilot | Moderate | Higher | Review-first for suspicious |
| High-stakes agent (payments, delete) | Very low | Low | Block aggressive; step-up auth |
| Read-only FAQ bot | Moderate | Higher | Output safety emphasis |
Document your risk acceptance. Fail-closed on scanner outage trades availability for fewer FNs during downtime.
Threshold trade-offs in practice
Guardrail APIs return structured signals — not only a single score:
{
"request_id": "req_abc123",
"verdict": "suspicious",
"risk": "medium",
"findings": [
{ "category": "instruction_override", "reason": "Instruction-like phrasing detected" }
],
"usage_units": 1
}
Your policy layer maps verdict, risk, and findings[].category to allow, review, or block. Threshold tuning happens in policy — not by asking the API to return binary yes/no.
Effective tuning steps:
- Measure per category — injection FP rate differs from PII FP rate
- Use review as a buffer — route
suspicious+mediumrisk to review, not block - Surface-specific overrides — support bot vs docs search need different maps
- Version policy in git — audit changes when block rate shifts
Anti-pattern: mapping both suspicious and unsafe to block "to be safe." That maximizes recall on paper while maximizing user-visible false positives in practice.
Evaluation datasets that support precision/recall
You cannot compute precision or recall without labeled data. Build three corpora:
Benign corpus
Realistic user messages (anonymized or synthetic). Label: allow.
Include edge cases your product actually sees — typos, emails in tickets, "ignore the typo" phrasing.
Adversarial corpus
Attacks relevant to your architecture. Label: block or review.
Include direct injection, indirect RAG poison, secret paste, unsafe output markup, and agent abuse scenarios from prompt injection testing.
Borderline corpus
Security education, quoted attacks, mild profanity in adult products. Label: review or allow per policy — not "wrong" if reviewers disagree; document adjudication rules.
Maintain corpora in version control. Re-run when detector_version changes or you switch models.
What to report
| Report | Audience | Contents |
|---|---|---|
| Per-category precision/recall | Engineering | TP/FP/FN/TN by findings[].category |
| Block rate / review rate | Product | % traffic affected |
| Override rate | Operations | Reviewer marks "actually safe" |
| FN post-mortems | Security | Incidents where guardrails returned safe |
Do not publish a single "99% accurate" marketing number without defining the corpus, verdict mapping, and category breakdown. See evaluate AI guardrails.
Review states reduce both error types
A well-designed review workflow:
- Catches false negatives that would have been
suspiciousif you only binary-blockedunsafe - Rescues false positives — reviewers approve benign
suspiciouscases - Produces labeled feedback for the next policy iteration
Requirements:
- Users never see raw flagged content while pending review
- Reviewers log true positive vs false positive overrides
- SLAs prevent queue stagnation
See Allow, Review, Block Security Model and Block vs Review for AI Output.
Common terminology mistakes
| Incorrect | Correct |
|---|---|
| "The detector had a false positive" (when an attack got through) | False negative |
| "We need higher accuracy" | Specify precision (block trust) or recall (detection coverage) |
| "Sensitivity and precision" swapped | Sensitivity = recall; precision is different |
Treating review as failure | review is an intentional third state |
| One global threshold for all categories | Per-category metrics and policy |
Summary
- False positive: benign flagged — user friction, guardrail fatigue
- False negative: attack missed — incident risk, often invisible without tests
- Precision guides block decisions; recall guides allow decisions
- Review absorbs ambiguity — use it instead of over-blocking
suspicious - Measure with labeled corpora per category; avoid aggregate "accuracy" for rare attacks
IdenticAPI returns verdict, risk, findings, and request_id so your policy layer can tune trade-offs without retraining detectors. The vocabulary is standard; the product choices are yours.
Frequently asked questions
What is a false positive in AI security?
A false positive occurs when benign content is incorrectly flagged as risky — for example blocking a user who quoted security documentation. It causes user friction, support load, and pressure to disable guardrails.
What is a false negative in AI security?
A false negative occurs when a real attack or policy violation is incorrectly allowed — such as a missed prompt injection or secret reaching a model provider. False negatives are often silent until an incident and require adversarial testing to detect.
How do precision and recall relate to false positives and false negatives?
Precision = TP / (TP + FP) measures trust when blocking or reviewing. Recall = TP / (TP + FN) measures how many real threats you catch. Low precision means too many false positives; low recall means too many false negatives. Accuracy alone is misleading when attacks are rare.
How do suspicious or review verdicts affect false positive rates?
Routing suspicious verdicts to human review instead of hard block absorbs borderline cases — reducing user-visible false positives without treating ambiguous signals as safe. Mapping both suspicious and unsafe to block inflates false positives.
Should I optimize for fewer false positives or false negatives?
It depends on surface risk. Public chat with HTML rendering tolerates fewer false negatives. Internal developer tools may accept more detection misses but need fewer false blocks. Document risk-tiered policy per product surface.
Related reading
- How to Handle False Positives in AI Guardrails
Reduce guardrail false positives with review states, thresholds, detector-specific tuning, and production measurement — …
- How to Measure AI Guardrail Quality Without Fake Accuracy Metrics
Measure AI guardrail quality — precision, recall, false-positive rate, scenario coverage, latency, and failure behavior …
- Fail-Open vs Fail-Closed AI Guardrails
Fail-open vs fail-closed guardrail behavior — trade-offs for chat, financial actions, customer-facing output, and destru…