Skip to main content

Autonomous Agent

The autonomous agent monitors system performance and continuously adapts strategy parameters to improve outcomes — without human intervention. It operates in paper trading mode only, with strict guardrails and a complete audit trail for every change it makes.

What the agent does

The agent runs four loops at different cadences:

Short cadence (seconds) — polls the metrics snapshot stream for the current system state (win rate, drawdown, regime, signal performance).

Medium cadence (hourly) — evaluates per-signal win rates against minimum thresholds. Signals that are underperforming receive parameter adjustments from the gradient-based tuner. All adjustments are bounded to a maximum percentage change per cycle to prevent runaway drift.

Extended cadence (multi-hour) — checks for calibration drift. If a signal's model inputs have drifted significantly from the conditions under which it was calibrated, full recalibration is triggered.

Daily cadence — reads the full-day performance report. If aggregate Sharpe is below the minimum threshold for the period, the agent proposes new strategy variants for A/B testing.

Safety constraints

The agent operates under hard constraints that cannot be overridden by the tuning logic:

  • Paper mode only — the agent verifies paper trading mode at startup and halts if it is not active. It never touches live trading parameters.
  • Bounded delta per cycle — no single tuning cycle can move any parameter by more than a defined maximum fraction of its current value. Large changes require multiple cycles to take effect, preventing runaway parameter drift.
  • Minimum sample requirement — parameter adjustments only run after a statistically meaningful number of completed paper trades for that signal. The agent does not tune on insufficient data.
  • Ledger before apply — every parameter change is written to the audit ledger and a rollback hash is captured before the change is applied. If the change needs to be reverted, the hash is the key.
  • Automated rollback — if metrics deteriorate meaningfully within a defined window after a parameter change, the agent automatically initiates rollback to the prior values via the ledger hash.
  • Validation guard — a validation layer enforces hard ceilings before any parameter write: position size limits, strategy weight normalization (must sum to 1.0), and drawdown thresholds must remain within the profile's risk constraints.

Risk profile adaptation

Beyond individual signal parameters, the agent also adapts the active risk profile to match market conditions:

ParameterAdaptation trigger
Strategy allocation weightsShift weight toward strategies with higher rolling win rates over a recent sample window
Max intents per hourReduce when portfolio drawdown approaches the daily limit
Portfolio constraintsTighten in crash or high-volatility regimes (detected by the HMM classifier)
Stop-loss / take-profit targetsWiden stops if the current ATR multiple is producing premature exits
Allowed signal typesTemporarily disable signal types whose win rate falls below the F-tier threshold

Profile adaptations write to the policy cache and take effect on the next trade evaluation cycle — they do not require a service restart.

Tuning confirmation

Every parameter write by the agent is confirmed with a read-back. The agent writes the new value, waits 2–5 seconds, then reads it back. If the read-back differs from the written value, the agent emits an agent.tuning.error event to the risk.events stream. Consuming services acknowledge new configuration values via config.ack events, confirming the change is in use.

This eliminates the "blind write" problem where the agent applies a change but has no visibility into whether it took effect in the running services.

Audit trail

Every action taken by the autonomous agent is recorded in the audit ledger:

  • The metric that triggered the action
  • The current value of the metric
  • The parameter being changed
  • The old value and new value
  • Whether the change was applied or deferred
  • A rollback hash

The full history of autonomous adaptations is also published to the tuning.decisions Redis stream, where it can be inspected in real time or consumed by the dashboard.

What the agent cannot do

The autonomous agent cannot:

  • Place or cancel real orders (it only touches strategy parameters)
  • Override hard-coded safety ceilings in the validation guard
  • Operate in live trading mode
  • Make changes without a prior ledger entry and rollback hash
  • Run parallel tuning cycles on the same parameter simultaneously

These constraints are enforced at the code level, not by convention.