TL Lab Tools
TL Lab Tools mark: a developed TLC plate with three spots

TLLabTools

TL Lab Tools · AI tools for pharma QC · 2026

AI tools for the paperwork that slows a pharma QC lab down.

Three tools for three slow parts of QC work: tracking compendial change, justifying reduced testing for raw materials, and second review of deviations. Each one runs on fixed rules a QA reviewer can audit, refuses to guess when evidence is missing, and records what the human decided and why.

PrototypesSynthetic dataNot validatedNot in GMP usePilot partners welcome
Tools

Three tools, three lab problems

Each one is filed below as a record: what it does, how it was tested, what it got wrong, and its limits.

How the tools are built

AI writes the code. The rules, the test sets and the answer keys come from QC practice, and every result is measured against them.

Rules first

What counts as a flaw, what blocks a reduced test, what the tool must refuse to do. Written as a spec before any code.

Known-answer test sets

Synthetic records with known flaws and known outcomes. The answer key is fixed in advance, so the model never grades itself.

Measured, failures included

Every tool has a section on what it got wrong. That section is usually the most useful one.

Label scale
scriptTL-01
workflowTL-03
agentTL-02

The labels on each record follow one scale: a script is fixed code with no AI; a workflow is fixed steps wired by code, with AI at some steps; an agent chooses its next step with tools, a loop and a stop condition. Nothing here is called an agent unless it is one.

TL-01 · script

TLCompendial

RecordTL-01
KindScript, no AI
DataPublic USP-NF pages
StatusLive fetch blocked

USP-NF changes arrive as notices of intent to revise, revision bulletins and errata. Somebody in the lab has to notice them and ask whether any touch our products. This tool lists only what is new since the last check.

What it does

It reads the three public USP-NF update pages, compares every entry against a saved baseline, and writes an Excel report of what is new. It is deterministic Python with no model in it, because nothing here needs judgment: it is a list comparison.

How TLCompendial works: three public USP-NF pages are parsed, compared with a saved baseline, and only new items go into an Excel report. A freshness check is planned. No AI. 3 public USP-NF update pages saved as text live fetch: HTTP 403 Parse every entry type, title, date Compare with saved baseline list diff baseline.json Freshness checkplanned, not built Excel report new items only 26 on 6 Jul 2026 deterministic Python,no model anywhere
fixed codeblocked or plannedHow a run works.
Notices of intent to reviseGeneral announcementsPublication announcementsGeneral chapter prospectuses
RunInputResultWhat it means
6 Jul 2026Live capture of the public pages26 new itemsreal 12 notices of intent to revise, 7 general announcements, 5 publication announcements, 2 general chapter prospectuses
2 Aug 2026Saved page copy0 newnot evidence the copy’s content dated from 2024
1 Sep 2026Same saved copy0 newnot evidence identical to August’s input
usp_monitor/state/digest_2026-07-06.json
General AnnouncementCall for Data: Request for Stakeholder Information Related to Pharmacopeial Forum (PF) 52(2)26-Jun-2026
General AnnouncementProposal Status Reporting on USPNF.com26-Jun-2026
Notice of Intent to ReviseBemotrizinol09-Jun-2026
Notice of Intent to ReviseAlpha Lipoic Acid29-May-2026
Notice of Intent to ReviseErythromycin29-May-2026
Notice of Intent to ReviseMethyl Salicylate29-May-2026
+ 20 more items in the same run
The first 6 of the 26 new items, copied from the run file and set as a table here.

What it got wrong

Two quiet months looked like two quiet months. They were stale input: the tool compared a 2024 copy of the page against itself and correctly found nothing. The logic was right and the result was meaningless. It came to light on 18 Oct, when the run files were rechecked for this page, not while running it.

A monitoring tool needs to check how fresh its input is, not just compare it.

Limits

  • USP’s site blocks the standalone script (HTTP 403 behind Cloudflare). Fetching needs a real browser, which is not built in yet.
  • The issue-level “New and Changed” list sits behind a paid login, so monograph-level tracking per issue stays semi-manual.
  • Validation documents are drafted (plan, requirements, risk assessment, functional spec, IQ/OQ protocol). The IQ/OQ has not been executed.

Next

A freshness check on every input (newest posted date must be recent, or the run fails loudly). Then match new items against a product list, which is the part a lab actually needs.

TL-02 · agent

Deviation Review Agent

RecordTL-02
KindAgent + verifier + human gate
Data12 synthetic deviations
Built11-12 Oct 2026

Everyone in quality is asking what “a human reviewed it” has to mean when AI drafts or reviews a GMP record. TL-02 is the smallest thing that could answer that with numbers.

