Skip to content

Back to Articles

5 min read ·

Rules first, then the model

The fastest way to learn a business is to build a tool that refuses to guess. In April I built one for the commercial invoices at a customs broker, with zero model calls, and it turned about 40 minutes of manual work per invoice into about 3 seconds of machine time. The model gets its turn later, and only where the rules run out.

Forward deployed engineer is the job title of the spring. On May 11 OpenAI launched the Deployment Company, a subsidiary with more than $4 billion from 19 firms. It exists to embed engineers with customers, and OpenAI agreed to buy the consultancy Tomoro to get about 150 of them on day one. The best-known model company in the world is building a consulting firm, which tells you the model doesn't deploy itself. Somebody has to sit next to the people who do the work and write down what they already know.

I spent April being that somebody.

Before a shipment clears, compliance has to check and correct the HSN tariff codes on the supplier's commercial invoice, and ops have to turn the result into the duty CSV that the customs job needs. Ops measured it for one client: about 30 minutes per invoice for the codes, and about 10 more for the CSV. Those people know the tariff better than any model I can rent.

The fix everyone reaches for this year is the LLM reflex. Upload the PDF, ask a model for the codes, pick the invoice where it looks right, demo on Friday. The model guesses at answers that the people down the hall know, and nobody asks them. Why write rules, the pitch goes, when the model can read the invoice?

It can read it. Who checks it?

An HSN code decides the duty, so a guessed code is a guessed duty, and compliance would still read every line. The 30 minutes would stay exactly where they were, now with a token bill and a new kind of error that sounds sure of itself.

I built the boring thing. Version 1 was a Streamlit app on April 15. Version 2, from April 23, is FastAPI with a React and TypeScript front end. It reads the invoice, and rules turn it into a customs duty CSV with 106 columns. I put the whole plan in one comment:

No LLM fallback. Uncertain fields surface as explicit human-review notes.

The processor never fills a gap with something plausible. A wrong rule is wrong the same way on every invoice, so ops catch it once and I fix it once. When a model is wrong, it's wrong somewhere new.

On April 28, 13 days after the first commit, the processor's CSV started to feed the browser agent that creates customs jobs. I've been building that agent since last fall, and for now the link runs for one client, behind a test gate. When the rules block an invoice, it stops before the customs portal and waits for ops. The agent began by asking Gemini to choose every click and spent the winter learning to stop asking, which I wrote about in February.

Every blocked invoice is a question the rules couldn't answer. The HSN mappings in the processor come from ops review sheets. Six weeks in, the code is turning into a copy of what ops and compliance know, and I know it too, because I had to encode it first. The LLM reflex puts the new tool as far from the compliance desk as the building allows.

Rules aren't free, and I'm the one who pays for them. One client alone sends invoices in 7 sub-formats, and the merge that added multi-format support for that client, on May 5, touched 52 files and added 5,272 lines. Every new client means another parser. People who say rules don't scale are right.

I still want them first.

Each of those parsers marks a spot where the rules got expensive, and each human-review note marks a spot where they ran out: a layout that wouldn't sit still, a description that no mapping covered. Together they're the list of jobs I'd give a model, and every item on it comes with an answer that ops checked.

The LLM reflex skips that list. It runs every invoice through a model on day one, pays compliance to check every invoice after that, and learns nothing about the tariff in between.

A model will get its turn the week the rules stop paying for themselves. That week comes when a new format costs more to parse than a model's answer costs to check. Even then, a rule has to catch the model's mistakes before they reach a customs job, and compliance has to see why the model said what it said. That week hasn't come yet.

Pull up a chair at the compliance desk. Bring a notebook.