injectshield

v0.1.4
io.github.bch1212/injectshield Checked 4 days ago Published 7 months ago

Prompt-injection firewall for AI agents — scan untrusted text before LLM calls.

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

scan

Scan text for prompt-injection. Use BEFORE passing any untrusted text (web pages, file contents, user inputs, git commits, tool outputs) into another LLM call. Returns a verdict (safe/unsafe), a confidence score, the threat category, the matched pattern IDs, and an optional sanitized version with injection spans redacted.

ParameterTypeDescription
text *stringText to scan (max 100,000 chars).
contextstringWhere the text came from. Affects scoring — git commits are treated as more suspicious than user input by default.
return_cleanedbooleanReturn the input with detected spans redacted.
sensitivitystringDetection threshold. low = fewest false positives, high = fewest false negatives. Default: medium.

scan_url

Fetch a URL and scan its body for prompt-injection. Useful before feeding scraped page content into another LLM call. Sets the context to web_content automatically.

ParameterTypeDescription
url *stringURL to fetch and scan.
contextstringOverride the default web_content context.
max_bytesintegerTruncate fetched body before scanning. Default 50000.
return_cleanedboolean
sensitivitystring

patterns

List supported threat categories, context kinds, and sensitivity levels. Use this to discover what threat_type values scan() can return.