Skip to main content
CascadeShield scans content for prompt injection in the background. Fire-and-forget — adds zero latency. Works standalone; no init_tracing required.

Initialize

Uses CASCADE_API_KEY and CASCADE_ENDPOINT by default. Or pass explicitly:

detect()

Examples:
If the backend is unreachable, detection fails silently — it never blocks your app.

Copy-paste example

Run this script to test CascadeShield with structured data. Detected injections will appear in your Security Logs.
Set CASCADE_API_KEY in your environment (or .env) before running. Check the Security Logs page in your Cascade dashboard to see which items were flagged.

Viewing detected attacks

Detected injections appear on the Security Logs page in your Cascade dashboard. Each event includes score, matched patterns, heuristic flags, model reasoning, source, metadata, and latency. Benign content is not persisted.
Security Logs page showing detected prompt injection events with scores, patterns, and metadata

Tuning detection

Configure detection from the Security Config page in your dashboard. Adjust detection weights (regex, heuristic, model), threshold, strength per vector, custom regex patterns, disabled built-ins, and heuristic overrides. You can run backtests against your historical Security Logs to see how different settings would have performed on past events. Compare before and after: tune your weights or threshold, re-run the backtest, and measure how detection accuracy changes. This lets you validate improvements before rolling them out to production and track how your system gets better over time.
Security Config page showing detection weights, threshold, and pattern customization options