Agent harness
How one agent run works — prompt, step loop, workspace, delegation, budgets and submission.
Every Clarity surface is one run of the same kernel under a roster profile. The kernel is small on purpose: the model decides what to read, and the harness keeps the run cheap, bounded and citable.
The prompt
The system prompt is fixed for the whole run, in this order:
The agent's individual instructions
Today's date
The surface: ids and dates only (portfolio, tickers, time range, language, thread)
Pinned skills
Skills index (name and when to use)
Deferred-tools index
Output boundary, surface-specific instructions and answer language
Older configuration versions keep their shared guidance and separate role brief. The admin editor combines those into the initial individual prompt when creating a new version.
Nothing is pushed into the prompt. Holdings, the investor profile, the house view, prior findings and memory are each one tool call away. The agent reads only what the question needs.
The step loop
Tool calls
One model call per step; tool calls in a step run in parallel. The run ends when the agent calls submit_answer.
Append-only trajectory
Earlier messages are never rewritten. The agent sees its own calls, the raw results and its own mistakes.
Workspace
A result over 4,000 characters is stored under a handle such as ws_3; the agent reads or greps it on demand.
Compaction
Near the per-step context ceiling, the oldest tool bodies are replaced with restorable pointers.
Plan
On conversational surfaces, a short plan stays in recent attention.
Skills and deferred tools
Loaded on demand from the indexes, appended at the end so earlier context is untouched.
Why caching matters
The kernel re-sends the whole run every step, about ten times the input tokens of a loop that rewrites its history. That is affordable only because the repeated prefix is billed as cached input at about a tenth of the price. A model route without cached-input pricing once raised a chat answer from $0.0083 to $1.09. Any model assigned to a Clarity agent must have a cached-input price.
Delegation
On the market update, company read and portfolio card, the lead can call delegate to start desk runs:
Several delegations in one step run concurrently.
A desk gets a mandate, optional acceptance checks, a narrowed tool set and its own budget. It can read and propose, never execute.
Desks share the lead's board and return a summary, findings with evidence ids and the raw cited evidence, which the lead can cite directly.
One failed desk never fails the batch.
A desk's deadline is at least two minutes and always leaves the lead a minute to write.
Budgets
Tool calls
Only calls that leave the process count: graph, market, analytics, news, web. Workspace, skills, plan, board, delegation and memory calls are free.
Allowance
Steps × 16 calls for a lead, × 8 for a desk. Calls beyond the allowance in a step fail with a budget error naming submit_answer.
Context
A profile's input budget is a per-step ceiling, not a cumulative allowance.
Forced write
In the last two steps, with 45 seconds left, or when the budget is spent, the run is forced onto submit_answer. A desk returns a partial finding instead of nothing.
A budget never kills a run.
Submission
submit_answer is the only way out of a run.
Citation repair. Aliases and unique typos resolve to their evidence; quoted spans that do not match evidence are dropped; unknown ids are removed. A citation is never attached because a number happens to match.
Acceptance. The surface's contract is checked, for example current company evidence on a company read.
One rejection. A failing first submission comes back with instructions. A second failing submission is accepted with a list of defects, which the surface handles (for example, by withholding publication).
Card submissions also carry an analyst-written headline and dated tests.
Trace
Every run streams its tool calls and results. Operator surfaces (admin chat, work runs) also stream the agent's identity, narration, per-step token and latency metrics, skill loads, plan updates, and events from each desk. The admin panel shows who did what in each run.
Last updated