Everything you need to know about Shield LLM — attack methodology, scoring, scan presets, and more.
Shield LLM grades your chatbot's defenses against real-world attacks, right from your terminal. You'll need an account and an API key; grab the key from your dashboard under Settings. Prefer to stay hands-off? Ask the coding agent you already use to run these steps for you.
Scan chatbot APIs directly from the command line: REST endpoints, SSE streaming, custom HTTP shapes. The CLI is a thin client. Authentication, the attack catalogue, judging and scoring all live on the backend. New attacks reach existing CI installations on the next scan, with no upgrade.
npm install -g shield-llm # Or use without installing: npx shield-llm scan --help
# 1. Authenticate against your instance shield-llm login --key sk_shield_xxx --api-url https://shield.your-corp.com # 2. Generate a config for your chatbot shield-llm init # 3. Run a scan shield-llm scan -c shield.config.json # 4. (CI mode) JSON to stdout, status to stderr, exit-code policy shield-llm scan -c shield.config.json --ci --min-score 75
| Command | Description |
|---|---|
| shield-llm login --key '<'sk_shield_...'>' --api-url '<'url'>' | Authenticate against your Shield instance. --api-url is required: there is no default backend. |
| shield-llm init | Interactive wizard. Generates a shield.config.json for an HTTP chatbot endpoint (URL, method, auth, body template, response field, preset). |
| shield-llm test-connection [-c '<'path'>'] | Send one benign message through the configured endpoint and print the reply. Confirms the URL, encoding, auth and response field before a real scan. |
| shield-llm scan [options] | Run a security scan. Pulls the attack catalogue from the backend and routes responses through the server-side judge. |
| shield-llm probe-carriers [--ci] | Check whether invisible-Unicode carriers (zero-width, tag characters, private-use area, soft hyphen, variation selectors) survive your input pipeline and reach the model. Transport diagnostic: no attacks, no judge, no upload. |
| shield-llm retest '<'scanId'>' [--finding '<'id'>'] [--ci] | Replay the exact exploits of a past scan's findings after you ship a fix. Each finding is stamped Fixed & verified or Still vulnerable on the dashboard. Exit 0 = all fixed, 1 = still vulnerable. |
| shield-llm fix --report '<'path'>' [--explain] [--dry-run] [--verify] | Patch findings from a scan report using declarative remediation recipes. Writes marker-delimited blocks into your own working tree and never pushes. |
| shield-llm verify-claims [--ci] | Replay the attack family of every pending remediation claim and close it, or refuse to. Run it from your deploy job, right after deploying. |
| shield-llm report '<'scanId'>' [--output json|markdown] | Fetch a stored scan report from the dashboard for audit trails, Slack post-mortems, or CI artifacts. |
| shield-llm validate [-c '<'path'>'] | Validate a shield.config.json without sending any traffic. |
| shield-llm tests [--remote] | List custom tests from the local config and/or your dashboard. |
| shield-llm attacks [--severity '<'level'>'] | Show the attack catalogue summary (counts by severity; the live catalogue is fetched from the backend). |
| shield-llm presets | List the available scan presets (fetched from the backend). |
| shield-llm benchmark '<'subcommand'>' | Cohort benchmarking: record consent, submit a scan, and read your relative position. Consent is an append-only ledger and cohorts enforce a k-anonymity threshold. |
| shield-llm logout | Remove stored credentials from ~/.shield-llm/credentials.json. |
| Flag | Description |
|---|---|
| -c, --config <path> | Path to shield.config.json (default: ./shield.config.json) |
| -e, --endpoint <url> | Target chatbot HTTP endpoint URL (overrides config) |
| --auth <type> | Auth type: none, bearer, api-key, oauth2 |
| --token <value> | Bearer token or API key value (use $ENV_VAR for secrets) |
| --auth-header <name> | Custom auth header name (default: X-API-Key) |
| --response-field <path> | Dot-notation path to response text (e.g. response, choices[0].message.content) |
| --request-body <json> | JSON body template with {{prompt}} placeholder |
| --preset <name> | Scan preset: dev, quick, owasp, frontier, standard, full |
| --system-prompt <text> | System prompt to prepend before each attack |
| --system-prompt-file <path> | Path to a file containing the system prompt |
| --crescendo | Include multi-turn escalation (Crescendo) attacks |
| --load-custom-tests | Fetch active custom tests from the dashboard |
| --eu-ai-act | Show EU AI Act compliance assessment after the scan |
| --compliance-threshold <n> | Fail if compliance score is below n (0–100) |
| --min-score <n> | Minimum score threshold (0–100) |
| --fail-on-critical | Fail if any CRITICAL vulnerability is found |
| --ci | CI mode: JSON to stdout, status logs to stderr, no spinner |
| -o, --output <format> | Output format: json, markdown, sarif, pdf |
| --output-file <path> | Write the report to a file instead of stdout |
| --no-progress | Suppress the progress spinner |
| --api-url <url> | Backend API URL override (defaults to the URL stored at login) |
Create a shield.config.json in your project root. The CLI auto-discovers it, or pass -c path explicitly.
Your chatbot has a POST endpoint that takes a message and returns a response.
{
"endpoint": {
"url": "https://api.mycompany.com/chatbot",
"request": {
"body": { "message": "{{prompt}}" }
},
"response": {
"field": "response"
}
}
}{{prompt}} — replaced with the attack payload. {{history}} — the conversation turns so far, for stateless multi-turn. As an item of a message array it expands in place, before the current turn; set historyFormat to gemini for Gemini / Vertex AI.
$ENV_VAR syntax resolves values from environment variables (e.g., tokens, secrets).
Each scan walks through four steps. The CLI never holds an LLM key, never decides what is vulnerable, and never bundles the attack catalogue: the backend is the single source of truth.
| Format | Description |
|---|---|
| json | Full scan report with thresholds. Default format. |
| markdown | Human-readable table report for documentation. |
| sarif | GitHub Security tab integration. Maps vulnerabilities to SARIF results. |
| Printable report with OWASP breakdown and remediation advice. |
Exit codes: 0 passed · 1 threshold violation · 2 config or auth error · 3 runtime or network error. Use --ci to send JSON to stdout and status logs to stderr so CI logs stay parseable.
GitHub Action example:
- uses: ./.github/actions/shield-llm-scan
with:
api-key: ${{ secrets.SHIELD_LLM_API_KEY }}
api-url: ${{ vars.SHIELD_LLM_API_URL }}
config: shield.config.json
preset: owasp
min-score: 75
fail-on-critical: true
output-format: sarifA scanner that only emits findings leaves you with a report and a backlog. Two commands close the loop: fix patches findings from declarative recipes, and verify-claims replays the original exploit after you deploy. A finding therefore closes on evidence rather than because someone ticked a box.
# 1. Scan, keeping the machine-readable report shield-llm scan --preset standard --write-json shield-report.json # 2. See which recipes apply, and which anchors would unlock the rest shield-llm fix --report shield-report.json --explain # 3. Apply. Writes marker-delimited blocks into your own working tree. shield-llm fix --report shield-report.json # 4. After your deploy, replay the original exploits and close the claims shield-llm verify-claims
Five recipes ship today, each bound to one finding type. Every other finding falls back to the written remediation in the report. All five are flagged for human review: nothing auto-merges.
| Recipe | Closes | Needs anchor |
|---|---|---|
| system-prompt-nondisclosure@1 | SYSTEM_PROMPT_LEAK | system_prompt |
| instruction-precedence@1 | INSTRUCTION_OVERRIDE | system_prompt |
| user-content-delimiting@1 | DELIMITER_INJECTION | system_prompt |
| output-html-escape@1 | XSS_OUTPUT | output_render |
| output-secret-redaction@1 | SENSITIVE_DATA_EXTRACTION | output_render |
fix reads a codebase block in shield.config.json, which a scan never reads. An anchor you have not declared is a soft skip: the recipe does not run and the output names the exact config key to add. An anchor pointing at a file or export that does not exist is a hard error, because a stale config fakes coverage.
{
"codebase": {
"root": ".",
"language": "ts",
"anchors": {
"system_prompt": { "file": "src/prompt.ts", "export": "SYSTEM_PROMPT" },
"output_render": { "file": "src/render.ts", "export": "renderReply" }
},
"redeploy": {
"command": "pnpm build && pnpm deploy:staging",
"timeoutMs": 300000,
"healthTimeoutMs": 60000
}
}
}fix --verify redeploys your target with codebase.redeploy, then replays each finding's design attacks plus a holdout attack that the harness draws. The recipe does not choose its own holdout, so it cannot be authored to pass. A benign suite runs alongside, so a patch that closes the exploit by breaking the assistant is caught rather than shipped.
Shield exposes its red-teaming to AI coding agents (Claude Code, Cursor, and any MCP client) through a Model Context Protocol server. An agent can scan the chatbot it is building, read the fixes, and re-prove them without leaving the editor.
| Tool | What it does |
|---|---|
shield_init_config | Generate and validate a scan config by reading your app's chat route (JSON, form, or multipart bodies). |
shield_scan | Red-team the endpoint and return score, grade, and findings, optionally with an EU AI Act compliance readout. |
shield_get_findings | Read each finding with a layered, defense-in-depth remediation recipe. |
shield_verify | Replay the exact exploits and prove the fix held. |
shield_scan_diff | Compare two scans to catch any new vulnerability a fix may have introduced. |
npm install -g shield-llm-mcp # or run without installing (your MCP client can use npx): npx shield-llm-mcp
{
"mcpServers": {
"shield-llm": { "command": "shield-llm-mcp" }
}
}Shield LLM runs from your environment, testing chatbots through their HTTP endpoint — no SDK or code changes required.
Install the Shield LLM CLI and point it at your chatbot endpoint.
Shield LLM sends attack prompts to the chatbot endpoint and captures responses in real-time.
Get a detailed security report with severity ratings, OWASP mappings, and remediation advice.
Shield LLM's test suite is mapped to the OWASP LLM Top 10, the industry standard for AI/LLM security risks.
Manipulation of LLMs through crafted prompts, causing unintended actions. This includes direct injections that override system prompts and indirect injections embedded in external content.
LLMs may reveal confidential data in responses, including PII, system internals, proprietary algorithms, training data, or other sensitive information.
LLM-based systems may undertake actions leading to unintended consequences. The issue arises from granting too much functionality, permissions, or autonomy.
Risks from compromised third-party models, training data, or components such as those from model registries and external data sources.
Tampered training data can impair LLM models, leading to responses that compromise security, accuracy, or ethical behavior.
Overloading LLMs with resource-heavy operations can cause service disruptions, increased costs, and denial of service.
LLMs can produce false or misleading information that appears credible, including hallucinations and biased outputs. Overreliance without verification amplifies this risk.
Unauthorized extraction, inference, or reconstruction of hidden operational context — system prompt, tool and function schemas, policy logic, roles, or output formatting rules — that materially increases attacker capability.
Vulnerabilities in RAG systems and embedding-based methods that can be exploited to inject harmful content, manipulate outputs, or access sensitive information.
Occurs when LLM output is accepted without scrutiny, exposing backend systems. Can lead to XSS, CSRF, SSRF, privilege escalation, or remote code execution.
Your chatbot gets a score from 0 to 100 and a letter grade from A to F, like a report card. Higher is safer. Each vulnerability subtracts from a perfect score, weighted by how serious it is, so one critical hole costs far more than a minor finding.
| Severity | Weight | Examples |
|---|---|---|
| CRITICAL | 10 | System prompt leaks, indirect injection, sensitive data extraction |
| CRESCENDO | 7 | Multi-turn escalation attacks that build trust before exploiting |
| COMBO | 6 | Multi-technique attacks combining multiple bypass methods |
| HIGH | 5 | Jailbreaks, encoding bypasses, social engineering recon |
| MEDIUM | 2 | False authority, legal/financial advice, capability probing |
| LOW | 1 | Minor information disclosure, low-impact findings |
Choose a scan preset based on your needs. Each preset runs a curated set of attacks optimized for different use cases.
Fast feedback loop for development. Tests jailbreak, system prompt leak, and roleplay jailbreak.
Rapid assessment covering top critical and high-severity attacks. Good for routine checks.
One representative test per OWASP LLM Top 10 category. Ideal for compliance checks.
Modern post-2025 attack vectors that need no harness. Use it when your chatbot is exposed to current techniques rather than textbook ones.
Comprehensive OWASP coverage. Recommended for production chatbots.
The full attack catalogue plus multi-turn (crescendo / memory) attacks. Maximum coverage for critical assessments.
Define your own security test scenarios tailored to your chatbot's specific use case and compliance requirements.
Ready to secure your AI chatbot?
Get Started