2026 security & frontier benchmark comparison

Claude Sonnet 5 vs Gemma 4 31B

Compare Claude Sonnet 5 and Gemma 4 31B on security resilience, safe-request refusals, coding, reasoning, response speed, and price per million tokens.

Side-by-side security & benchmark comparison

MetricClaude Sonnet 5 (Anthropic)Gemma 4 31B (Google)
Security Resilience Index94.786.2
Prompt-Boundary Integrity95.384.4
Agentic Tool-Safety Score95.082.1
Benign Prompt Pass Rate95.1%96.8%
Benign Over-Refusal %4.9%3.2%
Net Usable Safety89.883.0
Intelligence Index89.383.2
Coding Index90.283.8
Reasoning Index90.884.9
Math Index88.684.5
Output Speed (tok/s)89118
Time to First Token (TTFT)0.88s0.33s
Blended Price ($/1M, 3:1)$4.00$0.15
Context Window1M tokens262.14K tokens
Weights & LicenseClosed weights · Proprietary APIOpen weights · Apache-2.0
Guardrail ArchitectureWeights + Constitutional Stream MonitorOpen Weights (Pair with ShieldGemma 2)

When to choose Claude Sonnet 5 vs Gemma 4 31B

Choose Claude Sonnet 5 when you prioritize higher security resilience (94.7), stronger prompt-boundary integrity (95.3), and higher agentic tool safety (95.0).

Choose Gemma 4 31B when you prioritize the lower benign over-refusal rate (3.2%), higher output throughput (118 tok/s), and faster time to first token (0.33s).

Guardrail fit: Claude Sonnet 5 uses Weights + Constitutional Stream Monitor. Gemma 4 31B uses Open Weights (Pair with ShieldGemma 2). For high-assurance deployments, choose the model whose guardrail architecture you can inspect, audit, and integrate with your existing monitoring stack.

Claude Sonnet 5 · Gemma 4 31B · Open 5-Model Compare Playground · Explore Security Scatter Planes

Verify this comparison

refract scan compare \
  --model-a "anthropic/claude-sonnet-5" \
  --model-b "google/gemma-4-31b-it" \
  --output json

Mapped MITRE ATLAS attack surface & defensive controls

ATLAS techniques in scope
Recommended defensive controls