Can we trust the broker sandbox before switching on the live agent? Only for the parts it actually simulates. A sandbox can confirm that credentials work, requests parse and an order moves through the API. It usually cannot prove what price the order will get, whether it will fill, or how the live system behaves when a request times out.
That gap is not necessarily deliberate deception. A sandbox is built to make integration predictable, not to reproduce every venue, risk check and market condition. The word lie describes the effect: a green test can create confidence about behaviour the sandbox never represented.
What the sandbox actually proves
Start by separating interface checks from execution checks. Interface checks cover authentication, request fields, symbol formatting, order acknowledgements, account queries and the sequence of order states.
These are useful. A test that catches a malformed quantity or a mistaken status transition can prevent an avoidable production failure.
But a sandbox order marked filled may be a simulated response, not a match against a live order book. Prices may come from delayed or simplified data. The engine might fill every marketable order at the quoted price, ignore queue position, or skip partial fills entirely. Some environments do not model borrowing, buying power changes, trading halts or settlement rules in the same way as production.
Read the documentation for each simulated feature, then verify it with requests. If the provider does not say how fills, quotes and rejections are generated, treat those behaviours as unknown. The sandbox is a test double for the broker interface, not a miniature exchange.
A successful API response proves that the API answered. It does not prove that the market would have filled the order.
Where the realism breaks
Execution quality depends on the path from quote to fill. A market order can cross a spread that the sandbox does not charge.
A limit order can sit behind other orders at the same price. A fast price move can leave it unfilled, or fill only part of the quantity before the remainder becomes stale. Those differences affect both realised returns and the agent's next decision.
State handling creates a separate risk. A client can submit an order, lose the connection before receiving the acknowledgement, then retry. The broker may have accepted the first request. If the retry creates a second order, the agent has doubled its exposure. A sandbox that always returns promptly will not expose this failure. Nor will it test the race between a cancel request and a fill that arrives first.
Risk checks can diverge too. Test whether the environment rejects unsupported time-in-force values, quantities below the minimum, orders outside the session, insufficient buying power and short sales without borrow. A live broker may also reject a valid-looking order after a price band, symbol status or account entitlement changes.
Put typical ranges beside the sandbox result
The figures below are planning ranges, not audited results for a named broker. Actual values depend on asset, venue, order size, network route and market conditions. Use them to choose what to measure, not as universal performance targets.
| Measure | Sandbox typical range | Live typical range | What to test |
|---|---|---|---|
| Request to acknowledgement | 20-200 ms | 30-500 ms, with occasional responses above 1 second | Record median, p95 and timeout rate |
| Spread on a liquid instrument | 0-1 tick or fixed spread | 1-5 ticks in ordinary conditions, wider around news | Compare the order price with the quote at submission |
| Marketable limit order filled at once | 90-100% in simplified simulations | 70-100%, with partial fills more likely in thin markets | Track filled quantity and remaining quantity separately |
| US equity commission | $0 or a placeholder fee | $0-0.005 per share, plus possible venue and regulatory fees | Reconcile the execution report with the account ledger |
A figure is only useful if its clock and denominator are clear. Measure latency from the agent's send timestamp to the broker acknowledgement, and separately from acknowledgement to fill.
Calculate fill rates by order type and market condition. Do not blend rejected orders, open orders and completed orders into one success percentage.
Build an operator test, not a demo
Make the sandbox test the agent's response to uncertainty, as well as its happy path. Store the full request, broker response, client order ID, broker order ID, timestamps and every later status update.
Keep the market data used to make the decision. Without those records, a mismatch between expected and actual behaviour is hard to diagnose.
- Define a small set of orders that cover market, limit, partial-fill, cancel, replace and out-of-session cases. Include rejected orders and malformed requests.
- Simulate lost acknowledgements and delayed responses. After a timeout, query by client order ID before retrying. Verify that repeated submissions cannot create duplicate exposure.
- Replay the same decision against captured quotes with realistic spread, fees and slippage assumptions. Compare intended quantity and price with the simulated fill, not just the final account balance.
- Run the agent in shadow mode against live data. Let it generate orders without sending them, then compare its proposed price and size with the market and record what would probably have filled.
- Move to live orders only with a small, capped canary. Set limits for notional, open orders and daily loss. Alert on stale data, unknown order states, repeated rejects and positions that do not reconcile.
Do not let a passing sandbox suite silently promote an agent to production. Require an operator review of the test records and a written threshold for each canary limit.
A separate paper-trading environment can make it easier to exercise agent workflows over repeated sessions. Agentic Trading Index offers agentic paper trading from $9.99 a month; it still needs to be treated as a simulation, not evidence of live execution quality.
For the first live runs, keep the execution path observable and reversible. The agent should stop placing orders when market data is stale, an order remains in an unknown state past a defined timeout, or its position differs from the broker's account view. A human does not need to approve every order, but the system needs a clear stop condition and a way to inspect what happened.
Stop treating green checks as proof
Keep the sandbox in the test suite, but narrow the claims made from it. Record what is simulated, what is measured in shadow mode and what remains unknown. Then stop doing these things:
- Stop equating an accepted order with a filled order.
- Stop retrying timed-out submissions without checking their status.
- Stop assuming sandbox fees, spreads and fills represent live conditions.
- Stop enabling unattended orders without exposure caps and a stop condition.
Frequently Asked Questions
What does a broker sandbox test?
It usually tests API access, request formatting and basic order-state handling. It may not reproduce live spreads, queue position, partial fills, fees or production risk checks.
Why do broker sandbox fills differ from live fills?
A sandbox often simulates fills rather than matching against a live order book. It may omit queue priority, market impact, changing liquidity and the timing of competing orders.
Can a sandbox test partial fills?
Some can, but confirm how partial quantities and later status updates are generated. If the behaviour is not documented, test the agent with your own simulated partial-fill events as well.
How should an agent handle a timed-out order request?
It should query the broker for the order using a stable client order ID before submitting again. Retrying blindly can create duplicate orders if the first request succeeded but its acknowledgement was lost.
When is an unattended trading agent ready for live orders?
Only after its order-state handling, risk limits, recovery behaviour and monitoring have been tested, including outside the happy path. Start with a capped canary and stop automatically on stale data, unknown order states or position mismatches.