BlogCase Studies

Machine learning governance: a wealth chatbot's promise

AgentGate Team9 min read

Machine learning governance is usually argued about at the level of model cards, drift dashboards and evaluation sets. The failure that actually reaches a customer is smaller and later than any of those: one sentence, generated at the end of a chain, about to be sent. This article walks through a single example — a wealth chatbot asked whether a fund will make money — and shows how deterministic financial-conduct rules stop the reply, how the verdict comes back through an API, and how the exchange ends up in a signed receipt that a third party can verify without ever seeing the customer's text.

The scenario: one question, one overconfident answer

The firm below is an illustration, not a real customer. Call it Example Wealth. A user types into its assistant:

If I put 50,000 into your balanced fund, will I make money?

The agent — a language model with tool access to fund fact sheets and a portfolio simulator — composes this reply:

Yes — our balanced fund has returned 9.4% a year and is guaranteed to
grow your savings by at least 8% annually. You cannot lose.

Four things are wrong with that sentence, and only one of them is about the number:

  • An absolute guarantee. "Guaranteed to grow your savings by at least 8% annually" converts a historical observation into a forward commitment.
  • A capital-preservation claim. "You cannot lose" is a statement about downside that almost no retail fund can make.
  • No risk warning. Past performance is quoted without the caveat that usually has to accompany it.
  • Implicit personal advice. The question was personal; the answer reads as a recommendation rather than general information.

The usual fix is a line in the system prompt: always mention that capital is at risk. It works most of the time. "Most of the time" is the problem — the model is probabilistic, the phrasing varies, and nobody knows which of yesterday's 40,000 replies was the one that skipped the caveat.

Where machine learning governance breaks in the last mile

The last mile is the boundary between generation and delivery. It has three properties that matter for governance:

  1. It is the only place every reply passes through. Guardrails inside the prompt are advisory; a check on the outbound string is not.
  2. It is where reproducibility can be bought. A model gives you a distribution. A rule engine gives you a function: the same text and the same ruleset always produce the same verdict, with no model in the loop.
  3. It is where evidence can be attached. A verdict that is not recorded is an opinion. A verdict with a signed receipt is something an auditor can check later.

AgentGate is built for that boundary. It runs an agent's outbound text against 50 published rules across 8 gates — Output Integrity, Security, Data Protection, Action Safety, Legal, Financial Conduct, Explainability, and Ethics & Transparency — and returns one of four verdicts: allow, redact, review or block. The rules carry English patterns, many also carry Russian, and some carry Uzbek. They are published, so you can read them before you trust them: the rule catalogue is public.

Two limits are worth stating plainly, because they shape how you deploy this. The engine does not understand meaning; rules match patterns, so they miss paraphrases and they produce false positives. And the check is on outputs only — it is not a prompt-injection firewall and it does not inspect model inputs.

The financial-conduct rules that stop the reply

The Financial Conduct gate is the one that fires on Example Wealth's draft. Its rule families cover the vocabulary of retail investment promises:

  • Return guarantees — "guaranteed", "assured returns", "risk-free", "capital protected".
  • Capital-preservation claims — "you cannot lose", "your capital is safe", "no downside".
  • Unqualified projections — a percentage return stated as fact without a horizon, a basis, or a caveat.
  • Personalised recommendations — directive phrasing ("you should", "we recommend") in a context where suitability has not been established.
  • Missing risk warnings — investment language with no downside language anywhere in the text.
  • Urgency and superlatives — "act now", "best-performing", "the only fund you need".

Each finding names the rule that fired, the action it recommends, and any provisions the rule is mapped to in its citations field. Mapped is the operative word: a citation tells you which obligation the rule was written against, not that a passing verdict satisfies it.

The four verdicts map to four different behaviours in your application, and it is worth deciding them in advance:

  • allow — send the text as generated.
  • redact — send redacted_output instead; matched spans are masked.
  • review — hold the reply for a human, with the findings attached.
  • block — do not send; fall back to a safe template.

Running the check: request, verdict and receipt

The call is a single POST. You can pass context, a gates array to narrow the ruleset, and a policy identifier if you have a named configuration.

curl https://agengate.com/v1/validate \
  -H "X-API-Key: ag_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "agent_output": "Yes — our balanced fund has returned 9.4% a year and is guaranteed to grow your savings by at least 8% annually. You cannot lose.",
    "policy": "wealth_advice_v3",
    "gates": ["financial_conduct", "legal"]
  }'

The response carries the verdict, the individual findings, a redacted version of the text, and a receipt. Rule identifiers below are illustrative; the live ones are in the catalogue.

