Skip to content

About ClearPass

ClearPass is an automated security test for LLM applications, built by Tangeni Idhenga. It sends 19 attacks in 7 groups, covering 8 of the OWASP Top 10 for LLM Applications, to a target, scores each response, and produces an HTML report, a SARIF file for CI, and a comparison with the previous run.

How a result is decided

  1. Rules check the response for direct evidence: a canary token, a credential pattern, a dangerous tool call, or a refusal.
  2. If the rules find neither success nor refusal, an LLM judge reads the attack and the response, then decides and gives a reason.
  3. If a request fails or the judge can't tell, the attack is unsure.
  4. A run fails on any confirmed high or critical issue. Otherwise it needs a result for every probe to pass.

What's in the project

PartBuilt withPurpose
Engine and CLIPython, Pydantic, Typer, Jinja2Runs the attacks, scores results, writes reports and SARIF
Attack libraryYAMLEach probe is data, mapped to OWASP, the EU AI Act and the NIST AI RMF
Platform APIFastAPI, SQLAlchemy, JWTAccounts, targets, encrypted API keys, background runs
This siteNext.js, TypeScript, Tailwind CSSSaved results and the in-browser detector

Problems worked through

Stored XSS in the report
Adding a Content-Security-Policy to this site caused script errors on a generated report. Attack payloads were rendering as live HTML: Jinja2 chooses autoescaping by file extension, and report.html.j2 ends in .j2. Reports now always escape, carry their own CSP, and have a regression test.
False passes
An invalid API key made every probe error, errors deducted nothing, and the run scored 100/100. Errors now produce an unsure result, a run with unsure probes can't pass, and a re-test that errors is no longer counted as a fix.
Prompt injection against the judge
The response being judged is untrusted and could tell the judge what to say. Each call uses a random token and fenced input, and any output without the token counts as unsure.
Free-tier limits
A full run is more than the Gemini free tier's 20 requests a day per model. The adapter retries per-minute limits, stops immediately on a daily limit, and reports the remaining probes as unsure.

Why this site has no backend

A public form that accepts any URL could be used to attack other people's systems, and a shared API key would run out within a few visits. So this site serves saved results, and the detector runs in your browser. The API and login app are in the repository for anyone who wants to run live tests.

Limits

  • The suite is a fixed set of attacks, so a pass doesn't prove a system is secure.
  • Regex rules only catch what they describe. The judge covers some of the gap, but it's a model and can be wrong.
  • Rule accuracy has only been measured on 35 labelled responses.