🛡️
AI EngineeringTypeScript

Prompt Injection Defender

by lasso-security

Prompt Injection Defender is an AI Engineering skill for Claude Code, published by lasso-security in claude-hooks.

264 stars30 forkson lasso-security/claude-hooksAdded 2026/09/02Repository updated 2026/01/08
agentaiclaude-codeclaude-desktopcoding-agenthooksprompt-injectionprompt-injection-llm-security
Install in seconds
Install Prompt Injection Defender
Copy Prompt Injection Defender into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/lasso-security/claude-hooks/tree/dev/.claude/skills/prompt-injection-defender ~/.claude/skills/prompt-injection-defender

Requires Node.js. Downloads this skill only — not the rest of the repository — into your Claude Code skills folder.

Without Node.js

git clone https://github.com/lasso-security/claude-hooks.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
.claude/skills/prompt-injection-defender/SKILL.md in lasso-security/claude-hooks
Installs to
~/.claude/skills/prompt-injection-defender
Collection
The only skill cataloged from this repository
Category
AI Engineering2631 skills

What Prompt Injection Defender does

Prompt Injection Defender scans tool outputs for indirect prompt injection attempts and warns Claude about suspicious instructions. Use it when you want to detect override, role-playing, encoding, or context-manipulation patterns in files, web pages, and command results.

Prompt Injection Defender is cataloged under AI Engineering on DirSkills. Prompt Injection Defender comes from a repository tagged agent, ai, claude-code, claude-desktop and coding-agent.

Documentation

README

Prompt Injection Defender Skill

Overview

Defense against indirect prompt injection attacks for Claude Code. This skill provides PostToolUse hooks that scan tool outputs (files, web pages, command results) for injection attempts and warn Claude about suspicious content.

Features

  • Real-time scanning of tool outputs (Read, WebFetch, Bash, Grep, Task, MCP tools)
  • 4 detection categories: Instruction Override, Role-Playing/DAN, Encoding/Obfuscation, Context Manipulation
  • 50+ patterns covering known injection techniques
  • Warn + Continue approach (doesn't block, just warns Claude)
  • Dual implementation: Python/UV and TypeScript/Bun

Skill Structure

This is the opening of the README. Read the full README on GitHub.

Frequently asked about Prompt Injection Defender

  • How does Prompt Injection Defender compare to other AI Engineering skills?

    Prompt Injection Defender ranks #2251 by stars among the 2631 AI Engineering skills in this catalog. The most-starred ones next to it are Architecture Decision Records, AI-First Engineering and Agentic OS. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Prompt Injection Defender against them. Open each page to compare what they document and how they install.