prompt-injection-scanner

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Prompt Injection Scanner

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.
prompt-injection-scanner
是一款专为AI Agent时代打造的安全工具。它能够识别Agent指令中的薄弱环节,这些环节可能会被恶意用户利用,通过在输入字段中插入冲突指令来“劫持”Agent的行为。

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.
  • 技能开发阶段:每当更新Agent技能的
    capabilities
    或指令时,都应运行此工具。
  • 部署前安全审查:在向不可信用户开放Agent访问权限前,这一步至关重要。
  • 持续安全审计:随着新的注入模式被发现,定期扫描所有技能。

When NOT to Use

不适用场景

  • Standard Code Auditing: Use the
    secret-leak-detector
    for credentials; this is specifically for "instruction-level" security.
  • 标准代码审计:若需检查凭证泄露,请使用
    secret-leak-detector
    ;本工具专门针对“指令层面”的安全问题。

Input and Output Examples

输入输出示例

Input

输入

yaml
skill_path: "./agent-skills/data-processor/SKILL.md"
yaml
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.
  • 聚焦元数据:仅扫描指令内容,不会触及用户私有数据。
  • 本地分析:建议在开发环境中本地运行该工具。