LLM System Risks and Failure Modes
| Risk | What happens | Mitigations (verified unless marked) |
|---|---|---|
| Prompt injection (direct) | A user crafts input to override instructions | Harmlessness screens, input validation, explicit refusal instructions, monitoring |
| Indirect prompt injection | Content the agent reads (files, web pages, tickets, MCP output) carries instructions | Treat tool output as untrusted; limit actions after reading untrusted content; permissions and sandboxing; Claude Code summarises web search results instead of passing raw content (verified) |
| Jailbreaks | Attempts to bypass safety behaviour | Layered safeguards; screens; monitoring |
| Hallucination | Fluent, wrong content | Allow "I don't know"; extract quotes first for long documents; verify claims with citations and retract unsupported ones; retrieval grounding; validators |
| Prompt leakage | System prompt revealed | Anthropic has a guide on reducing prompt leaks; never place secrets in prompts (design guidance) |
| Data leakage and over-sharing | Sensitive data exposed to the wrong user or system | Enforce the caller's permissions at retrieval; redact; least privilege; retention controls (D5.4) |
| Excessive agency and tool misuse | The agent does more than intended | Least-privilege tools, PreToolUse hooks, approval tiers, sandboxing, budgets (D5.1) |
| Supply-chain risk | A malicious or buggy MCP server, plugin or dependency | Allowlist servers; review plugins (Anthropic has plugin security guidance); pin versions; managed settings (verified) |
| Over-reliance and automation bias | Humans stop checking | Sampling, seeded errors, accuracy reporting (D5.1) |
| Cost and resource abuse | Runaway loops or malicious spend | maxTurns, maxBudgetUsd, rate limits, workspace spend limits, depth and concurrency caps (verified) |
| Truncation and silent failure | Output cut off or error swallowed | Check stop_reason; structured errors; no silent suppression (../../../CCAR-F-Claude-Certified-Architect-Foundations/knowledge/05-context-management-and-reliability/03-error-propagation.md) |
| Unexpected refusals | Legitimate request declined | refusal is HTTP 200 with stop_details; avoid prompting for step-by-step reasoning in fields (reasoning_extraction); fallback path (verified) |
| Drift and regression | Quality changes after model, data or prompt change | Evaluation suite, monitoring, pinned versions (D6.5) |
| Availability and dependency failure | API, tool or network outage | Retries with backoff, timeouts, fallbacks, graceful degradation |
Threat modelling an agent (design guidance)
For each agent ask: What can it read? What can it write or trigger? What untrusted content reaches it? What is the worst realistic outcome if an attacker controls that content? Then remove capability until the worst case is acceptable, and add approval for what remains (D3.2).
Exam traps
- Trusting tool or document content as instructions.
- Defending only the system prompt.
- Granting broad tools "for flexibility".
- Ignoring supply-chain risk for third-party servers.
- Treating refusals as errors instead of an expected outcome to handle.
References
- Securely deploying AI agents — checked Oct 16, 2026
- Mitigate jailbreaks — checked Oct 16, 2026
- Reduce hallucinations — checked Oct 16, 2026
- Handling stop reasons — checked Oct 16, 2026
Check your understanding
An agent summarises customer emails and can send emails. Key risk?Show answerHide answer
Answer
Indirect injection leading to unauthorised outbound actions; restrict or gate the send tool.Which control reduces unsupported claims?Show answerHide answer
Answer
Grounding: "I don't know", quotes first, citation verification.What bounds a runaway agent loop?Show answerHide answer
Answer
Turn caps, spend caps, depth and concurrency limits.