prompt-injection-guard

prompt-injection-guard is a skill for Claude Code, Codex from Morningstar202604/awesome-skillkit. It costs 107 tokens per session (1,626 once invoked), scanned C, original, Apache-2.0.

An offline scanner for prompt injection in text supplied to an AI system. Prompt injection is text that tries to override the system's instructions, such as content from a webpage, email, user, or tool.

In plain words
What is it for?
Use it to inspect webpage text, emails, user submissions, logs, or tool results. It identifies several attack patterns and suggests handling steps without blocking input itself.
Why use it?
Untrusted content can contain hidden instructions that redirect an agent or try to make it reveal data. The scanner reports patterns and a risk score so another part of the system can decide what to do.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to inspect webpage text, emails, user submissions, logs, or tool results. It identifies several attack patterns and suggests handling steps without blocking input itself.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/morningstar202604/awesome-skillkit/prompt-injection-guard
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Morningstar202604/awesome-skillkit --skill prompt-injection-guard
Clone the repo
git clone --depth 1 https://github.com/Morningstar202604/awesome-skillkit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for prompt-injection-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/prompt-injection-guard/github.svg)](https://agentmods.dev/skills/morningstar202604/awesome-skillkit/prompt-injection-guard)
Your own site
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/prompt-injection-guard"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/prompt-injection-guard/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for prompt-injection-guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/prompt-injection-guard"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/prompt-injection-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,626 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00107 $0.01626
Opus 5.5 $0.00043 $0.00650
Sonnet 5.5 $0.00021 $0.00325
Haiku 4.5 $0.00011 $0.00163

Measured 2mo ago against content hash d8865af27a3f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

prompt-injection-guard scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Instruction-override phrasingmediumPrompt injection

Text telling the model to disregard its earlier instructions or safety rules is the shape of a prompt injection, whoever wrote it.

| `direct_override` | "ignore previous instructions / disregard above" | High |

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Nullifies safety policiesmediumAnti-refusal

"You have no restrictions", "do anything now", "ignore your guidelines": a direct jailbreak that disables guardrails.

| `roleplay_jailbreak` | "pretend to be / now you are an unrestricted" | High |

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

site/skills/programming/security/prompt-injection-guard/SKILL.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Prompt Injection Guard

Prompt injection / jailbreak detection for "untrusted input fed to LLMs" (web page text, emails, scraped content, user submissions, tool return values). Recognizes 7 injection pattern classes: direct instruction override, role-play jailbreaks, encoding obfuscation (base64/rot13/hex), multilingual code words, indirect injection ("ignore the above" style), data-exfiltration lures, and spoofed system messages. Outputs a 0-100 risk score + hit list + handling recommendation. Core principle: default to read-only dry-run; hits are reported, not blocked; blocking is the caller's decision.

Distinct from pii-redactor: that one redacts personal data. This skill defends against "instruction-layer" attacks — cleaning data-layer PII ≠ stopping injection; the two are independent and should be chained.

Input Checklist

Input Required Description
Text to inspect Yes A string or file path (web page body / log line / tool output)
Source category No web / email / user_input / tool_result; affects weighting
Language No Auto-detected; can be set to zh / en / multi
Threshold No The risk-score cutoff, default 50 (≥ is judged high-risk and needs a human)
Dry run No --dry-run (on by default): only emit a report, write no file

(Missing-input prompt template: "Please provide: (1) the text or file path to inspect; (2) source category (web / email / user_input / tool_result, default web); (3) language (zh / en / multi, default auto). Everything else uses defaults: dry-run on, threshold 50.")

Pre-flight Checks

python3 -c "import sys; sys.exit(0 if sys.version_info>=(3,8) else 1)" \
  && echo "python>=3.8 OK" || echo "Python 3.8+ required"

Expected: prints python>=3.8 OK. On failure → upgrade or switch environment and stop. Runs offline, reads no secrets, sends nothing over the network (red line: injection defense must never send the inspected text out).

Read the full file on GitHub · 113 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · +2 lines · +107 tokens per session scan B → C d8865af27a3f
  2. 2mo ago First seen · 111 lines · 0 tokens per session scan B 68fe5487e73b

Subscribe to this mod's changes

prompt-injection-guard is a skill published in the GitHub repository Morningstar202604/awesome-skillkit (0 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 107 tokens to every session and 1,626 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it C with 2 findings (instruction-override phrasing, nullifies safety policies). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-23.

Related

prompt-injection-guard compared with skills from other repositories

prompt-injection-guard next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
prompt-injection-guardMorningstar202604/awesome-skillkitSkill02mo agoApache-2.0C107Claude Code, Codex
safe-refactorJuliusBrussee/cavemanSkill124ktodayApache-2.0A29Claude Code, Codex
mem0-oss-to-platformmem0ai/mem0Skill70k3d agoApache-2.0A217Claude Code, Codex
auditing-subgroup-fairnessmaziyarpanahi/openmedSkill5.9kyesterdayApache-2.0A148Claude Code
memoryopensquilla/opensquillaSkill7.2k4d agoApache-2.0A44Claude Code, Codex
infographic-template-updaterantvis/InfographicSkill7.2k1mo agoMITA43Claude Code
pulse-configureSnowflake-Labs/cocoplusSkill72923d agoMITA12Claude Code, Codex