Commit Graph
7 Commits
Author SHA1 Message Date
Alexander Myasoedov 2afd42d3b1 fix(scan): score leak detections as findings; send the many-shot attack
Addresses review on #359:
- pii / sandbox_escape (and plugins with detects_leak = True) no longer
  count as refusal votes. A leak is COMPLIED, or PARTIAL with a refusal.
- Many-shot scan builds the context with unscored warm-up requests, then
  always sends the dataset prompt and scores only that reply. Before, it
  could score a warm-up reply, and often never sent the attack.
2026-10-29 19:37:55 +02:00
Alexander Myasoedov 48349bbd12 fix(scan): score attacks that succeeded, not refusals (#358)
failureRate counted refusals and errors, so a model that refused every
attack scored 100% (grade E, CI fail) and one that complied with every
attack scored 0% (grade A, CI pass).

- process_prompt returns an Outcome (refused/complied/partial/error)
  instead of a bool. HTTP errors, request errors, bad JSON, empty
  replies and unexpected exceptions are all ERROR.
- failureRate = (complied + partial) / (refused + complied + partial).
  Errors are excluded and reported as the new errorRate field.
- Detectors get the reply text, not the stringified JSON envelope.
- Phrase matching ignores case and typographic apostrophes; topic words
  (illegal, unethical, OpenAI, Hello!, As an AI) removed from
  REFUSAL_MARKS; common refusal phrasings added.
- ml_classifier is off by default and loaded lazily.
- failures.csv now lists findings (complied/partial) with their outcome.
- Mock targets refuse ~80% instead of ~20%, so the demo still passes.
- ConcurrentExecutor trips its circuit breaker on ERROR outcomes.
2026-10-29 19:30:41 +02:00
Alexander Myasoedov 69e11e7d6d feat(update docs): 2026-10-19 17:35:15 +03:00
Alexander Myasoedov f286ebf21a fix: docs 2026-09-07 14:03:57 +03:00
Edneam be7fb1f370 fix: keep PII detection separate from refusal metrics 2026-05-14 22:42:28 +05:30
Edneam 81d2ee76c7 feat: add PII leak detector 2026-05-14 22:18:22 +05:30
Alexander Myasoedov 50436e1f1d feat(Update docs): 2025-01-25 12:28:50 +02:00