Benchmark specification

Task Model, Contracts, Metrics

QuoteBench measures one narrow skill: composing a single correct bash -c payload when exact bytes must survive shell quoting, nested transport, and hostile filenames.

56frozen-core tasks
14 x 4scenarios by hostility tiers
3tool contracts: raw, JSON, wrapped
statevalidators check final state, not command text

What It Measures

QuoteBench tests whether LLM agents can compose one shell command whose only real difficulty is quoting. The underlying operations are deliberately ordinary: write a file, replace a string, count lines, rename files, pass argv, set environment variables, or commit an exact message.

The headline metric is the Quoting Gap: benign tier-0 pass rate minus hostile tier-1..3 pass rate within the same scenario. Because the operation is identical, the drop attributes failure to quoting rather than tool knowledge.

Task Anatomy

Scenario Matrix

ScenarioOperationHazard axis
write-fileCreate exact file contentQuote choice, dollar and backtick content
sed-replaceLiteral string replacementShell quoting plus sed escaping
grep-countCount exact-substring linesRegex-vs-literal, dollar expansion
field-lookupawk column lookup$1 shell-vs-awk collision
hostile-filenamesRename or delete one fileSpaces, glob-lookalikes, leading dashes
find-globList matching filesUnquoted patterns and cwd trap files
ssh-nestedCreate file through ssh-like wrapperDouble shell evaluation and client-side expansion
json-writeWrite JSON exact valueJSON escaping composed with shell quoting
git-commitCommit exact messageApostrophes, multiline messages, command substitution
env-passing / argv-passingPass exact env values or argv stringsAssignment quoting, word splitting, glob expansion
bulk-renamePrefix all matching filesLoop quoting with hostile names
heredoc-write / ssh-heredocCreate exact multiline filesDelimiter expansion, nested heredocs, delimiter collision

Tool Contracts

Under json and wrapped, controls can carry intrinsic transport difficulty. Contract deltas are therefore the clean comparison there; the attribution-clean Quoting Gap is the raw-contract one.

Validity Checks

  1. Oracle passes all 56 tasks.
  2. Naive command passes zero hostile raw tasks.
  3. Raw controls remain easy, so quoting is the measured difficulty.

Run python3 -m quotebench validate before trusting any number.