Quality assurance · Production

Improving Cursor's agent harness for OpenAI Codex models

The problem

Integrating new frontier AI models into Cursor's agent harness requires model-specific tuning because each model has different tendencies — such as preferring shell commands over tool calls, ignoring lint tooling without explicit instructions, and losing planning continuity when reasoning traces are dropped.

First attempt

Without tailored harness instructions, Codex fell back to inline Python scripts instead of tool calls, skipped lint checking, and suffered a 30% performance drop when reasoning traces were omitted. A token-conservation prompt accidentally reduced the model's willingness to perform ambitious tasks.

Workflow diagram · grounded in source
1
User submits coding request
trigger
“In Cursor's default agent mode, you want the agent to autonomously read and edit files based on the user request.”
2
Tool-based file operations
ai_action
“we made the names and definitions of tools in Cursor closer to their shell equivalents like rg (ripgrep)”
3
Reasoning summary generation
ai_action
“the Codex model family currently uses reasoning summaries to communicate user updates as it's working”
4
Lint checking after edits
validation
“After substantive edits, use the read_lints tool to check recently edited files for linter errors. If you've introduced any, fix them if you can easily figure out how.”
5
Reasoning trace forwarding
integration
“The Responses API is designed to capture and pass along these reasoning items (or encrypted reasoning items in sensitive contexts) so the model can maintain continuity across turns”
6
Autonomous code implementation
output
“assume the user wants you to make code changes or run tools to solve the user's problem. In these cases, it's bad to output your proposed solution in a message, you should go ahead and actually implement the change.”
Reported outcome

Cursor updated the agent harness with shell-equivalent tool naming, explicit lint instructions, reasoning trace preservation via alerting, and action-biasing prompts to improve Codex performance and reliability within the Cursor environment.

Reported metrics
performance drop without reasoning traces (GPT-5-Codex, Cursor Bench)30%
performance degradation without reasoning traces (GPT-5, SWE-bench)3%
Reported stack
CursorGPT-5.1-Codex-MaxCursor BenchESLintBiomergResponses APICloud AgentsCodex CLIread_lints
Source
https://cursor.com/blog/codex-model-harness
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

Cursor updated the agent harness with shell-equivalent tool naming, explicit lint instructions, reasoning trace preservation via alerting, and action-biasing prompts to improve Codex performance and reliability within…

What tools did this team use?

Cursor, GPT-5.1-Codex-Max, Cursor Bench, ESLint, Biome, rg, Responses API, Cloud Agents, Codex CLI, read_lints.

What results were reported?

performance drop without reasoning traces (GPT-5-Codex, Cursor Bench): 30%; performance degradation without reasoning traces (GPT-5, SWE-bench): 3% (source-reported, not independently verified).

What failed first in this deployment?

Without tailored harness instructions, Codex fell back to inline Python scripts instead of tool calls, skipped lint checking, and suffered a 30% performance drop when reasoning traces were omitted.

How is this quality assurance AI workflow structured?

User submits coding request → Tool-based file operations → Reasoning summary generation → Lint checking after edits → Reasoning trace forwarding → Autonomous code implementation.