/prodsec-skills:prompt-injection-mitigationfrom prodsec-skills
Provides layered defense strategies against prompt injection in LLM-based systems, including runtime guardrails, model selection criteria, human-in-the-loop controls, and output validation.
Ships in prodsec-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Prompt injection cannot be fully prevented. It can only be minimized. The approach combines multiple layers of defense rather than relying on a single control.
Use architectural components that reduce prompt injection probability:
guardrails/bidirectional-filtering)Model safety is primarily determined during pre-training and fine-tuning. If the solution does not pre-train or fine-tune its own models, select models that have been trained with safety as a priority.
| Evaluation Criteria | What to Look For |
|---|---|
| Safety benchmarks | Published safety evaluation scores and red-team results |
| Alignment training | RLHF, constitutional AI, or other alignment techniques applied |
| Known vulnerabilities | Check for disclosed prompt injection vulnerabilities |
| Provider reputation | Track record of the model provider on security and safety |
The best mitigation for prompt injection in agentic systems is keeping a human in the loop. Require explicit user confirmation before executing any sensitive or destructive action triggered by the LLM. This is especially critical for MCP-based agents where tool execution can have real-world impact.
Reduce the impact of successful prompt injection by constraining what the model can do:
eval_sandbox/output-validation-sandbox)Rate Limiting (API Gateway)
→ Input Guardrails (prompt filtering)
→ Safer Model (alignment training)
→ Output Guardrails (response filtering)
→ Output Validation Sandbox (if model generates actions)
Beyond prompt injection, address these related LLM risks:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
prompt-injection, llm-security, guardrails, defense-in-depth, ai-safety
130 skills in this plugin
/address-sanitizerAddressSanitizer detects memory errors during fuzzing. Use when fuzzing C/C++ code to find buffer overflows and use-after-free bugs.
/admin-interface-securitySecure the administrative interface of model registries. Use when building, deploying, or reviewing model registry access controls and admin interfaces./aflppAFL++ is a fork of AFL with better fuzzing performance and advanced features. Use for multi-core fuzzing of C/C++ projects.
npx claudepluginhub redhatproductsecurity/prodsec-skills --plugin prodsec-skillsOther plugins' skills for the same job