Pradumya Gaurav, backend engineer

Node.js, queues and LLMs, from Bengaluru.

Email me

Notes ·

Fail closed: letting a model decide only what it is sure about

Four places I added AI to a verification pipeline, and the one rule they share: when the model is unsure, a person decides.

When people hear “we added AI to the pipeline”, they picture the model doing the whole job. The version that actually ships is smaller. The model takes the cases it is sure about, and everything else goes to a person, the same as before. That is what “fail closed” means here: if anything goes wrong or the answer is unclear, the system falls back to the human path, not to a guess.

Here are four places I built that way at a background-verification platform.

1. Cropping documents

About 23% of uploaded documents used to need someone to crop them by hand: photos taken at an angle, with a table or a hand in the frame. I built a small Python service with YOLO and OpenCV that finds the document, straightens it and crops it.

On an offline benchmark of 411 production images, correct results went from 19.5% to 43.8%, about 2.25 times better. When a crop succeeds, the ops task closes itself. When it does not, the image goes to a person exactly as before. Nothing gets worse for the cases the model cannot handle.

2. Reading free-text answers

Employment checks used to stop when a free-text field could not be parsed: of 503 blocked checks in the baseline, 456 had a blank comment. I replaced the hard block with an LLM that reads the text and decides whether the check can start. If the input is ambiguous, the check stays blocked for a person to look at.

3. Grading clear answers

When a reporting manager confirms a candidate plainly, that answer can be graded straight away. Before, about 60 checks a day sat waiting in an in-between state, at roughly 20 minutes of ops effort each. Now clear confirmations go straight to verified and quality check. Unclear ones still wait for a person.

4. Routing replies

The reply classifier in our reference checks sorts each reply into one of 8 labels. In the WhatsApp version, about 90% of inbound replies were routed automatically, and the rest went to agents.

The pattern

Each of these has the same three parts:

  1. A narrow job. Crop this image. Is this text usable. Is this a clear yes.
  2. A confidence line. Above it, the system acts. Below it, nothing changes.
  3. The old path stays. The person who used to do the work still gets every case the model passes on.

This makes AI an easy yes for an ops team. They are not trusting a black box with everything, only with the obvious cases, and they keep the hard ones.

It also makes it easy to measure. You can count what the model closed, what it passed on, and whether anything it closed came back.

Stack: Python with YOLO and OpenCV, Node.js, AWS Bedrock.

If part of your team’s day is checking things a model could sort, with a person for the unclear ones, let’s talk.

All notes