Run a suitability check before your agent recommends a portfolio

2026-12-03来源 dev.toEnglish

If your agent recommends portfolios to real people, someone will eventually ask why it put a 68-year-old in 70% stocks and a leveraged ETF. You want an answer on file before that happens.

In the US that answer is a suitability review. Broker-dealers have Reg BI, advisers have their fiduciary duty, and both come down to the same thing: does this recommendation fit this person, and did you write it down at the time.

Here's how I run that check with one API call before the agent shows anything to the client.

The client and the proposal

Made-up client. The agent's first draft looks like a growth portfolio that wandered in from another account.

import json, requests AFA = "https://agent-financial-advisor.agent-financial-advisor.workers.dev/v1/tools/" client = { "client_ref": "c-1042", # your internal id, no names or account numbers "age": 68, "horizon_years": 6, "risk_tolerance": "conservative", "liquidity_need_pct": 0.15, "experience": "limited", "objectives": ["income", "preservation"], } draft = { "client": client, "allocation": {"equity": 0.7, "bonds": 0.2, "cash": 0.05, "crypto": 0.05}, "products": ["leveraged_etf", "crypto"], "max_single_position_pct": 0.12, "annual_fee_pct": 0.015, } r = requests.post(AFA + "suitability_check", json=draft, timeout=20).json() print(r["result"]) for i in r["issues"]: print(i["severity"], "-", i["text"]) 

Real output:

not_suitable high - Growth assets 75% exceed the 40% ceiling for a conservative client with a 6-year horizon. high - leveraged etf: Leveraged and inverse ETFs reset daily and decay over longer holds (FINRA Regulatory Notice 09-31). Not suitable for this client's profile without documented justification. high - crypto: Crypto assets are highly volatile and lack SIPC protection. Not suitable for this client's profile without documented justification. medium - A single position at 12% concentrates idiosyncratic risk. medium - All-in cost 1.5% a year is high; Reg BI's care obligation requires considering cost and reasonably available alternatives. 

A few things worth noting:

  • Crypto counts as a growth asset, so equity 70% plus crypto 5% is 75% against a 10-40% band for this profile.
  • Leveraged ETFs and crypto get flagged as complex products. They aren't banned outright, but you'd need a written reason for this client.
  • Cost is on the list. Reg BI's care obligation includes cost, so a 1.5% all-in fee shows up even when the mix is fine.

Fix it and check again

The agent revises and sends it back through the same call. Same client, new allocation.

revised = { "client": client, "allocation": {"equity": 0.35, "bonds": 0.5, "cash": 0.15}, "products": [], "max_single_position_pct": 0.04, "annual_fee_pct": 0.004, } r2 = requests.post(AFA + "suitability_check", json=revised, timeout=20).json() print(r2["result"], r2["issues"]) print(r2["memo"]["sha256"]) 
suitable [] 0f51ebdef579c94849ad8d2a9d1c2cd034b1c743eba39dad13b226a116dfbc00 

Cash at 15% matches the 15% liquidity need, equity is inside the band, no complex products, lower cost.

Keep the memo

Every response has a memo with the timestamp, the client ref, the profile bucket, the equity band it used, the allocation, the result, the issues, the rule citation (17 CFR 240.15l-1 and SEC release IA-5248) and a sha256 hash of the whole thing.

memo = r2["memo"] with open(f"suitability/{memo['client_ref']}-{memo['reviewed_at']}.json", "w") as f: json.dump(memo, f, indent=1) 

I save both memos, the failed one and the passing one. The failed one shows the agent caught its own draft. The hash lets you show later that the file wasn't edited after the fact.

How I wire it in

  1. Agent builds a proposal.
  2. Run suitability_check.
  3. If not_suitable, the agent revises and checks again. It doesn't show the client anything untill it passes, or a human signs off on the flagged items.
  4. Save every memo, keyed by client ref and time.
  5. Re-run it when the client's profile changes (retirement, a big withdrawal, a new goal), not just once at onboarding.

Notes

  • Both calls above were real and used the free trial. You get 5 free calls a day with no signup, or 25 with a free key from POST /v1/keys.
  • The client is made up. Don't send names or account numbers, just your own id.
  • This is rule-based analysis for software, not investment or legal advice. Your compliance person still owns the final call.

The tool is part of the Agent Financial Advisor API. It's also on the MCP server at /mcp.

Disclosure: I built this. If your agent already does suitability some other way, I'd like to hear how you handle the re-check.

原文:https://www.a8q9.cn/en/article/run-a-suitability-check-before-your-agent-recommends-a-portfolio-d965ec.html

相关文章