Best Practices
Guidelines for safe agent deployment
Best Practices
Before Deployment
Start conservative. Begin with tight limits and gradually increase based on performance.
config = Config(
max_position_size=1000, # Start small
max_daily_loss=500, # Tight loss limit
risk_tolerance='conservative',
max_frequency_per_min=5
)Test thoroughly. Run backtests across multiple market conditions.
agent.deploy(environment='sandbox')
results = agent.run_backtest(
start_date='2024-01-01',
end_date='2026-01-17',
initial_capital=100000
)
# Validate key metrics
assert results.sharpe_ratio > 1.0
assert results.max_drawdown < 0.25Production
Always enable circuit breaker.
agent.deploy(
environment='production',
circuit_breaker=True,
alert_email='your-email@example.com'
)Set up alerts.
agent.on_rogue_detected(callback=send_alert)
agent.on_anomaly_detected(callback=notify_team)
agent.on_circuit_breaker_triggered(callback=escalate)Monitoring
Key metrics to watch:
- Sharpe ratio > 1.0
- Win rate > 50%
- Max drawdown < 25%
- Risk score < 70
Daily review checklist:
- Check daily PnL
- Review behavior classification
- Monitor anomaly count
- Verify within position limits
Incident Response
| Event | Severity | Action |
|---|---|---|
| Anomaly detected | Medium | Monitor closely, review within 1 hour |
| Rogue behavior | High | Request manual approval, prepare for halt |
| Circuit breaker | Critical | Immediate investigation, post-mortem |
When circuit breaker triggers: return to sandbox, adjust parameters, revalidate before redeploying.
Checklist
- Validated in sandbox with multiple market conditions
- Sharpe > 1.0, drawdown < 25%
- Position sizes appropriate for risk tolerance
- Circuit breaker enabled
- Alerts configured
- Manual override procedures documented