Source note
Agent trajectories as programs: fingerprinting and programming coding-agent behavior
Summary
The paper argues that coding agents can be identified and programmed through their action traces, not just scored by task success. It introduces ProcGrep, a library for building procedural fingerprints, comparing agents, and searching past agent trajectories.
Problem
- Benchmark scores show whether an agent solved a task, but they do not show how the agent searched, edited, tested, or failed.
- Developers need trace-level tools for model routing, monitoring, cost analysis, and debugging as coding agents take more of the software workflow.
- Natural-language plans and rationales are weak evidence for action: the paper reports low precision for several model accounts, including Claude-4 precision of 0.500 and Claude-3.7-thinking precision of 0.625.
Approach
- The method turns agent trajectories into sequences of procedural actions such as
read_file,search_repo,edit,run_test, andsubmit. - It parses solution patches with ASTs, adds code context and model-written behavior descriptions, then induces a shared action vocabulary from recurring action subsequences.
- The main vocabulary induction method is BPE over action traces. The paper chooses
K=192after a V-measure sweep, with a reported peak of0.644and a plateau acrossK=128toK=256. - It compares agents with entropy, compression ratio, action-transition statistics, nearest-neighbor retrieval, and Jensen-Shannon divergence over procedural distributions.
- ProcGrep lets users write deterministic structural queries over traces, including ordered actions, counts, conditions, and missing actions.
Results
- On SWE-bench Verified traces from 10 agents across GPT, Claude, DeepSeek, Qwen-derived, SWE-agent, Agentless, DARS, and Moatless setups, procedural fingerprints attribute an unseen trajectory to the correct agent with
85.7%accuracy versus an11.1%random baseline. - Distinct action transitions identify agents: DARS+R1 overuses
search_repo → create_fileby31.6×, Moatless+V3 overusesedit → submitby15.7×, and Agentless+Claude-3.5 overusesrun_test → run_testby12.5×. - ProcGrep reaches
F1=1.000with1.1 µslatency per decision on episodic trace search. LLM judges are lower: Claude Sonnet 4.6 getsF1=0.278at1.71 s, GPT-4o getsF1=0.230at0.66 s, and DeepSeek-chat getsF1=0.093at1.51 s. - Teacher-student procedural similarity is measurable: the Claude-3.7-thinking to SWE-agent-LM-32B distilled pair has
JSD=0.250, compared with0.518within model family across generations and0.533for the same model across scaffolds. - Procedural representations predict success better than natural-language accounts in nearest-neighbor tests: structural pattern overlap gets
F1=0.347, action sequence distance getsF1=0.274, narrative description getsF1=0.177, and random retrieval ranges from0.13to0.24. - Cost and behavior differ by agent: Claude-4 resolves
59.0%of tasks at$2.02per resolved task, Claude-3.7-thinking resolves50.7%at$1.53, GPT-4 resolves18.0%at$13.93, and Moatless+DeepSeek-V3 resolves30.7%at$0.06.