mcpField
P
prompt-injection-scanner

prompt-injection-scanner

github.com/jorgealvesSecurity2270 installsUpdated 2d ago
Repository

About prompt-injection-scanner

prompt-injection-scanner is a security skill for finding prompt-injection weaknesses in agent instructions, aimed at skill developers and pre-deployment reviewers. It scans instructions rather than private user data and reports risks with mitigation suggestions.

Key features

  1. 01Find prompt-hijacking risks in instructions
  2. 02Produce structured risk reports
  3. 03Suggest concrete mitigations
  4. 04Analyze instructions only
  5. 05Support local analysis

Use cases

  1. 01Review instructions after changing an agent skill
  2. 02Assess skills before exposing them to untrusted users
  3. 03Periodically audit skills for injection risks

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/jorgealves/agent_skills --skill prompt-injection-scanner

After installing, type/prompt-injection-scannerin Claude Code to confirm it loaded.

Bundled filesskill.yaml

Details

From the project README

Prompt Injection Scanner

Purpose and Intent

The prompt-injection-scanner is a security tool specifically for the AI agent era. It identifies weak points in agent instructions where a malicious user could potentially "hijack" the agent's behavior by inserting conflicting instructions into input fields.

When to Use

  • Skill Development: Run this every time you update the capabilities or instructions for an agent skill.
  • Pre-deployment Security Review: Essential before making an agent accessible to untrusted users.
  • Continuous Security Auditing: Periodically scan all skills as new injection patterns are discovered.

When NOT to Use

  • Standard Code Auditing: Use the secret-leak-detector for credentials; this is specifically for "instruction-level" security.

Input and Output Examples

Input
skill_path: "./agent-skills/data-processor/SKILL.md"
Output

A structured report highlighting parts of the instructions that are susceptible to prompt hijacking, along with concrete mitigation strategies.

Error Conditions and Edge Cases

  • Missing Instructions: If a skill defines tools but provides no behavioral instructions, the scanner will flag this as a risk.
  • Complex Logic: Highly conditional instructions can be difficult to model and may result in false positives or negatives.

Security and Data-Handling Considerations

  • Metadata Focus: Only scans instructions; does not touch private user data.
  • Local Analysis: Recommended to run locally within the development environment.

Comments

Markdown supported