Scan web content for prompt injection, hidden instructions, and adversarial content targeting AI agents
Project description
Palisade Scanner ๐
Scan web content for prompt injection, hidden instructions, and adversarial content targeting AI agents.
AI agents browse the web, read documents, and consume external content. Adversaries hide instructions in invisible text, HTML metadata, encoded payloads, and zero-width characters โ Palisade finds them all.
What makes Palisade unique
| Capability | Palisade Scanner | Manual review | Generic scrapers |
|---|---|---|---|
| Hidden text detection | โ 20+ CSS/HTML techniques | โ | โ |
| Injection pattern matching | โ 100+ regexes, 5 categories | โ | โ |
| LLM-as-judge classifier | โ understands adversarial intent | N/A | โ |
| Metadata analysis | โ comments, JSON-LD, meta, data attrs | โ | โ |
| Exfiltration detection | โ URLs, eval(), fetch(), redirects | โ | โ |
| MCPGuard policy generation | โ auto-generate rules | โ | โ |
| CI/CD mode | โ
--ci --threshold high |
โ | โ |
| Zero-width character detection | โ | โ | โ |
Why
AI agents browse the web, read documents, and consume external content. Adversaries can hide instructions in:
- Invisible text (white-on-white, zero font size, off-screen positioning)
- HTML comments and metadata
- Base64 encoded payloads
- Zero-width character injections
- Instructions disguised as product descriptions or reviews
This scanner finds them all and tells you what to do about it.
Quick Start
# Install
pip install palisade-scanner
# CLI: scan a URL
pis scan https://example.com
# or
palisade scan https://example.com
# Web UI: open the dashboard
pis web
# Docker
docker compose up
# โ http://localhost:8000
Usage
CLI
# Scan a URL
pis scan https://example.com
# Scan a local file
pis scan --file suspicious.html
# Scan pasted text
pis scan --paste "<!-- ignore instructions -->"
# JSON output
pis scan https://example.com --format json
# CI/CD mode (exit code reflects risk)
pis scan https://example.com --ci --threshold high
# Generate MCPGuard policy rules
pis policies https://evil-site.com
API
# Scan via REST API
curl "http://localhost:8000/api/scan?url=https://example.com"
# HTML report
curl "http://localhost:8000/api/scan/https://example.com"
How It Works
Detection Layers
| Layer | What It Detects |
|---|---|
| Hidden Text Detector | 20+ CSS/HTML hiding techniques (display:none, visibility, opacity, color matching, off-screen, zero-width chars, HTML comments) |
| Injection Pattern Matcher | 100+ regex patterns across 5 categories (jailbreak, role override, exfiltration, tool manipulation, impersonation) |
| Instruction Classifier | LLM-as-judge that understands adversarial intent (requires API key) |
| Metadata Analyzer | HTML comments, JSON-LD, meta tags, data attributes, <noscript>, <template> |
| Exfiltration Detector | URLs, endpoints, eval() patterns, redirect attempts, fetch() calls |
Scoring
Risk Score: 0-100
Weighted formula:
base = 100
- critical * 25
- high * 10
- medium * 3
- low * 1
Categories: none (0-5) โ low (6-20) โ medium (21-50) โ high (51-80) โ critical (81-100)
Architecture
User (CLI / Web / API)
โ
โผ
PipelineOrchestrator
โ
โโโ Loader (URL / File / Paste / PDF)
โ
โโโ Detector Pipeline (parallel)
โ โโโ HiddenTextDetector
โ โโโ InjectionPatternMatcher
โ โโโ MetadataAnalyzer
โ โโโ ExfiltrationDetector
โ โโโ InstructionClassifier (LLM)
โ
โโโ ScoringEngine
โ
โโโ Reporters
โโโ JSON / Markdown / Simple
โโโ Policy Generator (MCPGuard)
โโโ Web UI (HTMX)
Project Structure
src/scanner/
โโโ cli.py # Typer CLI
โโโ api.py # FastAPI web app
โโโ config.py # Settings (env vars)
โโโ domain/
โ โโโ models.py # Pydantic models
โ โโโ scoring.py # Risk score engine
โโโ loaders/
โ โโโ url.py # HTTP URL fetcher
โ โโโ pdf.py # PDF extractor
โ โโโ paste.py # Raw text
โโโ detectors/
โ โโโ hidden_text.py # CSS/HTML hiding
โ โโโ injection_patterns.py # 100+ regex patterns
โ โโโ instruction_classifier.py # LLM-as-judge
โ โโโ metadata_analyzer.py # Comments/meta/tags
โ โโโ exfiltration.py # Data theft patterns
โโโ pipeline/
โ โโโ orchestrator.py # Scan pipeline
โโโ reporters/ # JSON/MD/Simple output
โโโ policies/ # MCPGuard rule generation
โโโ utils/ # DOM helpers
Integration
MCPGuard
Generate rules compatible with MCPGuard:
pis scan https://evil-site.com --format mcpguard > rules.yaml
mcpguard load-rules rules.yaml
CI/CD
# .github/workflows/check-urls.yml
- name: Scan for prompt injection
run: |
pis scan ${{ matrix.url }} --ci --threshold medium
Roadmap
- v0.1 โ Scanner core: CLI, 5 detectors, scoring, policy generation
- v0.2 โ Live Monitor: scheduled re-scans, webhook alerts, diff detection
- v0.3 โ Agent Validator: Browser Use agent tests pages in real time
- v0.4 โ Content Safety Proxy: reverse proxy that strips injections
- v0.5 โ Reputation Engine: web of trust for agent-safe URLs
- v0.6 โ Red Team Lab: adversarial page generator + benchmark suite
- v0.7 โ Certification Pipeline: verified AgentSafe badges
Related Projects
- MCPGuard โ Runtime security proxy for MCP
- MCPwn โ Offensive security testing for MCP
- MCPscop โ Unified security dashboard
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file palisade_scanner-0.1.0.tar.gz.
File metadata
- Download URL: palisade_scanner-0.1.0.tar.gz
- Upload date:
- Size: 74.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d44a18d7f67ecc4f6924c2a75a7ad4fff6a90aee2b4b29047d95fe2fb0fa5b9
|
|
| MD5 |
78c0165a16812a9b040d15a4146eb3f4
|
|
| BLAKE2b-256 |
e0e2593b2eff69b112a981128a9b30b37d02662fadacbb119b288fdfc82b862a
|
File details
Details for the file palisade_scanner-0.1.0-py3-none-any.whl.
File metadata
- Download URL: palisade_scanner-0.1.0-py3-none-any.whl
- Upload date:
- Size: 74.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e193fee51d41d129af43d4672e0809c2082da3009e49fd289f866ff7d8bb24af
|
|
| MD5 |
f561b49165f5b838f6113556687af128
|
|
| BLAKE2b-256 |
3511db73b749c20a0b29935e979fa9d2bcaa39f03af52a2128eb996b66885289
|