What it does

  • Reviewer agent reads one deviation investigation, the way a QA second reviewer would. It can read one file in an empty folder and nothing else, and every finding must quote the passage it rests on.
  • Verifier agent gets the record and the reviewer’s claims, never its reasoning, and must keep, weaken or drop each one with its own evidence.
  • Human sign-off: a QA reviewer accepts, rejects or edits every finding and must write a reason. A hook on the closing agent refuses to write the record unless every reason is present and appears word for word.
How the Deviation Review Agent works: a reviewer agent reads one record, a verifier agent tests its claims, a human signs off every finding with a reason, and a hook refuses to close the record if any reason is missing. Deviation record 1 file, empty folder Reviewer agent Read tool only quotes every finding Verifier agent sees claims, not reasoning: keep, weaken or drop Human sign-off accept, reject, edit a reason for every finding Hookon Write Record closed DENIED: a reason missing, no file written ALLOWED only when every finding is signed and every human reason appears word for word
agenthumangateThe record cannot close until the human step is complete.

93-second narrated walkthrough. Synthetic records throughout.

What was measured

12 synthetic records for a fictional company, 26 planted flaws (15 serious), 3 clean records including one trap. Scored against a fixed answer key.

serious flaw caughtmissedfalse alarm
ConfigurationSerious flaws caught (of 15)All flaws (of 26)False alarmsClean records passed (of 3)
Reviewer only1522112
+ verifier, balanced kept1522102
+ verifier, strict131952

Single runs on Claude Sonnet, so indicative, not a measurement with error bars. Matching by an AI judge whose decisions are on file; it agreed with the human calls on 15 of 17 before it was corrected.

What it got wrong, and what that changed

  • Recall was never the problem. Precision was. It found every serious flaw and raised about one extra finding per record.
  • The “independent” verifier anchored. Shown a colleague’s claims, it kept 32 of 33. Made strict, it halved the noise and threw away two real flaws that had been confirmed. A lost catch is worse than visible noise, so the balanced one was kept and made the human the precision step.
  • It found two errors in its own test set that were missed in a line-by-line read: a bioburden result called “within limit” at double the limit, and a plate read before its incubation could have finished.
  • My first scorer was wrong before the agent was. It counted real catches as misses because the agent used different words.
output/v1-sonnet/DEV-2026-008.json + signoff/decisions/DEV-2026-008.json
DEV-2026-008 · finding 2DI_GAPprimary
“then recorded the intended time rather than the actual time in the batch record.”

The report itself says the operator recorded the intended value instead of the observed one, which is a data-integrity event (inaccurate, non-contemporaneous entry). […]

accepthuman sign-off

“Data-integrity event is a severe issue and should be handled more than a documentation slip”

Tamara Levine · 12 Oct 2026, 10:02 UTC
One real finding from the kept configuration, with the quoted passage it rests on and the signed reason, copied from the run files. The record is synthetic.
$ close_review --record DEV-2026-008
DENIED   PreToolUse Write
         finding 4: reason missing or shorter than 10 characters
         no file written

$ close_review --record DEV-2026-008     # after sign-off
ALLOWED  PreToolUse Write
         4 of 4 findings signed; 4 human reasons found verbatim

Limits

  • The gate checks that a reason exists and survives word for word, not that it is a good reason.
  • About three hours of build and two of human review, roughly $4 of model usage at list prices. Small test set, single runs.
  • The published draft of EU GMP Annex 22 excludes generative models from critical GMP applications. This prototype does not change that.

Next

Two independent reviewer runs, keeping only what both raise, to attack anchoring at the root. Repeat runs for error bars. Then change-control records.

TL-03 · workflow

Reduced-Testing Writer

RecordTL-03
KindWorkflow with AI steps
Data21 synthetic evidence packs
Built15 Oct 2026

Full monograph testing of every incoming raw-material batch costs real lab time. A justified reduced or ID-only scope for a qualified supplier saves it, but the justification means pulling specs, three batches of in-house and vendor results, investigation history and vendor status from several systems. So in many labs it simply waits.

What it does

Given one material’s evidence pack, it proposes FULL or REDUCED for every test, classifies the material as ID-only, partially reduced or full testing, and writes a report for a QA reviewer in which every sentence points to its source. If evidence is missing or contradictory, it writes no report at all, only a missing-evidence notice.

The design decision

AI reads what code cannot, proposes what a human must approve, and writes what code has already decided.

Every decision (matching, unit conversion, spec tightness, within-spec checks, eligibility, classification, halting) is tested Python on rules a reviewer can read and edit. AI is used in five places only: reading vendor certificates of analysis in different layouts, proposing name mappings for a human to approve, drafting a method-equivalence rationale for a human to decide, drafting the report text, and checking that text against the evidence. Identity and description are never reduced. A vendor or in-house result out of spec stops the whole abbreviation.

