搜索

PythonReactSEOPDF
OpenClaw

Prompt Injection Protection

Prompt Injection Protection Skill

blackworm0 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install blackworm/prompt-injection-protection

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

Prompt Injection Protection Skill

Description

A comprehensive skill to protect against prompt injection attacks when processing external content such as websites, emails, documents, and other untrusted input sources.

Purpose

This skill provides methods to safely sanitize, validate, and process external content to prevent malicious prompt injection attempts that could manipulate the AI's behavior or cause it to execute unintended actions.

Features

  • Content sanitization and validation
  • Prompt injection detection and filtering
  • Secure processing of web content
  • Safe extraction of information from untrusted sources
  • Protection against jailbreak attempts

Security Measures

  • Input sanitization
  • Output encoding
  • Context isolation
  • Validation of external content
  • Prevention of instruction hijacking

Usage

The skill provides functions to:

  • Sanitize external content before processing
  • Validate content against injection patterns
  • Safely extract information from untrusted sources
  • Process web content securely
  • Filter potentially harmful instructions

来源信息

Source
github
Repository
openclaw/skills
Path
skills/blackworm/prompt-injection-protection
Version
—
Commit
8590a1dc19a174eccd4e6649b0a738c0068084b9
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

README

Prompt Injection Protection Skill

This skill provides comprehensive protection against prompt injection attacks when processing external content such as websites, emails, documents, and other untrusted input sources. It includes real-time security alerts for suspicious activities.

Features

  • Content sanitization and validation
  • Prompt injection detection and filtering
  • Secure processing of web content
  • Safe extraction of information from untrusted sources
  • Protection against jailbreak attempts
  • NEW: Real-time security alerts for suspicious commands
  • NEW: Detection of system file access attempts
  • NEW: User confirmation for risky operations

Security Alert System

The skill now includes a comprehensive security notification system that:

  • Alerts you when suspicious commands are detected
  • Warns about system file access attempts
  • Notifies you of credential/password file access
  • Flags potential injection attempts in web content
  • Requires user confirmation for risky operations

Usage Examples

Basic Usage
const PromptInjectionProtection = require('./index.js');
const protection = new PromptInjectionProtection();

// Set up security alert callback
protection.setSecurityAlertCallback(async (alertInfo) => {
  console.log(`🚨 SECURITY ALERT: ${alertInfo.type}`);
  console.log(`   Severity: ${alertInfo.severity}`);
  console.log(`   Action Required: ${alertInfo.actionRequired}`);
});

// Process external content safely
const result = protection.processExternalContent(untrustedContent, {
  maxLength: 5000,
  strictMode: true
});

if (result.isSafe) {
  // Process the sanitized content
  console.log(result.sanitized);
} else {
  // Handle unsafe content
  console.warn('Potentially unsafe content detected', result.injectionCheck);
}
Command Pre-Checking (NEW FEATURE)
// Check a command before executing it
const commandCheck = await protection.preCheckCommand('sudo rm -rf /', {
  source: 'user_input'...

来源内容

SKILL.md
# Prompt Injection Protection Skill

## Description
A comprehensive skill to protect against prompt injection attacks when processing external content such as websites, emails, documents, and other untrusted input sources.

## Purpose
This skill provides methods to safely sanitize, validate, and process external content to prevent malicious prompt injection attempts that could manipulate the AI's behavior or cause it to execute unintended actions.

## Features
- Content sanitization and validation
- Prompt injection detection and filtering
- Secure processing of web content
- Safe extraction of information from untrusted sources
- Protection against jailbreak attempts

## Security Measures
- Input sanitization
- Output encoding
- Context isolation
- Validation of external content
- Prevention of instruction hijacking

## Usage
The skill provides functions to:
- Sanitize external content before processing
- Validate content against injection patterns
- Safely extract information from untrusted sources
- Process web content securely
- Filter potentially harmful instructions
README
# Prompt Injection Protection Skill

This skill provides comprehensive protection against prompt injection attacks when processing external content such as websites, emails, documents, and other untrusted input sources. It includes real-time security alerts for suspicious activities.

## Features

- Content sanitization and validation
- Prompt injection detection and filtering
- Secure processing of web content
- Safe extraction of information from untrusted sources
- Protection against jailbreak attempts
- **NEW: Real-time security alerts for suspicious commands**
- **NEW: Detection of system file access attempts**
- **NEW: User confirmation for risky operations**

## Security Alert System

The skill now includes a comprehensive security notification system that:

- Alerts you when suspicious commands are detected
- Warns about system file access attempts
- Notifies you of credential/password file access
- Flags potential injection attempts in web content
- Requires user confirmation for risky operations

## Usage Examples

### Basic Usage

```javascript
const PromptInjectionProtection = require('./index.js');
const protection = new PromptInjectionProtection();

// Set up security alert callback
protection.setSecurityAlertCallback(async (alertInfo) => {
  console.log(`🚨 SECURITY ALERT: ${alertInfo.type}`);
  console.log(`   Severity: ${alertInfo.severity}`);
  console.log(`   Action Required: ${alertInfo.actionRequired}`);
});

// Process external content safely
const result = protection.processExternalContent(untrustedContent, {
  maxLength: 5000,
  strictMode: true
});

if (result.isSafe) {
  // Process the sanitized content
  console.log(result.sanitized);
} else {
  // Handle unsafe content
  console.warn('Potentially unsafe content detected', result.injectionCheck);
}
```

### Command Pre-Checking (NEW FEATURE)

```javascript
// Check a command before executing it
const commandCheck = await protection.preCheckCommand('sudo rm -rf /', {
  source: 'user_input'...

相关技能

OpenClaw

1password

daggerkun007

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.