Skip to lesson
Exit
Deep Dive: RL for Coding Agents1 / 2

2 min lesson

Environment fidelity is the quiet lever

Answer "Why does Cursor train Composer's RL in realistic sessions with the same tools and harness the deployed model uses, rather than a simplified training environment?" Use one lesson detail to support it.

Step 1 of 2

Environment fidelity is the quiet lever

Cursor has said Composer 2Cursor's in-house agentic coding model: frontier-level coding quality at high speed and low cost, built as a software-engineering specialist rather than a general-purpose model. Press Enter for the full definition. trains RL in realistic Cursor sessions, using the same tools and harness the deployed model will use in production. That choice matters more than it looks.

  1. 1Same tools. The agent trains with the exact file-read, search, edit and terminal tools it ships with - no train/serve mismatch in the action space.
  2. 2Same harness. Episodes run in the real session loop, so the distribution of states the policy sees in training matches deployment.
  3. 3Real graded outcomes. Rollouts run in sandboxes and are scored on real execution, so the reward reflects what the model actually does to a codebase.
  4. 4Closes the offline-online gap. A policy optimized in a faithful environment transfers; one trained in a toy harness learns to exploit the toy.
Exploration vs exploitation, in coding terms

Episode length couples directly to variance and compute. Long episodes let the agent discover multi-step solutions it could never stumble into greedily, but they cost more, vary more and dilute credit. The research judgment is choosing horizon and sampling temperature so the agent explores enough to find non-obvious fixes without burning the compute budget on noisy, low-information rollouts.

Interview move

If asked "how would you assign credit when reward only comes at the end of a 50-step coding episode," don't jump to process rewards. Lead with the honest default - a trajectory-level advantage, GRPO-style - name the variance and compute costs of long horizons, then offer process rewards, value bootstrapping and a horizon curriculum as levers, each with the hacking or fitting risk it introduces. The nuance is what reads as production experience.