Skip to content
September 24, 2026· 6 min read

Keeping an AI Copilot From Making Up Numbers

Mako's tokenomics dashboard, showing supply, price and health score charts for a simulated token design.

Mako is a tokenomics design simulator. You set up supply emissions, vesting schedules, staking and demand growth, and it shows you what the token’s supply, price and health look like over a multi-year horizon. It also has an AI copilot that can read your design, suggest changes, and apply them for you.

The moment you add a chat model to a tool that produces numbers, you’ve created a specific risk: the model can just say a number that isn’t true. It sounds plausible, has the right units, and is wrong. For a financial simulator that’s the product failing quietly, not a cosmetic bug.

Here’s how Mako is built so that doesn’t happen to the numbers themselves, and where that protection stops.

The engine is the only source of truth

Every number Mako shows comes from a pure TypeScript engine, about 19 files and 1,245 lines, with no model involved:

  • Supply is solved with RK4 integration over dS/dt = E(t) - burnCoeff * S, with a supply cap and a deflation floor.
  • Vesting is a cliff followed by linear release; emissions support four shapes: linear, exponential decay, halving, logistic.
  • Price comes from the equation of exchange, P = Q / (V_eff * S), where V_eff = velocityBase * (1 - stake share) and demand grows yearly. The original template had this equation upside down, the kind of bug that looks fine until you check the units.
  • Staking APR has an optional feedback loop, alongside a treasury runway calculation.
  • Governance concentration is scored with HHI, one-token-one-vote against quadratic voting, and a rough four-prong Howey test heuristic flags possible securities-law exposure, labelled plainly as not legal advice.
  • A 0-5 health score rolls up five axes into one number. The comment next to it says exactly what it’s for: “This is deterministic, the LLM never invents it.”

That last line is the whole architecture in one sentence. The model is allowed to talk about the health score. It is never allowed to compute one.

All of this runs on inputs validated by Zod first, with bounds chosen for solver stability, not just sanity: horizon capped at 50 years, 1 to 365 steps per year, at most 20 vesting buckets. A chat interface is an easy way to hand a numerical solver something hostile, so those limits are also what keep the server from doing unbounded work.

Monte Carlo you can reproduce

Mako’s risk analysis runs Monte Carlo simulations of the price path: 5,000 paths by default, with 95% and 99% VaR, seeded with mulberry32 and a default seed of 42. Same seed, same output, every time.

The PRNG’s header comment is the whole contract:

// Seeded PRNG so Monte Carlo results are reproducible (same seed => same output).
// mulberry32 ... NOT cryptographic.

The jump-diffusion model is built so its mean converges to the deterministic price path, not some separate drifting estimate. A test asserts reproducibility for a fixed seed, so nobody can “fix a bug” later by accidentally making the risk numbers non-deterministic.

Feeding the model only verified numbers

The “AI strategy analysis” feature re-runs the simulation and the Monte Carlo server-side, then hands the results to the model as labelled, fenced blocks:

=== DATA: YEARLY SIMULATION RESULTS (ground truth) ===

Health score, governance metrics, the regulatory heuristic, Monte Carlo output with its seed and path count, and engine warnings all go in as their own sections, formatted by a helper whose comment reads “Round for display without lying about precision”: don’t show six decimal places for a figure that’s only accurate to two.

The system prompt is blunt about what the model can do with this data:

The numbers in the DATA section are ground truth. Do NOT invent, alter, or recompute different figures. Cite the provided values exactly.

If you reference a number, it must match the DATA section.

The health score and its axes are provided; explain them, do not re-score.

The charts in the UI are always drawn from the engine’s output too. The model narrates a dashboard, it doesn’t paint one.

A copilot with two tools, not a free hand

The chat copilot can actually change your design, which makes it the riskier surface. It has exactly two tools. get_analysis returns engine-computed metrics rounded to 4 significant figures, described to the model as something to “use before advising so all numbers are grounded.” update_params lets the model propose a patch, deep-merged into a working copy and re-validated against the full Zod schema. An invalid patch returns an error and changes nothing, your design stays untouched until something valid comes back. The chat’s system prompt repeats the analysis feature’s rule: “ALWAYS ground quantitative claims in tool outputs, never invent numbers.” The model can change your inputs; it can never change what the engine computes from them.

Every proposed change goes through a human first. The server returns the proposed params alongside a code-computed diff, not the model’s description of one. The default “control” mode shows “Proposed changes (N)” with an “Apply to design” button; a “full” mode auto-applies instead, with undo if the model got it wrong.

Guardrails around the model itself

A chat loop with tool access can run away from you, so there’s a cap of 4 tool iterations per turn and a 16-turn history window, since the params snapshot already carries the real state. Refusals are detected via stop_reason: "refusal" and surfaced as a clear 422 instead of a silent empty response.

The project name and description, the two fields a user fully controls, are wrapped in an <untrusted_user_text> fence with an explicit rule that their contents are data, not instructions, and the model’s markdown replies are rendered through rehype-sanitize. The provider layer sits behind one interface: Anthropic by default, with an OpenRouter adapter translating tool calls, a cheaper model for chat and a stronger one for analysis.

Tests as the actual guarantee

None of this matters if it isn’t checked. Tests capture the exact prompt sent to the model and assert it contains the ground-truth DATA blocks and the untrusted-text fence. A separate test sends an invalid patch through update_params and asserts the stored params didn’t move. Over 100 tests cover the project, and the ones I care about most are the ones that would fail loudly if someone quietly removed a guardrail during a refactor.

What this doesn’t solve

Here’s the honest limit: nothing in Mako checks the model’s prose after it answers. If the model writes a sentence with a number in it, no code diffs that number against the engine’s output. Everything above is about what the model can do, not what it can say. It can’t write numbers into the design or the charts, those stay engine-only, but it could still state a wrong figure in a reply, and nothing today catches that.

A reasonable next step is extracting numbers from the model’s reply and diffing them against the ground-truth values it was given, flagging a mismatch before the user sees it. I haven’t built that yet, and I’d rather say so than let the tool-calling architecture imply a guarantee it doesn’t make.

What I’d tell you

  • Separate “can compute” from “can describe.” The model should never do the math itself.
  • Feed the model data, not trust. Label it, fence it, and say explicitly what it’s allowed to do with it.
  • Validate everything a model proposes, the same way you’d validate input from an untrusted client, because that’s what it is.
  • Keep a human on the apply button for anything that changes real state.
  • Say what you haven’t verified. Stopping a model from inventing structured output isn’t the same as fact-checking its prose, and that difference matters.

Get in touch

Tell me about your project, role or idea. I usually reply within a couple of days.

I only use your name, email and message to reply to you, never for marketing. Spam protection by Cloudflare Turnstile.Privacy policy

Esc