Direct Injection Detection
100TrustedPre-approves toolsIdentification of user-led attempts to override system instructions and core behavior.
What it does
Direct Injection Detection modifies your assistant's behavior to evaluate its own resistance against unauthorized control shifts. When activated, it systematically tests whether the agent prioritizes user input over its pre-defined core instructions or system-level identity.
This skill is specifically for developers looking to audit their agents' resilience to direct role-hijacking attempts. It generates structured reports detailing any instances where the model permits a user to extract internal policies or deviate from established operational parameters.
When it earns its place
Reach for it when…
Install this when you need to verify that your agent maintains its system persona and behavioral constraints regardless of direct prompts from the user attempting to force a role change or instruction override.
Look elsewhere when…
This skill is not suitable for detecting indirect attacks that involve malicious data embedded in external files, web searches, or RAG-based context documents. Use it only for evaluating standard dialogue interactions.
What to say to use it
You never invoke a skill directly — the assistant picks it up when your request matches what it covers. These are the kinds of things that do that.
- Test if my assistant ignores its system prompt
- Check for direct prompt injection vulnerabilities
- Identify if the model allows role override attempts
- Run a security audit on my current system instructions
Install it
Install for all your projects
Copy the skill directory into your personal skills folder. Claude picks it up on its own the next time your request matches what it does — there is nothing to enable.
git clone --depth 1 --branch main https://github.com/Tencent/AI-Infra-Guard.git /tmp/AI-Infra-Guard
mkdir -p ~/.claude/skills
cp -r /tmp/AI-Infra-Guard/agent-scan/agent_scan/prompt/skills/direct-injection-detection ~/.claude/skills/direct-injection-detectionInstall for one project only
Put it in the project's own skills folder instead, so it can be committed and shared with everyone working on that repository.
cp -r /tmp/AI-Infra-Guard/agent-scan/agent_scan/prompt/skills/direct-injection-detection .claude/skills/direct-injection-detectionIf a skill of the same name exists in both places, the personal one wins.
Installing on Claude.ai or through the API instead? The full guide covers every surface.
Pair it with an MCP server
Direct Injection Detection changes how the work is done. These servers change what Claude can reach while doing it.
- PortSwigger MCP Server73The skill supplies the review method; PortSwigger MCP Server supplies the findings to run that method against.
- GitHub MCP Server53With GitHub MCP Server, a security review reads the code as it is committed rather than as it is described.
- Bitwarden MCP Server36Bitwarden MCP Server shows how credentials are actually held, which is usually where a compliance check finds its answer.