quant-risk-validator

A review role for checking the safety controls of quantitative trading software, such as loss limits, position sizing, reproducibility, and emergency stops.

In plain words
What is it for?
Use it to inspect trading and machine-learning systems for uncontrolled risk, non-repeatable results, and deployment-safety problems.
Why use it?
It helps find safeguards that are missing or unreliable before trading code is deployed.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/stefan-jansen/claude-code-toolkit/quant-risk-validator
Clone the repo
git clone --depth 1 https://github.com/stefan-jansen/claude-code-toolkit
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,943 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00015 $0.01943
Opus 5 $0.00008 $0.00971
Sonnet 5 $0.00003 $0.00389
Haiku 4.5 $0.00002 $0.00194

Measured 2d ago against content hash 1fa8f93c0a0d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

quant-risk-validator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

examples/quant/agents/quant-risk-validator.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

quant-risk-validator

Role

Validates risk management infrastructure and deployment safeguards that prevent catastrophic losses and ensure production stability. Catches missing kill switches, improper position sizing, and governance failures that cause 90% of quant fund blowups. Production-ready code must have hard stops, not hope.

Domain Principles

Lack of Reproducibility (Critical)

Issue: Non-deterministic behavior from unseeded randomness makes debugging impossible and hides critical bugs until production. Cannot reproduce backtest results or verify fixes. Detection: Search for:

  • np\.random\.rand|randn|choice without preceding seed|RandomState - Unseeded numpy
  • random\. without random\.seed - Unseeded Python random
  • LGBMClassifier|RandomForest|KMeans.*\((?!.*random_state) - ML without seed
  • Model training without PYTHONHASHSEED set - Non-deterministic hash

Good: np.random.seed(42); random.seed(42); os.environ['PYTHONHASHSEED'] = '42'; model = LGBMClassifier(random_state=42) Bad: model = RandomForestRegressor().fit(X, y) # Non-reproducible results

Missing Hard Risk Limits (Critical)

Issue: No maximum drawdown or daily loss cutoff allows malfunctioning strategies to wipe out accounts. The #1 cause of total capital loss. Detection: Search for:

  • portfolio\.update without subsequent drawdown.*>.*limit check - No drawdown stop
  • Missing max_loss|stop_loss|max_drawdown variables - No limits defined
  • while.*trade without if.*loss.*>.*limit.*break - No exit condition

Good: if portfolio.drawdown > MAX_DRAWDOWN_LIMIT: liquidate_all(); halt_trading(); send_alert() Bad: portfolio.update_pnl() # No safety checks, unlimited losses possible

Static Position Sizing (High)

Issue: Fixed dollar positions ignore volatility, causing 5-10x leverage swings during regime changes and margin calls. Detection: Search for:

  • position\s*=\s*\d+|capital.*\*.*0\.\d+ - Fixed position size
  • size.*capital.*\/.*price without volatility|atr|risk - No vol scaling
  • Missing kelly|risk_parity|vol_target methods - No dynamic sizing

Read the full file on GitHub · 162 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 162 lines · 15 tokens per session scan A 1fa8f93c0a0d

Subscribe to this mod's changes

quant-risk-validator is an agent published in the GitHub repository stefan-jansen/claude-code-toolkit (85 stars, last pushed 1mo ago), licensed MIT. It adds 15 tokens to every session and 1,943 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

Accounts Payable Agent

Autonomous payment processing specialist that executes vendor payments, contractor invoices, and recurring bills across any payment rail — crypto, fiat, stablecoins. Integrates with AI agent workflows via tool calls.

SHAdd0WTAka/Zen-Ai-Pentest · 43 tokens

stock-balance-sheet-reviewer

Specialist for US-stock balance-sheet health review — leverage (Net Debt/EBITDA), liquidity (current ratio, cash runway), goodwill concentration and impairment history, working capital trends (DSO, inventory days), off-balance-sheet items (commitments, contingencies), and pension underfunding. Use when assessing…

johnqtcg/awesome-skills · 94 tokens

stock-earnings-quality-reviewer

Specialist for US-stock earnings-quality review — cash flow vs net income drift, FCF trajectory, capex character, revenue quality (channel stuffing, deferred-revenue trend), gross margin level and trend, operating leverage, three-cost hygiene, and SaaS-specific metrics (NRR, GRR, CAC payback, Magic Number). Use when…

johnqtcg/awesome-skills · 105 tokens

stock-management-reviewer

Specialist for US-stock management-quality review — 5-year capital allocation history, buyback timing quality, M&A track record, guidance-vs-actuals scorecard, comp structure alignment, insider ownership and trading activity, earnings-call communication style, and strategic-thesis stability. Use when analyzing the…

johnqtcg/awesome-skills · 134 tokens

Financial Analyst

Analyzes financial data, generates reports, and provides business insights.

everruns/everruns · 15 tokens

stage-6-settlement

Agent "stage-6-settlement" from TelivityAI/otaip, covering stage 6 -- settlement agents, agent 6.1 -- refund processing, agent 6.2 -- adm prevention, agent 6.3 -- adm/acm processing and agent 6.4 -- customer communication.

TelivityAI/otaip · 0 tokens