Build

The AI coding agent

The Strategy Builder turns an idea into a first draft. The AI coding agent is the other half: an in-editor assistant for changing code you already have. Ask it for a change in plain English and it reads your workspace, proposes an edit, runs the checks, and shows every step as it goes — and, just like the builder, it applies nothing until you accept.

Where it lives

The agent is a panel inside the workspace IDE, alongside the Strategy Builder and the snapshot history in the right rail. Where the AI Strategy Builder is a guided four-stage flow for creating a strategy from scratch, the coding agent is a free-form, conversational way to edit an existing one: add a guard, tighten a filter, refactor a helper, fix something the Problems panel flagged.

The read → propose → check loop

Type what you want and press Run agent (or ⌘/Ctrl + Enter). The agent then works in visible turns, and the transcript renders each one as it streams:

  1. Reasoning. A short note on what it intends to do next.
  2. Tool calls. The concrete actions — List files, Read file, Propose edit, Run checks — each shown with a tick or a cross so you can see exactly what it looked at and what it did.
  3. A proposed edit, shown as a diff. When the agent changes code it stages a draft proposal and opens the first changed file as a side-by-side diff in the editor area — the panel is deliberately small, so real review happens in the full-width diff.
  4. Checks. The agent runs the fast verification pass over its own proposal — compile, import policy, and the strategy SDK contract — and reports Checks passed or Checks failed with the specific findings. It can iterate to fix its own findings before handing the change to you.

A worked request

“Add a maximum-daily-loss guard that flattens the position and stops trading for the session.” The agent reads risk.py and exits.py, proposes the guard plus a test that exercises it, runs the checks, and presents the diff. You review it and decide.

Nothing is applied until you accept

Everything the agent produces is an inert draft. It cannot write to your files, and it cannot run your strategy on data. Applying a change is always your deliberate action — and, exactly as in the Strategy Builder, production code and tests are accepted separately:

  • Accept production — applies only the strategy files.
  • Accept tests — applies only the test files.
  • Reject — discards the whole proposal, changing nothing.

The two-accept split exists for the same reason it does in the builder: the tests are the leash on the code. A strategy cannot run until its required tests pass, so the app never lets a single click rewrite the code and the tests that are supposed to catch its mistakes. Give the test diff the same scrutiny as the production diff — ask whether those tests would still catch the failure modes you care about. See Testing your strategy for why the suite matters.

The agent's output is text, not commands

The model's replies are treated as untrusted data: rendered as reasoning and diffs, never executed. If a proposal would touch tests, or if the request text looks like it is trying to instruct the app rather than describe a change, the panel says so before you accept. You are always the one who runs code — later, through tests and runs.

Choosing the model

Generation runs on your own AI key. A Model switcher sits right in the builder header so you can change which model your key uses without leaving the workspace — pick a faster model for quick edits, a stronger one for gnarly refactors. The choice is saved on the connection itself (the same secure store the connections manager writes), so it survives reloads and applies everywhere that key is used.

  • With more than one key configured, the switcher also lets you pick which key to use; the model list is derived from that provider — its default model plus any overrides you have set. Nothing is hardcoded.
  • With no key configured, there is nothing to switch, so the control says so and links you to Settings → AI keys & connections to add one.

AI-builder and agent usage is metered like other compute — see Data & credits.

Where to go next