What does the model do in an AI trading agent, and what does the harness do?
Updated Nov 13, 2026 · 9 min read
In an AI trading agent the model understands, routes, explains and asks; tested programs compute, and a runtime places and protects the orders. Where the line sits, and how Senpi draws it.
What does the model do in an AI trading agent? It handles the language. It works out what you want, picks the right program, explains what that program found and asks the next question. Everything with a number in it should come from code: scores, position sizes, stops and the orders themselves. Tested programs compute, and a deterministic runtime places and manages the trade. The model is one component. The harness around it, meaning the data, the programs, the runtime and the memory, is what you are trusting with your money.
Key takeaways
- The model talks, programs compute, the runtime trades. A language model is good at intent and explanation, and unreliable at numbers nobody checks.
- A harness is everything around the model: a data layer, skills (tested programs), a runtime that places and manages orders, and memory of the trader.
- The test: ask an agent for your Sharpe ratio over the last 90 days. If the model produced that number rather than a program, you are looking at a demo.
- On Senpi, no AI model makes live trading decisions by default. The runtime runs each strategy’s rules and exits without a model call; a strategy can add an optional model check that gates its entries.
What is a harness?
The word comes from coding tools. Cursor, Claude Code, Codex and Lovable are harnesses around a model: the model writes code, and the harness holds the repository, runs the tests, shows the model the output and keeps a person in control. Nobody describes Cursor as a prompt. A trading agent works the same way, with higher stakes and a tighter loop. Around the model sit four more parts:
- 01A data layer: the market and wallet data the agent reads. Senpi’s is Hyperfeed, built from every Hyperliquid trader’s activity.
- 02Skills: programs with tests that turn that data into answers, such as a score, a position size or a list of open risks.
- 03A runtime: the program that places orders, enforces limits and manages exits, with no model in the loop by default.
- 04Telemetry and memory: a record of every prompt, program run and trade, and of the trader the agent works for.
What the model should do, and what it shouldn’t
The model has four jobs, and today’s language models do them well:
- Understand what the trader wants, and ask when something is missing.
- Route the request to the right program.
- Narrate what the program found, in plain language.
- Ask the next useful question.
And four things it shouldn’t do, because each is a program’s job:
- Compute a score or a performance statistic.
- Put a dollar figure on a mistake.
- Size a position.
- Place an order, or decide an exit at 3am.
A quick test for any trading agent
Ask it for your Sharpe ratio over the last 90 days. A language model produces plausible numbers; a program produces the number. You can’t tell them apart by looking, which is why the line has to be drawn in the architecture, not in the prompt.
Who does what, step by step
| Step | The model | Programs and the runtime | The guard rail |
|---|---|---|---|
| Understand the request | Reads what you want and asks what’s missing | None | You approve the strategy’s rules before it can trade |
| Get the numbers | Routes the request to the right skill | The skill reads the data and computes scores, sizes and prices | Tested code: the same input gives the same output |
| Explain | Narrates the result and asks the next question | Hands over the figures exactly as computed | The skill’s rulebook: never invent a number or an address |
| Place the trade | None by default; a strategy can add a model check that gates entries | Checks the signal, removes duplicates, runs the risk gates, sizes and places the order | Cooldowns, leverage and free-margin limits, plus daily-loss and drawdown halts if set on the strategy |
| Protect and exit | None | Keeps a stop order on Hyperliquid and moves it up as the trade gains | A loss floor on the exchange from entry; the stop only moves up |
Skills: programs, not prompts
A skill is three things: a rulebook the model follows, a set of programs with tests, and reference material the model opens when it needs it. The model reads the rulebook, runs the program and relays the result; the program reads the data. Senpi’s 15 skills are open source on GitHub, and an update reaches every Senpi agent within about an hour of being merged, so a fix for one trader’s problem reaches everyone the same day.
Take Quant Desk, the skill behind Senpi’s Quant Score. You paste any Hyperliquid address. The program reads every fill in the wallet’s history, its open positions, two cohorts of traders (those with more than $1M of realized profit, and the best of the last 30 days) and recent trades across the market. It returns a read of the strategy with a critique, a score with six explained dimensions, a check of the protection on every open position, the trader’s leaks priced in dollars, and live setups where the market, the cohorts and the trader’s own pattern agree. The model’s rulebook for that skill includes:
- Print the header exactly as the program emits it.
- Never invent a number or an address, and never answer from memory.
- Relay the result in stages, not as one block, and hold a few points back for the follow-up.
Most of those rules exist because an agent once did the opposite, and each one is now a test. That is the difference between a prompt and a skill: a prompt is a hope, while a skill can be tested, replayed and reviewed. The same input gives the same output, a change is a pull request, and a mistake becomes a new rule.
The runtime: a trade is not a chat
When you approve a strategy and tell the agent to run it, the model’s part ends. A Senpi strategy is a package: a file that declares its scanners, its gates and its exit engine, plus a scanner that returns candidate trades. The runtime calls the scanner on a fixed interval, with no model call and no model cost. On every tick it:
- 01Checks each signal against the format the strategy declared.
- 02Records it before anything is sent, so a restart can never place the same trade twice.
- 03Runs the strategy’s gates: cooldowns, leverage, free margin and any daily-loss or drawdown halt.
- 04Sizes and places the order.
- 05Manages the exit, the step many trading agents hand back to a person.
The exit engine is Senpi’s dynamic stop-loss (DSL), a trailing stop in two phases. Phase one is defense: a loss floor placed as a stop order on Hyperliquid from entry, so a fast wick still closes the position. Phase two is profit lock: once the trade reaches its first gain tier, the stop is set to a share of the highest gain so far and kept on the exchange as a resting order that only moves up. The runtime documentation walks through an example:
| What happens | Gain on margin (ROE) | Stop on Hyperliquid |
|---|---|---|
| Long entered at $100 with 10x leverage | 0% | Loss floor from the strategy’s settings |
| First tier arms: lock 40% of the highest gain | +10% | $100.40 |
| The high climbs | +18% | $100.72 |
| Second tier arms at +20%: lock 70% of the highest gain | +22% | $101.54 |
| Price falls back to $101.54 | +15.4% | The exchange executes the stop and the position closes |
At no point was a model consulted or a token spent. Two more checks sit around it. A strategy can’t be funded until it has run one real tick with no wallet and recorded a pass, and the deploy step refuses otherwise. After a restart, the runtime matches its view of every position with the exchange before it will trade again. What all of this does between trades is the subject of what a trading agent does when it isn’t trading.
Why keep the model out of the order path?
| A model in the loop | A program in the loop | |
|---|---|---|
| Speed | Seconds per decision | Milliseconds |
| Repeatability | Two runs can give two answers | The same input gives the same output |
| Cost | A model bill on every tick | Close to nothing per tick |
| Audit | “Why did it sell?” has no exact answer | Every exit has a logged reason |
There is a bigger reason too. Models get better and cheaper every quarter, and every harness benefits equally. What separates one trading agent from another is the part the model can’t do for you: the data it reads, the programs it runs, the runtime that holds the position at 3am, and the memory of the person it works for.
Where you still talk to a model
In the conversation, all the time. You describe a strategy in plain English in the Senpi app, or from Claude, ChatGPT, Grok, Hermes or Muse through the Senpi connector. When you trade from one of those apps, the model passes your request to Senpi’s tools, and you choose Allow once or Deny before each trade is placed. Once a strategy runs, the runtime does the work and the model reports on it.
Frequently asked questions
Does the AI model place trades on Senpi?
Not by default. A strategy’s entries, stops and exits run in Senpi’s runtime without a model call; a strategy can add an optional model check that gates its entries. When you trade from Claude or ChatGPT, you approve each trade before Senpi places it.
What is a harness in an AI trading agent?
Everything around the model: the data layer it reads, the skills that compute answers, the runtime that places and manages orders, and the record of what happened. The model understands and explains; the harness does the work.
What is a skill in an AI agent?
A rulebook the model follows, programs with tests, and reference material. The model runs the program and relays its result, so the numbers come from code rather than from the model.
Can a language model calculate trading numbers reliably?
Not on its own. It produces plausible numbers, and you can’t tell them from real ones by looking. Scores, sizes and performance statistics should come from a tested program that the model calls.
What happens if the agent restarts in the middle of a trade?
On Senpi, signals are recorded before an order is sent, so a restart can’t place the same trade twice. The runtime matches its view of every position with the exchange before trading again, and the stop order keeps resting on Hyperliquid meanwhile.
Sources: Jason Goldberg, AI Trading Agents: The harness is the product (X, Oct 12, 2026), part two of a series; part one is AI Trading Agents: Data loops are the moat (X, Oct 9, 2026), and Senpi’s earlier post on how to build a moat in AI agent trading covers similar ground. Runtime behaviour, the DSL example and the skill count checked against Senpi’s open-source skills and runtime documentation on Nov 13, 2026.
See the split for yourself
Describe a strategy in plain English. Senpi’s agent shows you the rules to approve, and the runtime trades them 24/7.
Related articles
What does a trading agent do when it isn’t trading?
Most of a trading agent’s work happens between trades: refusing signals, re-checking open positions and moving stops one way. Senpi’s fleet telemetry from August 2026, and how often it checks today.
QuantConnect, Freqtrade, Hummingbot or an AI agent: which for crypto quant trading?
QuantConnect, NautilusTrader, Freqtrade, Hummingbot, CCXT, backtrader, vectorbt and an AI agent compared for crypto quants: Hyperliquid support, backtesting, live trading, languages and licences, checked Nov 13, 2026.
How to automate a crypto trading strategy without coding
Three no-code ways to automate a crypto strategy: bot presets, TradingView alerts sent to a bot, or an AI agent that writes and runs it. What each costs on Hyperliquid, with a walkthrough from Claude or ChatGPT.
Best AI trading agents and bots for Hyperliquid (2026)
Ten AI trading agents and bots on Hyperliquid, scored on 15 rows from their own docs on Nov 7, 2026: who writes the strategy, who runs it, what protects it.