atlas

Research map / Large language models / Agents, code and math

BaxBench: Can LLMs Generate Correct and Secure Backends?

ICML 2025 · Large language models › Agents, code and math · approach: Execution-based code verification · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces BaxBench, a benchmark of 392 backend-generation tasks (28 scenarios x 14 frameworks) that jointly tests functional correctness via test suites and security via expert-written end-to-end exploits, and evaluates 11 LLMs.

Problem

Existing code benchmarks test function-level or algorithmic code and rarely assess security jointly with correctness, leaving it unclear whether LLMs can generate correct and secure deployment-ready backend applications.

Approach

Framework-agnostic end-to-end backend scenarios specified in OpenAPI, combined with manually written functional tests and expert-written security exploits executed against the running app in Docker, yielding pass@k and secure pass@k metrics across many frameworks and languages.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use an OpenAPI specification instead of a plaintext promptOpenAI o3-mini · BaxBenchPass@1 correctness: +8.1%Helped
Use an OpenAPI specification instead of a plaintext promptGPT-4o · BaxBenchPass@1 correctness: +9.3%Helped
Use an OpenAPI specification instead of a plaintext promptClaude-3.5 Sonnet · BaxBenchPass@1 correctness: +6.8%Helped
Add OpenHands agent scaffoldingClaude-3.5 Sonnet · BaxBench, no security reminderPass@1 correctness: 53.6% -> 59.5%Helped
Add OpenHands agent scaffoldingClaude-3.5 Sonnet · BaxBench, no security reminderSecPass@1: 32.9% -> 31.8%Hurt
Add OpenHands agent scaffoldingClaude-3.5 Sonnet · BaxBench, generic security reminderPass@1 correctness: 45.5% -> 47.7%Helped
Add OpenHands agent scaffoldingClaude-3.5 Sonnet · BaxBench, generic security reminderSecPass@1: 34.5% -> 35.1%Helped
Add OpenHands agent scaffoldingClaude-3.5 Sonnet · BaxBench, oracle security reminderPass@1 correctness: 41.0% -> 45.9%Helped
Add OpenHands agent scaffoldingClaude-3.5 Sonnet · BaxBench, oracle security reminderSecPass@1: 35.4% -> 39.0%Helped
Use a generic security reminder instead of no security reminderReasoning models: OpenAI o1, OpenAI o3-mini, DeepSeek-R1 · BaxBenchSecPass@1Helped
Use a generic security reminder instead of no security reminderNon-reasoning models · BaxBenchSecPass@1No clear effect
Use an oracle security reminder instead of no security reminderModels evaluated with oracle security instructions · BaxBenchSecPass@1Helped

Surprising findings

Limitations

Experimental setup

Datasets: BaxBench scenarios (28 backend scenarios with functional tests and security exploits)

Benchmarks: BaxBench

Metrics: pass@k secure pass@k

Baselines: OpenAI o1 OpenAI o3-mini GPT-4o Claude-3.5 Sonnet DeepSeek-R1 DeepSeek-V3 Codestral Qwen2.5 Coder Llama-3.3 70B Qwen2.5 72B Qwen2.5 7B

Builds on: HumanEval pass@k OpenAPI

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy