prompt-injection-tester
Skill13 starsChanged 5 months agoMITView on GitHub
Red-team an LLM application against prompt injection and jailbreaks using a curated, categorized payload library and canary-based detection, then produce a resilience score. Use when the user asks to "test my chatbot for prompt injection", "check if my AI app is jailbreakable", "red-team my LLM", "evaluate prompt-injection defenses", or audit a system prompt's guardrails.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- fevziegeyurtsevenler/llm-security-skillstheir own version, first seen Jul 25, 2026
- thejordanleopold/claude-code-skills-distilledtheir own version, first seen Apr 18, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- thejordanleopold/claude-code-skills-distilled★ 4same name
- fevziegeyurtsevenler/llm-security-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- cors-auditorSkill
- dependency-checkSkill
- dockerfile-scanSkill
- http-sec-auditSkill
- jwt-inspectorSkill
- sast-liteSkill
- secret-scannerSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 90
If you already captured a model response, score it without any network call:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Prompt Injection Tester
A defensive red-team harness for evaluating the prompt-injection resistance of LLM applications you own or are authorized to test. It ships a library of well-documented public attack techniques and a canary-based detection engine that decides whether each attack succeeded — then scores overall resilience.
⚠️ Use only against systems you own or have permission to test. The payloads are public hardening techniques, intended to strengthen guardrails.
When to use this skill
- "Is my chatbot vulnerable to prompt injection / jailbreaks?"
- "Red-team / pentest my LLM app's system prompt."
- "Score how well my guardrails resist instruction-override attacks."
- Regression-testing guardrails in CI after a prompt change.
Attack categories covered
instruction-override · system-prompt-leak · role-play (DAN-style) ·
delimiter-escape · encoding (base64/leetspeak) · data-exfiltration
(indirect injection) · refusal-suppression.
How it works
- A unique canary secret is embedded into a guarded system prompt.
- Each payload is sent as the user turn.
- The response is scored: it's vulnerable if it hits an attack success-marker or leaks the canary; resisted if it refuses.
- You get a resilience score (0–100) and a per-category breakdown.
How to run it
List the payload library (no model calls):
python skills/prompt-injection-tester/attacker.py --list
python skills/prompt-injection-tester/attacker.py --list --category role-playSee the harness detect a weak vs. a hardened model:
python skills/prompt-injection-tester/attacker.py --demo # weak model
python skills/prompt-injection-tester/attacker.py --demo --hardened # safe model
python skills/prompt-injection-tester/attacker.py --demo --jsonExit codes: 0 clean (no payload succeeded, or --list) · 1 at least one
payload succeeded · 2 usage error.
Testing a real model (recommended workflow for Claude)
Wrap the user's backend in a model(system_prompt, user_prompt) -> str
callable and run the suite. Example skeleton the user can adapt:
import sys
sys.path.insert(0, "skills/prompt-injection-tester")
import attacker
def model(system_prompt, user_prompt):
# call the user's real API/app here and return the text response
return my_llm_app(system=system_prompt, user=user_prompt)
results = attacker.run_suite(model)
print(attacker.summarize(results))Then:
- Report the resilience score and list every
failed_payload. - For each failure, show the technique and recommend a mitigation — e.g. stronger system-prompt instructions, input/output canary filtering, privilege separation for tool calls, or a dedicated injection classifier.
- Re-run after fixes to confirm the regression is closed.
Offline scoring
If you already captured a model response, score it without any network call:
import attacker
payload = attacker.PAYLOADS[0]
verdict = attacker.score_response(payload, response_text, canary="CANARY-abc")
print(verdict.vulnerable, verdict.reason)Limitations
Marker/canary detection is a heuristic: a refusal-shaped response that still
complies, or a creative leak, may need human review (score_response flags
ambiguous cases as "review manually"). Treat the score as a guardrail signal,
not a guarantee.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

