A secure curl wrapper with middleware support, HTML-to-markdown extraction, and prompt injection detection.
pip install sibylline-scurlOr with pipx (recommended for CLI tools):
pipx install sibylline-scurlFor prompt injection detection, install the optional dependencies:
pip install "sibylline-scurl[prompt-defender]"# Fetch a URL and extract clean markdown from HTML
scurl https://example.com
# Raw output (disable response middleware)
scurl --raw https://example.com
# Extract article content only (strips nav, ads, sidebars)
scurl --readability https://example.com
# Enable prompt injection detection
scurl --enable prompt-defender https://example.com
# Multilingual prompt injection detection (all 13 supported languages)
scurl --enable prompt-defender --injection-languages all https://example.com
# All curl flags work
scurl -H "Accept: application/json" https://api.example.com/data- SecretDefender: Automatically detects and blocks requests containing exposed secrets/tokens
- HTML to Markdown: Converts HTML responses to clean markdown (use
--readabilityfor article extraction) - Prompt Injection Detection: Detects and handles prompt injection attacks in web content
- Multilingual Support: Prompt injection detection in 13 languages
- Middleware System: Composable request and response middleware
scurl extracts clean, readable content from web pages - perfect for LLM consumption, readability, or bandwidth savings. With prompt injection detection, you can safely fetch web content for AI applications.
| Website | curl | scurl | Reduction |
|---|---|---|---|
| example.com | 513 | 167 | 67.4% |
| news.ycombinator.com | 34,082 | 10,739 | 68.5% |
| en.wikipedia.org/wiki/Curl | 110,373 | 10,044 | 90.9% |
| github.com/anthropics | 296,788 | 353 | 99.9% |
| docs.python.org | 319,554 | 12,348 | 96.1% |
scurl includes a prompt injection detection system that can identify and handle malicious content designed to manipulate LLMs. Enable it with --enable prompt-defender.
The prompt defender uses a multi-layer detection approach:
- Pattern Matching: Regex patterns for common injection techniques (instruction override, role injection, system manipulation, jailbreak attempts, etc.)
- Motif Analysis: Fuzzy matching of known injection phrases
- ML Classification: Random Forest classifier with semantic embeddings for novel attack detection
Prompt injection detection is available in 13 languages:
| Code | Language | Code | Language |
|---|---|---|---|
en |
English | ko |
Korean |
es |
Spanish | ru |
Russian |
fr |
French | ar |
Arabic |
de |
German | pt |
Portuguese |
zh |
Chinese | it |
Italian |
ja |
Japanese | hi |
Hindi |
nl |
Dutch |
Use --injection-languages to specify which languages to check:
# English only (default)
scurl --enable prompt-defender https://example.com
# Specific languages
scurl --enable prompt-defender --injection-languages en,es,fr https://example.com
# All supported languages
scurl --enable prompt-defender --injection-languages all https://example.comWhen a prompt injection is detected, you can configure how scurl handles it:
| Action | Description |
|---|---|
warn |
Wrap suspicious spans in <suspected-prompt-injection> tags, content unchanged |
redact |
Wrap in tags and mask detected patterns with █ characters (default) |
datamark |
Wrap in tags with spotlighting mode for LLM context |
metadata |
Add detection metadata to output, content unchanged |
silent |
No output modification, detection runs silently |
# Redact detected injections (default)
scurl --enable prompt-defender --injection-action redact https://example.com
# Just warn, don't modify content
scurl --enable prompt-defender --injection-action warn https://example.com
# Adjust detection threshold (0.0-1.0, default: 0.3)
scurl --enable prompt-defender --injection-threshold 0.5 https://example.comYou can customize or extend the detection patterns by creating YAML configuration files. scurl checks these locations in priority order:
- User config:
~/.config/scurl/patterns/(highest priority) - Project config:
.scurl/patterns/in current directory - Package defaults: Built-in patterns (fallback)
To override patterns for a language, create a YAML file named {language_code}.yaml:
# ~/.config/scurl/patterns/en.yaml
language: en
name: English
version: "1.0"
patterns:
instruction_override:
- 'ignore\s+(all\s+)?(previous|prior|above)\s+(instructions?|rules?|guidelines?)'
- 'disregard\s+(everything|all)\s+(above|before|prior)'
# Add your custom patterns...
role_injection:
- 'you\s+are\s+now'
- 'from\s+now\s+on'
# ...
motifs:
instruction_override:
- 'ignore all instructions'
- 'forget everything above'
# Simple phrases for fuzzy matching...Pattern categories:
instruction_override: Attempts to override system instructionsrole_injection: Attempts to change the AI's role/personasystem_manipulation: Attempts to enable "developer mode", bypass safety, etc.prompt_leak: Attempts to extract system promptsjailbreak_keywords: Known jailbreak techniques (DAN, etc.)encoding_markers: Base64, ROT13, and other encoding attemptssuspicious_delimiters: Fake system/instruction tags
For CJK languages (Chinese, Japanese, Korean) that don't use spaces between words, add:
settings:
word_boundaries: false| Flag | Description |
|---|---|
--raw |
Disable all response middleware (raw HTML output) |
--readability |
Extract article content only (strips nav, ads, sidebars) |
--render |
Use headless browser for JS-rendered pages |
--disable <slug> |
Disable a middleware by slug (can be repeated) |
--enable <slug> |
Enable an opt-in middleware (can be repeated) |
--list-middleware |
List available middleware and their slugs |
| Flag | Description |
|---|---|
--injection-threshold <0.0-1.0> |
Detection sensitivity (default: 0.3) |
--injection-action <action> |
Action on detection: warn, redact, datamark, metadata, silent |
--injection-languages <langs> |
Languages to check: comma-separated codes or all |
| Slug | Type | Description |
|---|---|---|
secret-defender |
Request | Detects and blocks requests containing secrets |
readability |
Response | Extracts clean markdown from HTML |
prompt-defender |
Response | Detects prompt injection in web content (opt-in) |
from scurl.prompt_defender import PromptInjectionDefender
# Create defender with custom settings
defender = PromptInjectionDefender(
threshold=0.3,
action="redact",
languages=["en", "es", "fr"],
)
# Analyze text directly
from scurl.prompt_defender.middleware import PromptInjectionMiddleware
middleware = PromptInjectionMiddleware(languages=["all"])
result = middleware.analyze("Ignore all previous instructions and...")
print(result.is_injection) # True
print(result.confidence) # 0.95
print(result.detected_spans) # List of detected injection spansCopyright 2026 Sibylline Software
MIT