Benchmark: SafeRun vs Bandit

A small, advisory comparison on harmless simulated samples that are never executed. Held-out split of the second sample set: 32 bad and 12 clean code samples.

Not an independent evaluation. SafeRun is behind Bandit on catches; the new rules help it, but do not close the gap.

Catches, loose

any finding, among 32 bad samples

SafeRun, unchanged rules9/32
SafeRun, new rules14/32
Bandit17/32

Catches, strict

SafeRun: FAIL verdict; Bandit: medium or high finding

SafeRun, unchanged rules7/32
SafeRun, new rules7/32
Bandit14/32

False alarms, loose

any finding, among 12 clean samples (lower is better)

SafeRun, unchanged rules0/12
SafeRun, new rules0/12
Bandit2/12

By category (loose, flagged / total)

CategorySafeRun, unchangedSafeRun, new rulesBandit
Sensitive file read0/42/40/4
Evasion variant1/43/41/4
Persistence0/41/41/4
Exfiltration0/40/42/4
Destructive0/40/41/4
Weak practice1/41/44/4
Hardcoded secret1/21/22/2
Dangerous calls2/22/22/2
Obfuscated payload2/22/22/2
Unsafe deserialization2/22/22/2

The three new rules cover credential-file reads, persistence setup and hidden function lookups. Five held-out samples were gained and none was lost. Dependency checks: SafeRun and pip-audit tie at 8/8 on the first set.

Limits

  • SafeRun is still behind Bandit: 14/32 vs 17/32 loose and 7/32 vs 14/32 strict. It flagged none of the exfiltration or destructive samples.
  • Strict catches did not change: the three new rules are medium severity, so they add findings and a WARNING, not a FAIL verdict.
  • The samples are few, simulated and written by the SafeRun authors, who already knew where the first set was missed. This is not an independent evaluation and not a claim about real-world malware.
  • Bandit looks for insecure coding practice; SafeRun is aimed at code you are about to run but do not trust. A lower score for one tool is not a verdict on the other.
  • The rules were written against the dev samples only. The held-out samples were run once and must not be used to change rules any more.
  • Only the scan is measured, not the sandbox. A PASS is not proof of safety.

Full report, method and every miss: docs/benchmark.md.