13. LLM apps and agents: LLM Assure¶
If your product includes a chatbot, a RAG assistant or an agent, it has a new class of failure: it can be talked into leaking its system prompt, revealing customer data, taking actions it shouldn't, or saying things your company would never say. LLM Assure red-teams it before your users do.
Only test systems you own or are authorised to assess. A passing score is one input to a security review, not a certificate.
Suites¶
41 probes in 8 suites, mapped to the OWASP Top 10 for LLM Applications (2025):
| Suite | OWASP LLM 2025 | Probes |
|---|---|---|
prompt_injection |
LLM01 Prompt Injection | 8 |
system_prompt_leakage |
LLM07 System Prompt Leakage | 6 |
sensitive_information |
LLM02 Sensitive Information Disclosure | 5 |
jailbreak_policy |
LLM01 (jailbreak) | 5 |
excessive_agency |
LLM06 Excessive Agency | 4 |
misinformation |
LLM09 Misinformation | 4 |
improper_output_handling |
LLM05 Improper Output Handling | 4 |
scope_control |
Business risk | 5 |
Deterministic first. Canary-leak, PII/secret, refusal and pattern detectors are free and reproducible. An optional Claude judge handles the nuanced cases ("did the bot imply it issued a refund?"). The judge treats the transcript as untrusted data, so it resists injection aimed at the judge itself, and it is only called when the deterministic detectors haven't already found a failure. Without the judge, judge-only probes are marked needs review, never silently passed.
Point it at your app¶
name: My Support Assistant
type: http # http | openai | anthropic | python
url: https://api.example.com/chat
headers:
Authorization: "Bearer ${BOT_API_TOKEN}"
request_template:
message: "{{prompt}}"
history: "{{history}}"
response_path: reply # e.g. data.answer or choices.0.message.content
context:
company: Acme Corp
purpose: customer support for Acme Corp's online store
canary: K11-CANARY-REPLACE-ME # put this exact string in your system prompt
forbidden_topics: [politics, religion]
Use a canary. Put a unique string in your system prompt and set context.canary to it. The toolkit then detects system-prompt
leaks even when they are reversed, spaced out or base64-encoded.
Run it¶
llm-assure run -t target.yaml --tag baseline # quick 15-probe smoke scan
llm-assure run -t target.yaml -s prompt_injection -s excessive_agency
llm-assure run -t target.yaml --judge # with the Claude judge (ANTHROPIC_API_KEY)
Each run writes a self-contained HTML report (score, findings, evidence, remediation), assessment.json, junit.xml and
summary.md. The toolkit's own demo shows the difference remediation makes:
| Deliberately vulnerable bot | The same bot, hardened | |
|---|---|---|
| Assurance score | 0 / 100 (F) | 99 / 100 (A) |
| Critical findings | 6 | 0 |
| High findings | 13 | 0 |
Red-teaming with Claude¶
The MCP server (/plugin install llm-assure@k11-llm-assure, with /red-team and /assurance-report) lets Claude run assessments
and then go beyond the static suite:
| Tool | What it does |
|---|---|
list_suites, list_probes |
browse attack categories and probes |
run_assessment |
run a full audit and write all reports |
send_probe |
send a custom prompt (with history) and get leak, PII and refusal checks: for adaptive, multi-turn attacks |
get_findings |
read findings from an earlier assessment.json |
Try: "Run a baseline assessment against my target, then use send_probe to find a prompt-injection variant the suite missed."
llm-assure adaptive goes further: a Claude attacker agent with a fixed query budget attacks the target on its own, adapts to each reply,
and records every distinct vulnerability. It is also the harness for the K11 adaptive-versus-static study.
In CI¶
- run: pip install "k11-llm-assure-mcp[judge]"
- run: llm-assure run -t llm-target.yaml --fail-on none -o llm-assure-report
env:
BOT_API_TOKEN: ${{ secrets.BOT_API_TOKEN }}
- uses: actions/upload-artifact@v4
if: always()
with: { name: llm-assurance-report, path: llm-assure-report }
--fail-on critical|high|medium|low|none sets the exit code (default high); use none when the release gate decides.
Write the output to llm-assure-report/, one of the two places Release Gate looks.
Evidence for the gate¶
assessment.json is the llm kind.
| Rule | Outcome |
|---|---|
llm.critical, llm.high |
block |
llm.medium |
condition: plan a fix |
llm.low |
note |
llm.inconclusive |
needs a person: probes that need review or errored |
Changes to prompts (**/prompts/**, *.prompt, *prompt*.md), and to llm/, agents/, rag/, guardrails/ and chatbot/ code,
require LLM evidence.