Skip to content

Direct Injection Detection

Probes an AI agent with direct prompt-override attempts and reports whether it obeys them.

Stars
7,320
Licence
Apache-2.0
Files
1 file

What it does

This skill teaches an AI agent to act as a security tester for chatbots and assistants. It sends the agent a set of user messages that try to override the system's instructions (for example, asking it to ignore prior rules or reveal its hidden prompt) and checks whether the target answers by leaking internal instructions or changing behavior, such as appending a marker phrase. Findings are written up as structured vulnerability reports with severity and remediation suggestions.

Great for

  • Security engineers red-teaming a chatbot or agent product before release
  • Developers testing whether their own assistant resists direct prompt injection
  • Teams building an automated AI safety test suite

Skip it if

  • Protecting a live production system from attacks on its own; this file only describes probing and reporting, with no defensive filter code (the skill is for testing, not blocking)
  • Detecting indirect injection hidden in documents or web pages, which the skill explicitly excludes
  • Testing systems you do not own or have permission to probe, since sending override prompts to third-party services may breach their terms

Try asking

  • “Run direct prompt injection tests against my customer support chatbot and report any system prompt leaks.”
  • “Check whether our internal assistant can be made to add a marker phrase after an override attempt.”
  • “Generate a vulnerability report in the standard format for any role-override findings you confirm.”
Step-by-step guide: how to use Direct Injection DetectionInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the Apache-2.0 licence and an attribution note.

    direct-injection-detection.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip direct-injection-detection.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip direct-injection-detection.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Only run these probes against systems you own or are authorised to test, and keep logs of each test prompt and response.
  • Follow the stop rule: once one finding of a type is confirmed, move on rather than repeating probes.
  • Treat the three example override prompts as a starting point and add variants to get broader coverage.

What's inside

  • SKILL.md

Redistributed unmodified from Tencent/AI-Infra-Guard under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.