What this recipe does
Patient education copy, discharge summaries, and pharma marketing material often need to reference medications without endorsing one brand over another. This recipe compiles a small rewriter that detects proprietary drug names (Lipitor, Zoloft, Adderall, etc.), looks up the active ingredient in a frozen RxNorm snapshot bundled with the artifact, and substitutes the generic.
The verifier rejects any output that re-introduces a brand name. The lookup table is frozen at compile time so the artifact's behavior never drifts in deployment.
The spec
{
"output_kind": "text",
"verifier": {
"banned_token_regex": "./rxnorm-brands.regex",
"must_preserve_generic_for_each_redacted_brand": true,
"max_edit_distance": 0.4
},
"recall": {
"frozen_snapshot": "rxnorm-2026-01.kolm-recall"
}
}
Compile
kolm compile "strip proprietary drug names, preserve generic equivalents" \ --base qwen2.5-3b-instruct \ --pairs ./drug-redact-gold/*.jsonl \ --recall ./rxnorm-2026-01/ \ --verifier no-brand-names,generic-preserved \ --k-floor 0.88 \ --output drug-name-redact.kolm ok wrote drug-name-redact.kolm k_score=0.91 signature=hmac-sha256 0/135 held-out outputs contained a brand name
K-score gate
Brand-leak metric is exact: any output containing a token from the bundled brand-name regex breaks the chain and is rejected.
Run-time profile
Deploy
# CMS pre-publish hook โ strip brands before patient-facing pages go live: on_publish = (page) => { const safe = kolm.run('drug-name-redact.kolm', page.body); page.body = safe.text; audit.log({ artifact: 'drug-name-redact.kolm', page_id: page.id, k_score: safe.receipt.k_score }); };