prompt-injection-scanner

v1.2.0
io.github.GuardBee/prompt-injection-scanner Checked 1 day ago Published 1 month ago

Scans RAG content/scraped pages for indirect prompt injection

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

scan_text

Scan a text string — a RAG chunk, a scraped web page, a document, a tool result — for indirect prompt injection payloads (instruction-override phrases, spoofed chat-template roles, hidden/invisible text, content addressing 'the AI' directly, data-exfiltration attempts) before it reaches a model's context.

ParameterTypeDescription
content *stringThe text content to scan
labelstringOptional label shown in findings (e.g. source URL or filename)

scan_file

Scan a single file (a knowledge-base document, an HTML page, extracted text) for indirect prompt injection payloads

ParameterTypeDescription
path *stringAbsolute or relative path to the file to scan

scan_directory

Recursively scan a directory — e.g. a RAG knowledge base or a corpus of scraped pages — for indirect prompt injection payloads. Automatically skips node_modules, .git, dist, and binary files.

ParameterTypeDescription
path *stringAbsolute or relative path to the directory to scan
excludearraySkip files/dirs whose path contains one of these strings
includearrayOnly scan files whose path contains one of these strings (e.g. [".md", "knowledge-base/"])
maxFilesintegerMaximum number of files to scan (default: 5000)

list_patterns

List all indirect prompt injection patterns that the scanner can detect, grouped by category