Skip to main content
AI Fin Hub

Playground

Structured Schema Validator for Finance

Structured schema validator finance — paste LLM JSON, see missing fields, type mismatches, enum errors, and plausibility flags.

Runs in your browser. Nothing you enter is uploaded, and no account or API key is needed.

Education, not investment advice. Past performance does not predict future results. How we check our numbers.

1. Pick a schema

LLM research note on an investable idea. Must declare a probability, a thesis, and explicit invalidation conditions — every research output that cannot be falsified is just narrative.

Schema definition

FieldType / boundsReq
probabilitynumber [0 … 1]
Subjective probability the thesis plays out. 0..1 inclusive.
required
thesisstring ≥50 chars
Plain-English thesis. Minimum 50 chars — forces substance over one-liners.
required
convictionenum (low|medium|high)
Qualitative conviction bucket.
required
invalidation_conditionsarray ≥1 items
Explicit events that would kill the thesis. ≥1 item.
required
source_citationsarray ≥1 items
URLs or document IDs backing the claims. ≥1 item.
required

Valid example

{
  "probability": 0.62,
  "thesis": "Issuer SYNTHETIC_A's cloud-revenue mix is re-rating vs peers after three consecutive quarters of operating-margin expansion, while the sell-side model still assumes the legacy mix.",
  "conviction": "medium",
  "invalidation_conditions": [
    "Next quarter cloud-revenue growth prints below 20% YoY",
    "Operating margin contracts by more than 150 bps"
  ],
  "source_citations": [
    "10-Q FY2026 Q1, p.14",
    "Earnings call transcript 2026-02-11"
  ]
}

2. Paste your LLM JSON

Validation runs in your browser as you type. Nothing is uploaded.

Schema validity

100%

5 / 5 fields passed, overall pass

Schema: Research Output

3. Validation results

StatusFieldMessage
✓probabilityok
✓thesisok
✓convictionok
✓invalidation_conditionsok
✓source_citationsok

What gets checked

  • Field presence, JSON type, enum values, numeric bounds, minimum string / array sizes.
  • Cross-field sanity (long stops below take-profit, leverage above retail limits, duplicate peer tickers).
  • Soft plausibility bands drawn from real-world issuer filings — out-of-band values warn, not fail.
  • Missing unit / GAAP-basis heuristics for revenue / EPS / EBITDA field names.

How to use it

  1. Pick one of the four reference schemas: research output, trade decision, risk snapshot or peer comparison.
  2. Paste the LLM output JSON. The schema's valid example loads first; Load broken injects typical model errors.
  3. Read pass or fail and the per-field results: missing fields, wrong types, enum and range violations, text that is too short.
  4. Read the sanity flags: values outside plausible bands and cross-field problems, such as a long trade with its stop above its target.
  5. Fix the prompt or schema where fields fail repeatedly, and validate every output in code before it reaches anything that trades.

Questions people ask

What schemas does the validator check?

Four reference schemas for finance LLM outputs: research output, trade decision, risk snapshot and peer comparison. Each defines required fields, types, enums, numeric ranges and minimum lengths, and ships with a valid example. Custom schemas cannot be uploaded.

Why use this instead of plain JSON Schema validation?

The field checks are what JSON Schema does. The extra layer is sanity checking: soft plausibility bands for numbers, and cross-field rules such as stop-loss below take-profit on a long trade, a target ticker repeated in its own peer list, or leverage above Reg T limits. Sanity flags are warnings and do not fail validation.

What does it report?

Pass or fail, a status and message for every schema field, a parse error when the text is not valid JSON, and the list of sanity flags. It validates one output at a time.

Can it validate streaming outputs?

Only complete JSON. Validate the output once the stream has finished; a partial document fails to parse.

How strict should I make the schema?

Strict enough to catch real errors, loose enough not to reject legitimate variation. A common pattern is tight validation on machine-consumed fields (numbers, enums, IDs) and looser validation on human-readable ones (descriptions, summaries).

  • Playgrounds Hallucination Detector

    Paste a source document + an LLM's extraction. Every numeric claim in the output is checked against the source. Client-side. Catches silent fabrication.

  • Playgrounds Agent Skill Tester for Markets

    Paste a SKILL.md definition + sample input + your Anthropic API key. See structured extraction, token cost, and latency — all in your browser. No signup.

  • Playgrounds Prompt Regression Tester

    Run the same prompt against multiple models (Claude 4.5/4.6/4.7, GPT-5, Gemini 2.5) with your own keys. Diff outputs, score drift, catch regressions.

All articles

Use it from code

The same calculation as a JavaScript module you can import. It runs where you import it, with no request, key or rate limit.

import { compute } from "https://aifinhub.io/engines/structured-schema-validator-finance.js";

Input and output contract and the guide for agents.