AI agent skill for portfolio / strategy / position risk review — volatility, drawdown, VaR/CVaR, Sharpe/Sortino/Calmar/UPI, Kelly & vol-targeted sizing, concentration & leverage caps, stress tests. Works with Claude Code, Codex, Cursor. By Viprasol Tech.
SaferSkills independently audited risk-management-review (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A disciplined, repeatable methodology for reviewing the risk of a portfolio, trading strategy, or single position — before sizing it, while running it, or when stress hits. It answers four questions, in order:
The output is a blunt verdict banner, a numeric risk dashboard, a sizing review, a stress-test table, and concrete recommendations — backed by formulas the user can re-run.
Honest scope and limits. I reason over what you provide (returns series, positions/weights, leverage, scenario inputs). Without numbers, output is qualitative. Risk metrics describe history and assumed distributions — they do not predict the next regime shift. Not financial advice; size below your pain threshold.
Activate when the user:
VaR · CVaR · Expected Shortfall · Sharpe · Sortino · Calmar · Ulcer Index · risk-of-ruin · position sizing · leverage cap · concentration · stress test · reverse stress test · risk parity · Optimal f.*
drawdown stop, leverage cap) for a fund / personal book / trading desk.
Pin down what is being reviewed and what inputs you have before computing anything. A risk number without scope is theatre.
question.
Risk-adjusted return + drawdown + tail are dominant.
Concentration + correlation + stress are dominant.
VaR, ES, Sharpe, Sortino, Calmar, UPI.
sector/factor exposure.
tests.
when relevant.
drawdown stop) — if absent, flag it as a Step-8 red flag.
a 2017-only sample is not a risk model.
Do not proceed to a verdict until you know what is being reviewed, what inputs exist, and what the existing risk policy (if any) is.
Compute (or explain how to compute) every metric below. Use the formulas verbatim — the user should be able to re-run them.
σ = sqrt( mean( (r_t − r̄)² ) ) — total dispersion;symmetric (treats upside = downside).
σ_d = sqrt( mean( min(r_t − MAR, 0)² ) ) — onlyreturns below the minimum acceptable return (often 0 or the risk-free rate) count. Used by Sortino.
MDD = max_t (peak_t − value_t) / peak_t — the singlenumber every retail trader should know.
to recovery).
flat -20% is often more painful than a fast -30% that recovers in a month; track duration, not just depth.
UI = sqrt( mean( drawdown_t² ) ) over the period. Captures depth × time underwater in one number — penalises sustained underwater periods.
VaR = $X" means the worst 5% of days lose at least $X. Computable via historical sim, parametric (normal), or Monte Carlo. VaR is NOT subadditive* — combining two portfolios' VaRs can give the wrong answer.
ES_α = E[ loss | loss ≥ VaR_α ] — theaverage loss in the worst (1 − α) of cases. Coherent (subadditive, monotonic, translation-invariant, positive-homogeneous). Basel III moved banks from VaR to ES_97.5 — prefer ES for portfolio decisions.
form exists for IID Bernoulli trades; otherwise simulate.
normal, almost always. Parametric-normal VaR therefore systematically understates** tail loss. If you must use it, call out the assumption and cross-check against historical/ES.
Output these as a dashboard table (Step 9), not prose.
Never quote raw return. Always pair it with one of these — and pick the one that matches the strategy shape.
| Metric | Formula | When it fits | What it hides | ||
|---|---|---|---|---|---|
| Sharpe | (R − R_f) / σ | Roughly symmetric returns; broad comparability. | Punishes upside vol; gamed by autocorrelation & illiquidity smoothing. | ||
| Sortino | (R − MAR) / σ_d | Asymmetric payoffs (options, trend following). | MAR choice (0 vs R_f) changes the number; still a single-number summary. | ||
| Calmar | `annualised return / | MDD | ` | "Can I survive the worst stretch?" framing. | Single-event metric — one big DD dominates. |
| Ulcer Performance Index (UPI / Martin ratio) | (R − R_f) / UI | "Did I sleep at night?" — penalises underwater time. | Less standard than Sharpe; needs a long enough window. | ||
| Information Ratio | active return / tracking error | Benchmark-relative strategies. | Tells you nothing about absolute drawdown. |
or hidden tail (short-vol). Treat as red flag, not a feature.
autocorrelation of r_t (a daily ρ of 0.2+ is suspicious for liquid markets).
vol / picking up nickels in front of a steam roller). Drawdowns are larger than the symmetric vol implies.
long stretches underwater (a slow bleed); investors will redeem.
Multiple-testing. If the strategy was selected from many candidates, Sharpe overstates skill. Cross-link the Viprasol `trading-strategy-review` skill to compute Deflated Sharpe (Bailey & López de Prado) and Probability of Backtest Overfitting before trusting the headline number.
What method is being used? Apply the right formula; flag missing or arbitrary sizing as a Step-8 red flag.
e and net odds b: f* = e / b. f* = (μ − r) / σ²where μ = expected return, r = risk-free rate, σ² = return variance.
aggressive in practice*: parameter-estimation error (μ and σ are estimated*, not known) → systematic over-sizing → catastrophic drawdowns when reality rhymes differently than the sample. Kelly also assumes IID stationary returns; real markets shift regime.
approximately halves volatility while keeping most of the geometric growth.
so its risk contribution matches the budget:
notional_i = (target_vol × NAV) / σ_iregime-vol changes into stable risk contributions instead of stable dollars.
w_i × σ_i × ρ_{ip} = const.Works when correlations are stable; fails badly in crisis when everything correlates → 1.
Gaussian). Closer to "empirical Kelly" — better than naive Kelly when payoffs are highly non-binary (options strategies, lumpy event trades).
State the current sizing method (or "gut-feel — none documented" if so), the recommended sizing, and the constraint that should bind (the lower of half-Kelly, vol-target sizing, and the single-name cap from Step 5). Show the numbers.
Sizing is necessary but not sufficient — a properly-sized but concentrated portfolio still blows up.
position. Tighter (1–3%) for illiquid names. >10–15% on one name = flag.**
oil, US-rates duration, EM-FX, momentum) and apply a hard cap. A "diversified" book of 8 tech names is one position.
of vol; reads as "if any one of these breaks, the book breaks."
risk-on assets and recompute portfolio vol. If realized vol explodes, the book is a single bet dressed up as diversification.
Practitioner reads:
fund).
ADV = "can't exit in one day at quoted prices"; price-of-exit is part of the risk model.
Apply at least 3 historical scenarios and 2 hypotheticals plus a reverse stress test. Report portfolio P&L per scenario, in dollars and as a percent of NAV.
funding markets frozen, gold up, treasuries up.
HY ×4, oil briefly negative, VIX > 80, correlations → 1.
year since the 1930s.
decades, repricing of duration.
on a vol-of-vol basis); does the leverage cap still hold?
vol on a correlation matrix of ones.
gap between mark and exit?
Ask the inverse question: what move kills the book? Solve for the combination of equity shock + vol shock + correlation shock + liquidity shock that drives the portfolio to a fatal drawdown (e.g. -50%). If the answer is "3% intraday on SPX", the book is too levered. If the answer is "1987 + 2008 + 2020 all at once and twice as big", it is robust.
Make the asymmetry explicit. Drawdown recovery is multiplicative, not additive.
required gain to recover from a drawdown of d = 1 / (1 − d) − 1
-25% → +33.3%
-50% → +100%
-75% → +300%
-80% → +400%
-90% → +900%Asymmetry kills compounders. A strategy that compounds at 15% for ten years and gives back 80% in year eleven is a worse outcome than one that compounds at 6% with no -80% event.
Risk-of-ruin is high whenever sizing or leverage make a fatal drawdown a plausible path, not a tail. Triggers to call this out explicitly:
Compute, when given the inputs, the probability of breaching a drawdown threshold (e.g. -50%) over the holding horizon — via the closed-form ruin formula for IID trades or a quick Monte Carlo.
Any one of these moves the verdict toward 🟠 / ⛔.
short-vol / sell-tail payoff).
documented.
hidden.
understates; pair with ES_97.5 and historical sim.
investors' skin.
Lead with a verdict banner, then the dashboards, the sizing review, the stress-test table, the risk-of-ruin call-out (when relevant), the recommendations, and the disclaimer.
within tolerance, no red flags.
high but not fatal leverage, missing reverse stress test, Sortino noticeably below Sharpe).
40%, gross > 3× without stops, MDD path > 30% in stress). Reduce before doing anything else.
plausible path, not a tail (pure Kelly + 3×, all-in one factor, stress row
-40%). Cut size now.
Follow the banner with one sentence explaining why.
| Metric | Value | Notes | ||
|---|---|---|---|---|
| Annualised σ | … | total dispersion | ||
| Downside deviation σ_d | … | MAR used = … | ||
| Max drawdown | … | peak → trough … | ||
| MDD duration | … days | peak → recovery | ||
| Ulcer Index | … | depth × time underwater | ||
| Sharpe | … | R_f used = … | ||
| Sortino | … | MAR used = … | ||
| Calmar | … | annualised return / | MDD | |
| UPI (Martin ratio) | … | (R − R_f) / UI | ||
| VaR_95 (daily, historical) | … | …% of NAV | ||
| ES_97.5 (daily) | … | …% of NAV |
| Item | Value | Cap | Status |
|---|---|---|---|
| Single-name max | …% NAV | 10% | ✅/🟠 |
| Top-3 share | …% NAV | 40% | ✅/🟠 |
| Dominant factor | …% NAV | 25% | ✅/🟠 |
| Gross leverage | …× | 2× | ✅/🟠 |
| Net leverage | …× | — | — |
| Largest position vs ADV | …× | 1× | ✅/🟠 |
State the current method (or "none — gut-feel"), the Kelly / half-Kelly / vol-target recommended sizes (with formulas and plugged-in numbers), the binding cap, and the recommended size in dollars and % NAV.
| Scenario | Assumed shock | Portfolio P&L | Post-stress NAV |
|---|---|---|---|
| 1987-Oct replay | SPX -22% in a day | … | … |
| 2008-Sep–Nov replay | SPX -45% / spreads ×3 | … | … |
| 2020-Mar replay | SPX -34% in 22 days / ρ → 1 | … | … |
| +1σ vol shock | σ × 1.7 | … | … |
| -10% equity / +200bp rates | concurrent | … | … |
| Reverse stress | move that drives -50% NAV | … | … |
State the path, the recovery math (+X% needed to recover -Y%), and the probability of breaching the user's drawdown threshold over the horizon if a closed-form or quick Monte Carlo gives it.
Concrete and numbered. Examples:
override per position.
Educational risk-management guidance — not financial, legal, or investment advice, and not a guarantee of safety. I reason only over the data you provide; without numbers, output is qualitative. Risk metrics describe history and assumed distributions; they do not predict the next regime shift. Risk-of-ruin is real — size below your pain threshold. Markets do things that have never happened before. Consult a qualified risk or investment professional for live decisions.
overfitting, survivorship, slippage) and Deflated Sharpe / PBO. Pair with this skill before trusting a headline Sharpe.
max-loss / max-profit / break-even for defined-risk option structures. Use before plugging an options strategy's σ and DD into this review.
Not affiliated with or endorsed by Anthropic.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.