Rechercher

PythonReactSEOPDF
OpenClaw

Prompt Injection Protection

Prompt Injection Protection Skill

blackworm0 installations selon la source☆ 0 Étoiles du dépôt

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

SkillHub CLI

skillhub install blackworm/prompt-injection-protection

Examinez la source et la compatibilité, puis suivez les étapes d’installation.

Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.

Voir la source ↗Guides

Instructions

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

Informations sur la source

Source
github
Repository
openclaw/skills
Path
skills/blackworm/prompt-injection-protection
Version
—
Commit
8590a1dc19a174eccd4e6649b0a738c0068084b9
Source de classification
rules
Statut
active
Visibilité
public

Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.

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'...

Contenu extrait

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'...

Skills associés

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.