Skip to main content
The Agent Framework is the interface between the LLM and the fund. It provides the MCP tools for every autonomous action, a decision framework with guardrails, and a natural language interface for complex operations.

MCP Tool Expansion

The existing 44 MCP tools cover trading operations. The autonomous layer adds fund management tools:

Fund Management Tools

ToolDescription
fund_statusNAV, returns, risk metrics, capital available
fund_reportGenerate PDF/CSV fund report
allocate_capitalMove capital between strategies
fund_drawdownCurrent drawdown vs. limits

Strategy Management Tools

ToolDescription
deploy_strategyLaunch strategy from template + parameters
stop_strategyGracefully stop a running strategy
list_strategiesAll strategies with health, P&L, state
promote_strategyMove from staging to live
scale_strategyAdjust capital allocation
ab_testStart A/B test between two strategy variants

Research Tools

ToolDescription
scan_opportunitiesScan markets, return ranked by fitness
research_marketDeep analysis of a single market
backtest_hypothesisBacktest a strategy idea, return results
resolution_statusCheck resolution status of active markets
market_universeCurrent universe with fitness scores

Risk Tools

ToolDescription
risk_dashboardCurrent VaR usage, limits, correlations
stress_test_fundRun fund-level stress scenarios
risk_budget_statusPer-strategy risk budget utilization
execution_qualityFill rates, slippage, adverse selection

Explainability Tools

ToolDescription
fund_explainFull fund state: overview, regime, risk, strategies, decisions, alerts, hypotheses, alpha factors
fund_explain_strategySingle strategy deep dive: performance, execution, decay, promotion, hypotheses
fund_explain_riskFull risk analysis: tail risk, Greeks, correlations, stress, VaR, limits, attribution
fund_full_snapshotEverything in one call

Intelligence Tools

ToolDescription
fund_hypothesesActive trading hypotheses with lifecycle state, confidence, edge estimates
fund_regimeCurrent market regime with confidence and recent transitions
fund_alpha_modelAlpha model factor report: per-factor ICs, significance, weights
fund_decisionsRecent autonomous decisions with reasoning, confidence, outcome
fund_decay_reportAlpha decay tracking: edge erosion, half-life, retirement recommendations

Operations Tools

ToolDescription
fund_alertsRecent alerts with counts by category
fund_ledgerDouble-entry journal entries, balance sheet, income statement
fund_promotion_statusStrategy promotion stages and history

Decision Framework

Every autonomous decision goes through guardrails to prevent runaway behavior.

Confidence Thresholds

Different actions require different minimum confidence levels:
ActionMin ConfidenceRationale
Add market to universe0.3Low-stakes, just tracking
Deploy strategy (staging)0.5Paper mode, no capital at risk
Promote to live (small capital)0.7Real money, but limited
Scale up capital0.8Increasing exposure
Activate kill switch0.5Better safe than sorry
Retire strategy0.6Reversible, can redeploy

Escalation Rules

When the LLM should escalate to a human:
ConditionAction
Trade notional > thresholdRoute to approval workflow
Confidence < minimum for actionLog decision, wait for human
Unusual market conditionsAlert + pause
Multiple strategy failuresAlert + reduce exposure
Fund drawdown approaching limitAlert + require human confirmation

Rate Limiting

Prevent runaway decision loops:
# Configure rate limits
decision_limits = DecisionLimits(
    max_deploys_per_hour=3,
    max_capital_changes_per_day=10,
    max_kill_switch_activations_per_day=2,
    cooldown_after_loss=300,  # 5 min cooldown after a strategy is retired
)

Decision Audit Trail

Every autonomous decision is logged with full reasoning:
{
  "decision_id": "d-abc123",
  "timestamp": "2026-03-13T14:30:00Z",
  "action": "deploy_strategy",
  "parameters": {
    "template": "market_maker",
    "market": "will-x-win",
    "capital": 5000
  },
  "reasoning": "Market has 0.87 fitness score, LLM forecast edge of 0.08, backtest Sharpe 1.6 over 45 trades, robustness p=0.02",
  "confidence": 0.75,
  "outcome": "deployed",
  "strategy_id": "s-def456"
}

Natural Language Interface

The LLM translates natural language commands into tool calls:
Natural LanguageMCP Tool(s)
“Deploy a market maker on the top 5 political markets”scan_opportunities -> deploy_strategy x5
”Reduce crypto exposure by 50%“list_strategies -> scale_strategy for each
”What’s our biggest risk right now?”risk_dashboard + correlation_matrix
”Why did we lose money yesterday?”fund_report + execution_quality + decision_log
”Backtest momentum on election markets”scan_opportunities -> backtest_hypothesis

Dry-Run Mode

For maximum safety, the LLM can operate in dry-run mode where it proposes actions and a human approves them in batches:
# Configure operating mode
agent = AutonomousAgent(
    fund=fund,
    mode="dry_run",  # "dry_run" | "supervised" | "autonomous"
)

# LLM proposes actions
proposals = agent.propose()
# [
#   {"action": "deploy_strategy", "params": {...}, "reasoning": "..."},
#   {"action": "scale_strategy", "params": {...}, "reasoning": "..."},
# ]

# Human reviews and approves
agent.approve(proposals[0].id)
agent.reject(proposals[1].id, reason="too concentrated")

Operating Modes

ModeBehavior
Dry-runLLM proposes, human approves each action
SupervisedLLM executes low-risk actions, escalates high-risk
AutonomousLLM executes all actions within guardrails