Trader Cloud BacktestCAUTION
๐ The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
Overview
๐ The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
ef7d4f0535e5OBSERVED ยท 2026-09-26What it tells the agent
The instruction file, verbatim from the audited commit โ this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
---
name: trader-cloud-backtest
description: Run a heavy neural-trader job (long walk-forward, big Monte-Carlo, parameter sweep, model training) on the Anthropic Managed Agent cloud runtime instead of locally
allowed-tools: mcp__plugin_ruflo-core_ruflo__managed_agent_create mcp__plugin_ruflo-core_ruflo__managed_agent_prompt mcp__plugin_ruflo-core_ruflo__managed_agent_events mcp__plugin_ruflo-core_ruflo__managed_agent_status mcp__plugin_ruflo-core_ruflo__managed_agent_terminate mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__memory_retrieve mcp__plugin_ruflo-core_ruflo__memory_search mcp__plugin_ruflo-core_ruflo__agentdb_pattern-store Bash Read
argument-hint: "<backtest|train|sweep> <strategy-or-model> --symbol <TICKER> [--period 2020-2024] [--mc-paths 1000]"
---
# Cloud backtest / train (neural-trader on a Managed Agent)
Dispatch a **heavy** `neural-trader` job to an Anthropic Claude Managed Agent (cloud container) instead of running it locally. See project ADR-117 (recipe + cost rules) and ADR-115 (the `managed_agent_*` runtime).
## When to use this vs `trader-backtest` (local)
| Job | Runtime |
|---|---|
| Quick sanity check; one short backtest (< ~1 min) | local โ use the `trader-backtest` skill |
| Multi-year **walk-forward**, big **Monte-Carlo** count, **parameter sweep** over a grid, or **model training** (LSTM/Transformer/N-BEATS) | **cloud โ this skill** |
Prereq: `ANTHROPIC_API_KEY` (or `CLAUDE_API_KEY`) + Managed Agents beta access. If `managed_agent_*` returns "needs ANTHROPIC_API_KEY", fall back to the local `trader-backtest` skill.
## Steps
1. **Estimate first.** From the job size, print an estimated cost (โ container-minutes ร rate + tokens) โ a long sweep is a deliberate choice, not a default.
2. **Provision (or reuse) the container** โ install neural-trader at container start so the agent doesn't reinstall mid-run:
```
managed_agent_create({
name: "nt-cloud",
model: "claude-haiku-4-5-20251001", // orchestration only โ the compute is the Rust engine, not the LM (ADR-026)
system: "You operate the `neural-trader` CLI in this container. Run exactly the commands asked, report the metrics, write requested artifacts, then stop.",
networking: "unrestricted", // or "restricted" pinned to your data host
packages: { npm: ["neural-trader"] }, // add apt:["build-essential"] ONLY if there's no prebuilt NAPI binary for the arch (neural-trader ships prebuilds โ usually omit)
initScript: "npm install -g --ignore-scripts neural-trader >/dev/null 2>&1 || npx -y neural-trader --version >/dev/null 2>&1 || true"
})
โ { sessionId, agentId, environmentId }
```
For a **sweep**: create the environment once, run all configs in **one** `managed_agent_prompt` (one container), not N sessions.
3. **Pre-flight cheap.** Before a 1000-path / multi-year run, do a tiny smoke first (1 MC path, ~3 months) โ catches a bad strategy name / symbol in seconds:
```
managed_agent_prompt({ sessionId, message: "Run `npx neural-trader --backtest --strategy <name> --symbol <TICKER> --period <last 3 months> --mc-paths 1`. Just confirm it ran and report the Sharpe. Then stop.", maxWaitMs: 60000 })
```
If that fails, fix the args before the real run (and `managed_agent_terminate`).
4. **Run the real job:**
```
managed_agent_prompt({
sessionId,
message: "Run `npx neural-trader --backtest --strategy <name> --symbol <TICKER> --period <range> --walk-forward --mc-paths <N>` (for training: `npx neural-trader --train --model <lstm|transformer|nbeats> --symbol <TICKER> --period <range>`; for a sweep: loop the configs and run each). Report: total return, annualized return, Sharpe, Sortino, max drawdown, win rate, profit factor, # trades, 95% CVaR. Write the equity curve to /tmp/equity.csv and the trade log to /tmp/trades.csv. Then stop.",
maxWaitMs: <generous โ minutes>
})
โ { finished, status, stopReason, assistantText (the metrics), toolUses }
```
If `finished:false`, follow up with `managed_agent_events({ sessionId })` until idle.
5. **Pull artifacts (if needed):** `managed_agent_prompt({ sessionId, message: "cat /tmp/equity.csv" })` or `managed_agent_events` and read the tool_result.
6. **Ingest locally + Ed25519 verify (ADR-126 Phase 4 fail-closed gate):**
- Build the `SignedBacktestArtifact` body from the cloud-returned metrics + params hash + runs hash. Sign it locally with `signBacktestArtifact(body, privateKeyHex)` from `plugins/ruflo-neural-trader/src/signed-artifact.mjs` (key resolution same as `trader-backtest`: `RUFLO_WITNESS_KEY_PATH` โ `verification/witness-key.json` โ degraded-unsigned warning).
- **Before storing OR promoting the artifact to a live strategy**: call `await verifyBacktestArtifact(artifact, trustedPublicKey)` where `trustedPublicKey` is the pinned project-config Ed25519 public key (NOT the `artifact.witnessPublicKey` field โ that's attacker-controllable; see CWE-347 / #1922). If verification returns `false`: **REFUSE to promote** โ emit a loud error `"[ERROR] ruflo-neural-trader: SignedBacktestArtifact signature INVALID against trusted key โ refusing to promote to live strategy"` and return early. This is the fail-closed gate per ADR-126.
- On verify success: `memory_store({ key: "backtest-<strategy>-<ts>", value: JSON.stringify(signedArtifact), namespace: "trading-backtests" })`. The stored value carries `witnessSignature` + `witnessPublicKey`.
- If Sharpe > 1.5: `agentdb_pattern-store({ pattern: "profitable-<strategy-type>", data: "<params + results>" })`.
- Record the run's container time + token cost to the `cost-tracking` namespace (per ADR-117 โ cloud sessions bill until terminated).
7. **Terminate immediately** โ results in hand:
```
managed_agent_terminate({ sessionId, environmentId }) โ { sessionDeleted: true, environmentDeleted: true }
```
Never leave an idle billing container. (`ruflo doctor` Trust audit
CAUTIONgrade B ยท trust 89/100 Install with care. The audit found things worth knowing before you trust its output.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | WARN |
| L1 | Static analysis of the code | NA |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (4)
crates
plugin/agents
plugin/commands
plugin/skills
Gates applied: no_behavioural_pass.
ef7d4f0535e5full audit observations/trust-audit/skill/ruvnet__trader-cloud-backtest.json ยท Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-09-26 | ef7d4f0535e5 | CAUTION | B | 89 | first audit |
Questions
What does the Trader Cloud Backtest skill do?
๐ The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
Is Trader Cloud Backtest safe to install?
With care. The audit graded it B (89/100) and found 4 things worth knowing before you trust this skill, listed below with the exact line each was found on.
What can Trader Cloud Backtest access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
What do I need installed to use Trader Cloud Backtest?
Its own instructions reference trader-backtest. Dependencies are pinned to exact versions.
How current is this page?
The grade is for one exact copy of the source (ef7d4f0535e5), read on 2026-09-26. The repository is watched, and a new audit runs when it changes โ this is the first audit.