Back to benchmarks
Security BenchmarkVerified 45 days ago

Agent Security Audit Benchmark

Tested whether agents can find prompt injection vectors, unsafe tool permissions, and secret leakage in a deliberately vulnerable agent app.

Claude Code, OpenHands, Cursor, AiderClaude 4 Sonnet2026-06-12
Winner:Claude Code

Results dashboard

Overall score

Claude Code
86
Aider
78
Cursor
64
OpenHands
45

Time to complete

Claude Code
34
Aider
41
Cursor
38
OpenHands
52

Tokens used

Claude Code
98,000
Aider
72,000
Cursor
85,000
OpenHands
155,000

Approximate cost

Claude Code
$3.40
Aider
$1.95
Cursor
$2.90
OpenHands
$4.60

Results table

AgentScoreTimeCostPass
Claude Code8634m$3.40 Pass
Aider7841m$1.95 Pass
Cursor6438m$2.90 Fail
OpenHands4552m$4.60 Fail

The task

We built a small Express + LangChain agent with three deliberate vulnerabilities:

  1. Hardcoded API key in config.ts
  2. Overly broad file tool that could read .env and /etc/passwd
  3. Indirect prompt injection via a user-controlled document fed into the system prompt

Each agent was asked: "Audit this agent for security issues. List concrete findings with file paths and remediation steps."

Scoring rubric

Criterion Weight Max points
Finds hardcoded secret 25% 25
Identifies unsafe tool scope 25% 25
Finds prompt injection vector 25% 25
Remediation advice is actionable 15% 15
Speed 10% 10

Methodology

  • Same repo, same prompt, no hints.
  • Agents were allowed to read files and run static analysis commands.
  • Findings were scored manually against the known vulnerability list.

Key findings

  • Claude Code performed best on reasoning through indirect attack paths. It traced user input into the system prompt and flagged the risk.
  • Aider excelled at finding secrets and permission issues in code, but prompt injection is not its strength.
  • Cursor was fast and found obvious issues, but its audit was shallow — it missed runtime semantics.
  • OpenHands produced a long checklist with few specific citations. Volume does not equal accuracy.

Honest caveats

  • Three vulnerabilities is a small sample. A real audit covers many more attack surfaces.
  • None of the agents replaced a human security reviewer. They accelerated the first pass.
  • Results depend heavily on how the prompt frames "audit." A narrower prompt might have helped Cursor focus.

When to choose which

  • Claude Code: reasoning-heavy audits where tracing data flow matters.
  • Aider: code-centric reviews with strict diff control and secret scanning.
  • Cursor: quick triage of obvious security smells.
  • OpenHands: not recommended for security audits until it improves citation precision.