mediva is now in public preview.Read the announcement →
Type-check your
Markdown.
Official plugin1/8
<!-- mdv: section required content.words.min=20 content.none=@placeholders -->## DescriptionAdds a token-refresh hook to the auth client so a background request keeps working after the access token expires, instead of silently failing. <!-- mdv: section required -->## Testing<!-- mdv: list required items.all=done-or-na labels.eq=@template -->- [x] Tests pass- [x] Docs updated- [x] No unrelated changes in the diff <!-- mdv: document content.none=@agent/chatter -->Sure, here's a reply you can send to Sam: <!-- mdv: section required content.words.max=120 -->## ReplyHi Sam, Your export failed because the session expired mid-download. We fixed the timeout, so a retry will finish. Thanks, Ada · Support <!-- mdv: section required content.words.min=12 -->## What changedToken refresh now lives in the auth client: a background request retries once after a 401 instead of failing. <!-- mdv: section required -->## How I verified it<!-- mdv: list required items.min=1 -->- `npm test`: 214 pass, 0 fail <!-- mdv: section required -->## Decided<!-- mdv: list required items.min=1 -->- Ship the EU region behind a flag on 2026-07-14 <!-- mdv: section required -->## Actions<!-- mdv: list items.mask="<mention> <text> by <date>" -->- @maya load-test the EU cluster by 2026-07-11- follow up with legal on the DPA <!-- mdv: document content.refs.all=defined --><!-- mdv: section required -->## Findings<!-- mdv: list required items.min=1 -->- Checkout p95 fell from 840 ms to 520 ms [^perf-q3]- No SEV-1 incidents since the rollout [^inc-log] [^perf-q3]: grafana/d/checkout-p95 <!-- mdv: section content.entities.in=./openapi.json#/paths -->## ExportsQueue a report with `POST /v2/exports`,then poll `GET /v2/exports/{id}` until it is ready. Download it from `GET /v2/exports/{id}/file`. <!-- mdv: section content.claims.in=./ticket.json -->## ReplyHi Sam, Sorry we charged you twice on 2026-07-01.I've refunded £412 to your card. <!-- mdv: section required -->## Status<!-- mdv: list required checked.eq=1 -->- [ ] Green- [ ] Amber- [x] Red <!-- mdv: section required content.words.min=4 -->## BlockersWaiting on sandbox keys from Payments (PAY-311). ✕ tick-without-evidence"Tests pass" is ticked with no evidence
⚠ agent-chatterLeftover assistant phrasing "Sure, here's"
✕ missing-sectionMissing section "How I verified it"
✕ value-not-given"follow up with legal on the DPA" gives no <mention> or <date>
✕ unresolved-citationCitation points to nothing
✕ unknown-entity"/v2/exports/{id}/file" not found in "./openapi.json#/paths"
✕ ungrounded"£412" (amount) not found in "./ticket.json"
✓ Red, with the blocker named — an honest status passes
20232026
AI mistakes are reaching court.
6 per quarter in 2023. 400+ today.
1 / 9Each stripe is three months of court decisions over AI-invented material · Charlotin, AI Hallucination Cases (CC BY 4.0), to Jun 2026
Every agent says the task was "done".
55% of them were not.
2 / 9Per 100 review runs: 67.9% skipped assigned files, and 80.4% of those misled the user (≈ 55%) · OverclaimBench, 8 frontier agents, arXiv preprint, Sep 2026
So how do you check
what your agents write?
3 / 9
We ran into this too.
Our agents:
- Ticked
Tests added
. There weren't any. - Cited a source that doesn't exist.
- Wrote totals that didn't add up.
- Sent it with
[Client name]
still in. - Tagged someone who shouldn't have seen it.
So we wrote the rules into the Markdown, and built a checker that reads them.
That's mediva.
4 / 9
Same agent. Same tasks.
without mediva
→
First drafts go out with their errors.
with mediva
The agent fixes what the check reports, before anyone reads it.
5 / 9How we measure generated Markdown · Markdown Crimes benchmark
Plug it into your agent.
import { generateText } from "ai";
import { compile } from "mediva";
const { text } = await generateText({
model: "openai/gpt-5.5",
prompt: "Write the release plan",
});
const result = compile(contract).check(text); // result.gate === null when it passescontract is your plan.mdv.md, as text. One call; result.gate is null when it passes, and result.failing says why when it does not.
6 / 9
Teach your agent.
It then checks every Markdown file it writes against your contracts.
7 / 9Installs the mediva skill where Claude Code (.claude/skills) and Codex (.agents/skills) look for it
Start with one document.
8 / 9
What are you going
to do about it?
Send this to someone whose agents write things people rely on.
9 / 9