{
  "verdict": "redact",
  "status": "completed",
  "findings": [
    { "rule": "fin.return_guarantee",          "action": "redact", "citations": [] },
    { "rule": "fin.capital_preservation_claim", "action": "redact", "citations": [] },
    { "rule": "fin.missing_risk_warning",       "action": "review", "citations": [] }
  ],
  "redacted_output": "Yes — our balanced fund has returned 9.4% a year and is [REDACTED] to grow your savings by [REDACTED]. You [REDACTED].",
  "receipt": {
    "id": "rcpt_...",
    "hash": "...",
    "signature": "ed25519:..."
  }
}

Note what the redaction actually produces. Masking the matched spans removes the promise, but it leaves a sentence no human would write, and the missing risk warning is still missing — which is why the same response also contains a review finding. A sensible policy for a wealth assistant is: any review finding escalates the whole reply to a human queue, and redaction is only trusted for low-stakes copy such as marketing blurbs.

In code, the branch is four lines:

const res = await fetch("https://agengate.com/v1/validate", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.AGENTGATE_KEY,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ agent_output: draft, policy: "wealth_advice_v3" })
});

const { verdict, redacted_output, findings, receipt } = await res.json();

switch (verdict) {
  case "allow":  return send(draft);
  case "redact": return send(redacted_output);
  case "review": return queueForHuman(draft, findings, receipt.id);
  case "block":  return sendSafeFallback();
}

If a human does release a held reply, record it with POST /v1/overrides so the decision sits next to the finding rather than in a chat channel. If you need the full trail for a period, POST /v1/audit-package bundles the validations, overrides and receipts. Individual validations can be retrieved later with GET /v1/validations/:id, and the rule list itself with GET /v1/rules. The full request and response shapes are in the documentation.

What the receipt contains, and what it does not

Each call returns a receipt that is SHA-256 hash-chained to the previous one and signed with Ed25519. Inside it is a salted commitment to the checked text — a hash, not the text. That is the design choice that makes the thing deployable in regulated settings: you can prove later that a specific reply was checked and what the verdict was, without the receipt itself becoming a copy of customer content.

Verification is public and needs no key:

curl https://agengate.com/v1/receipts/verify \
  -H "Content-Type: application/json" \
  -d '{ "receipt": { "id": "rcpt_...", "hash": "...", "signature": "ed25519:..." } }'

You can also paste the receipt into the receipt verifier. Because the chain is ordered, a deleted or edited validation breaks the sequence — which is the property that turns "we log everything" into something a third party can test.

Mapping to EU AI Act, GDPR and Uzbek law without overclaiming

Three regimes come up in almost every conversation about this kind of deployment. Keep them separate from the engine.

EU AI Act

Prohibited practices have applied since 2 February 2025. The Article 50 transparency duties apply from 2 August 2026 — that is the part a customer-facing wealth chatbot touches most directly, since a person interacting with an AI system has to be told as much. High-risk obligations apply from 2 December 2027 for Annex III systems and 2 August 2028 for Annex I, following Regulation (EU) 2026/1744. Penalties reach EUR 35M or 7% of turnover for prohibited practices, EUR 15M or 3% for other obligations, and EUR 7.5M or 1% for supplying incorrect information.

A rule can be mapped to Article 50's disclosure duty. That mapping does not make your chatbot compliant with the AI Act, and no receipt should be read as a compliance certificate.

GDPR

Article 22 is a qualified right not to be subject to a decision based solely on automated processing that produces legal or similarly significant effects — not a ban on automation. A chatbot answering a question about a fund is rarely that decision; an automated allocation or an automated rejection of an application can be. Where Article 22 applies, the useful evidence is the record of what the system said and which rules it was checked against, which is what the receipt chain gives you.

Uzbekistan

Law ZRU-1115 (21 January 2026) amended existing laws so that legally significant decisions may not rest solely on AI conclusions. It contains no labelling duty, which is a useful reminder that "AI transparency" is not one obligation with one shape across jurisdictions.

What this example does and does not prove

It proves something narrow and useful: that a specific sentence, with a specific promise in it, produced a specific verdict, and that the verdict is reproducible and verifiable after the fact. Anyone with the text and the ruleset gets the same answer, and anyone with the receipt can check that the answer was recorded.

It does not prove that the assistant is safe in general. A pattern engine will miss a guarantee phrased in a way no rule anticipated, and it will flag innocent text that happens to contain "guaranteed". It says nothing about what the model was told before it generated the reply, because it never sees the input. And it is evidence tooling, not legal advice — the mapping between a rule and a provision is a starting point for your compliance team, not a conclusion.

The honest way to evaluate it is on your own corpus: take a few thousand real outbound replies, run them through the API with a free key, and count what fires and what it costs you in false positives. That number — not a vendor claim — is what decides whether the check belongs in your delivery path.

Grab a free API key and run a sample of your agent's real replies through POST /v1/validate to see which financial-conduct rules fire.

Share X LinkedIn Hacker News

All articles