DeepSeek Harness goals and the Ralph loop

Published 16 August 2026

Most agent cost surprises are not about the price of a token. They are about how many times the agent decided to try again. DeepSeek Harness gives that behaviour a vocabulary, which is the first step to putting a number on it.

Turn, step, round

Three units, precisely separated in the project glossary:

UnitDefinitionCost meaning
StepOne model request plus the tool executions it producesThe billing atom
TurnOne drain of input, ending when the model stops or policy intervenesThe user-facing unit
RoundAn outer policy iteration, such as a goal round or a fresh-agent attemptThe multiplier above turns

Rounds are the layer that most homegrown cost models omit entirely. If your forecast counts requests, and your system runs rounds, your forecast is measuring the wrong thing.

Goals are durable objectives

A goal is a durable completion objective with an explicit phase — active, paused, blocked, or complete. Unlike a message, it persists across turns, so the agent carries a standing objective. Each continuation cycle admitted for that goal is a goal round, materialised as one goal-sourced turn.

Admission is gated by a goal activation: a process-local permission to admit another round, which is either armed or disarmed. That single bit is the throttle on open-ended work.

A standing objective plus automatic continuation is a spend authorisation with no upper bound. The documented requirement that goal creation and edits need direct human authorisation is precisely why: someone has to own the budget for open-ended work.

The Ralph loop is deliberate restart

The Ralph loop is a foreground workflow that iterates toward an immutable objective by starting fresh agent sessions, built on the harness's workflow and subagent primitives. A Ralph round is one fresh child session with no parent conversation seed. Continuity is carried by a Ralph handoff — described as a normalised, bounded, structured report containing status, summary, evidence, and blockers.

The economics here are genuinely interesting, and they cut both ways. Restarting clean means each round pays a small input cost instead of dragging an ever-growing conversation forward, so per-round cost stays flat rather than climbing. But nothing about a fresh start guarantees progress, and a loop that restarts cheaply can afford to restart many more times.

The bounded handoff is the control that makes the pattern viable: it is the only channel between rounds, so it caps context growth by construction. Watch two numbers — rounds per objective, and whether the handoff's blockers list is repeating. A blocker that appears in three consecutive handoffs is a loop that will not converge, and every further round is pure waste.

Commands are not tools

Worth separating, because it affects what you meter. A human command is a slash-prefixed instruction routed through the command plane for human-facing adapters — discovery, parsing, dispatch, cancellation, and rendering, owned by UI adapters. It is explicitly distinct from a model tool. The goal command is one of these.

Practically: a human typing a slash command is not the model spending tokens. Attribute the two separately or your per-session cost will blame the wrong actor.

Four controls for open-ended work

  1. A maximum round count per objective, enforced before admission rather than reviewed afterwards.
  2. A cumulative token budget spanning all rounds of one goal, not per round.
  3. Convergence detection on the handoff: repeated blockers stop the loop.
  4. Explicit human authorisation for goal creation, kept as the audit record of who authorised the spend.

Related


Want this applied to your own LLM spend? FinOps LLM runs a free audit of your AI costs and shows where the savings are. Book free audit →

Back to research

FAQ

What is a goal in DeepSeek Harness?

A goal is a durable completion objective attached to a session, with an explicit phase: active, paused, blocked, or complete. It survives across turns, so the agent has a standing objective rather than only the current message.

What is a goal round?

A goal round is one continuation cycle admitted for the current goal, materialised as a single goal-sourced turn. Whether another round can be admitted is controlled by a process-local goal activation that is either armed or disarmed.

What is the Ralph loop?

The Ralph loop is a foreground workflow that repeatedly starts fresh agent sessions against an immutable objective. Each Ralph round is a fresh child session with no parent conversation seed, and a bounded structured handoff carries status, summary, evidence, and blockers from one round to the next.

Why do goal loops matter for AI cost control?

Because a standing objective plus automatic continuation is an unbounded spend authorisation unless something disarms it. Goal creation and edits are documented as requiring direct human authorisation, which makes the human the budget owner for open-ended work.