AllPath: Layered Verification for a Deployed, Self-Revising LLM Trading Agent under Human-Gated and Autonomous Regimes
Organizations: Independent Researcher USA
Abstract
LLM trading agents are evaluated almost exclusively in backtests and autonomous benchmark harnesses. Deployment, where actions are irreversible, raises a different question: who verifies the agent's actions, and which failures can each verifier structurally catch? We report on AllPath, a personal LLM trading agent deployed against a live paper-brokerage account. The system watches positions through a deterministic rules engine, and each night it reviews its own day and proposes revisions to its own trading strategies. Verification is split across three layers. Code verifies what must not depend on judgment: deterministic gates enforce risk limits and block any strategy revision that fails an integrity check. The agent verifies itself within fixed bounds: its nightly review has an iteration cap and no tools that can act. A human verifies judgment, through approval screens that show the current state of each proposal. We also compared two verification policies for the agent's self-revisions on the live system: two and a half weeks with every self-revision human-gated, then five weeks with reflection revisions auto-applied behind the same code gates, while the operator's chat channel stayed human-gated throughout. Each layer caught a different kind of failure. The code gates rejected no proposal; their role was keeping revisions consistent. The human rejected two proposals that passed every code check, both over a disagreement about the market, and later removed 11 of the 19 rules the agent had added on its own, at a median lag of eight days. The most instructive production incidents, such as strategies silently left unmonitored, passed every gate; the operator found them by hand, and the fix each time was an interface change that makes the condition visible. We contribute the layered architecture, the two-regime account, and a production incident taxonomy, none observable in a backtest.
Figures & tables
| Action | Proposed by | Verified by | Gate mechanics |
|---|---|---|---|
| Stock order ( confirm auth) | Sentinel rule or chat agent | Code, then human | Risk-gate caps pending queue human approve (web/link), single-use token |
| Stock order ( auto auth, hard rule) | Sentinel rule | Code only | Risk-gate caps; one-shot rule state; drawdown breaker as regime backstop |
| Option order (buy) | Sentinel rule ( auto+hard only, by grammar) | Code only | Premium + exposure caps; expiry safety sweep; breaker |
| Option close | Sentinel rule / expiry sweep | Code only | Never value-blocked (risk-reducing); daily count only |
| Strategy revision (human-gated regime) | Reflection or chat agent | Code, then human | Parse + id/version/freeze checks at propose; byte-exact staleness + re-checks at apply; superseded displacement of stale chat drafts; human reads regenerated diff |
| Strategy revision (autonomous regime) | Reflection | Code only | Same mechanical gates, auto-apply; scoped to reflection-sourced rows; breaker backstop |
| When | Action | Proposer | Verifier | Outcome |
|---|---|---|---|---|
| Aug 10–Sep 28 | 12 stock orders under confirm authorization | Sentinel / chat | Code human | 11 executed or recorded via the risk gate; 1 rejected |
| Aug 11 | NVDA revision v1 v2: unit-inconsistency fix ( <12 vs. 0.2 ), momentum-add rule removed | Reflection | Code human | applied; inert position-weight caps made effective |
| Aug 21, 27 | Near-market add tranches after run-ups (TSM 215 with cap raises) | Reflection | Code human | Vetoed on the operator’s cyclicality prior; mechanically valid |
| Aug 28–Oct 2 | 56 strategy revisions across both accounts | Reflection | Code only (autonomous) | All auto-applied within about two minutes; 0 integrity-gate rejections |
| Aug 28–Oct 2 | 57 strategy revisions | Chat | Code human | 53 ; 1 rejected; 3 superseded |
| Sep 8 | 3 stale chat drafts displaced by newer proposals | Chat | Code (displacement) | Relabeled superseded ; approval tokens invalidated |
| Incident | Caught by | Design rule derived |
|---|---|---|
| Draft strategies silently excluded from monitoring; no surface said so | Operator, production | Any state that disables monitoring wears a persistent badge on every surface |
| Submission timestamp presented as fill time (17 h misread) | Operator, production | Submitted and filled are distinct events with distinct labels, everywhere |
| Id-less HTTP-200 broker payload journaled as “submitted”; 5 one-shot rules burned | Operator, production (autonomous window) | Validate response content, not shape, before recording success |
| External CLI dependency vanished; 2.5 h option-close retry storm while the stock leg had already exited | Code (contained), production | Preflight external dependencies; alert distinctly from routine order errors |
| Quote feed returned non-finite previous_close | Code gate, production | Strict ingestion validation; loud isolated failure beats silent NaN comparison |
| Unparseable sentinel analysis | Code default, production | Fail closed to human review; never default-execute on unparseable agent output |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Incident | Caught by | Design rule derived |
|---|---|---|
| Degenerate action amount crashes strategy loading | Adversarial review | Domain-typed parse boundary, never a bare stdlib exception |
| Condition-evaluator recursion DoS / non-finite literals | Adversarial review | Depth cap + finite-number constraint on any expression language, even agent-authored |
| TOCTOU double-execute race on order claim | Adversarial review | Atomic DB-level claim on every irreversible-action gate |
| Post-claim execution error misreported as "queued" | Adversarial review | Split try/except; every terminal state truthfully recorded |
| Stale-revision silently reverts an approved change | Adversarial review (reproduced pre-merge) | Byte-exact re-check of live file state at approval time, not the proposal’s snapshot |
| Draft strategies never monitored, no signal | Operator, production | Persistent, unmissable badge on any state that disables monitoring |
| Field | Rendered value |
|---|---|
| Strategy revision card | |
| Header | revise strategy NVDA #2 reflection |
| Rationale | “NVDA has re-rated: 140 is now 23% below spot and would only fire after a crash we could not act on. Tightening the hard stop to 150 keeps the thesis intact while capping drawdown near 18%.” |
| Diff, current vs. proposed | version: 3 4 ; stop rule price < 140 price < 150 ; unchanged lines collapsed (“… 5 unchanged lines”) |
| Frozen fields shown | status: active , authorization: confirm (unchanged by construction) |
| Controls | Approve; Reject with optional reason |
LLM Agent Verification
LLM agent verification checks whether agents’ actions, evidence, policies, and completion claims satisfy explicit requirements.
See all 131 papers