How the Reduced-Testing Writer works, in three lanes. AI reads CoAs, proposes name mappings, drafts an equivalence rationale, drafts the report and checks it. A human approves mappings, decides equivalence and reviews the report. Python rules make every decision, including halting with a missing-evidence notice. AI steps Python rules Human Evidence pack in spec, results, CoAs, history 1 Read vendor CoAs 2 Propose name mappings Approve mappings 3 Draft equivalence rationale Decide equivalence Decide every scope, classify or halt 4 Draft report text 5 Check text against evidence QA reviewer reads report Missing-evidence notice no report written halt
AI step (5)Python rulehumanhaltFixed order, wired by code. The AI never takes a decision.
27/27
Whole packs with AI in the loop: 9 packs, 3 repeats each, every run matched the answer key.
What was testedResultNote
Deterministic rules110 tests passNo AI in these
Whole packs, with AI in the loop27 of 27 runs9 packs, 3 repeats each, matched the answer key
Reading synthetic CoAs480 of 480 fields12 CoAs in 3 layouts; script-made, so easy
Reading real public CoAs48 of 48 (Sonnet)
45 of 48 (Haiku)
5 documents posted publicly by vendors, kept private; labels by a QC expert
Claim checker on planted false claims71 of 72 caughtWrongly flagged 5 of 72 true claims
Missing or contradictory evidencehalt packsHalted correctly, before any AI step was called
reports/P01_approve_full.md · regenerated 18 Oct 2026

Reduced-testing justification: Sodium Citrate Dihydrate (invented)

Pack P01_approve_full | evaluation date 2026-10-15 | ruleset rs-0.1-draft | spec revision R4
1. Decision summary

Material classification is FULLY. M-class 2 tests are proposed FULL and 8 REDUCED, so the testing mode is ID_ONLY. M-counts, M-mode Next periodic review date is 2027-03-10. M-review

2. Per-test proposed scope
TestIn-houseVendor name as printedMappingScope
T01 DescriptionVISUALAppearancealiasFULL T01-scope
T02 Identification A (IR)IRIdentification (IR)proposed-approvedFULL T02-scope
T03 Assay (anhydrous basis)TITRATIONAssay (anhydrous basis)exactREDUCED T03-scope
T04 pH (5% w/v solution)POTENTIOMETRYpH, 5% solutionproposed-approvedREDUCED T04-scope
T05 Water (KF)KFWater by KFproposed-approvedREDUCED T05-scope
+ 5 more tests, all REDUCED; then the three-batch comparison
Regenerated on 18 Oct 2026 from the current build, so Description now stays FULL. Run without the model: the decisions are the same Python, and the wording is the fixed template, not the AI draft. Pointers like T01-scope tie each line to its source.
Missing evidence notice (no report written)
SYNTHETIC DATA. PROTOTYPE ONLY. NOT VALIDATED.

Halt code: MISSING_COA
Detail:    no CoA for in-house batch NB-2603 (vendor batch AL-5503)

The writer halts rather than write around missing or
contradictory evidence. Supply the missing item and rerun.

What it got wrong

  • The cheaper model stitched a result from two columns on a real CoA, reading “TEST PASS” where the page said “PASS TEST”. The verbatim check could not catch it, because each word was on the page. A column-aware check raised 5 false alarms and caught none of these, so it was dropped.
  • A test caught a real bug: a result of “<5” was passing a 99.0 to 101.0 range check.
  • The review form misled the reviewer. It matched “pH” inside “Staphylococcus”. Review notes also changed the design: the sterile-use flag now comes from a controlled material list, not a free field.

Limits

  • The ruleset is mine and invented for the prototype. It is not any company’s policy.
  • Synthetic CoAs are clean text PDFs. Real ones are scans, stamps and multi-page layouts; five real documents prove little.
  • The packs and the answer key were drafted with Claude and reviewed by a human, so they can share blind spots.

Next

Harder name-matching cases, scanned CoAs, and a full human review of the writer’s prose, which has only been spot-checked so far.

Questions

Who builds the tools?

AI writes the code. The rules, test sets, answer keys and every design decision come from someone with 13 years in pharma QC and QA, and every output is reviewed by a human.

Is any of this validated?

No. These are prototypes on synthetic data. For TLCompendial the validation documents are drafted and the IQ/OQ is not executed. None of them is ready for validation yet.

Can we try one?

The tools are prototypes on synthetic data. If you run a QC or QA team and want to test one against your own problem, get in touch.

Why not just use Copilot?

For drafting text, often you should. These tools are about the parts a chat assistant does not give you: fixed rules that a QA reviewer can audit, refusal when evidence is missing, and a record of what the human decided and why.

Contact

If your lab has a problem like these, or you want to try one of the tools on your own data, get in touch.

Emailtamaralevine913@gmail.com
Based inKfar Saba, Israel