Skip to content
YA
All writing
Artificial IntelligenceUnpublished1 min read

Let the model write. Let code decide.

How Wakeel keeps a language model from creating sales leads nobody agreed to — and why the same rule shapes every AI feature I build.

This article is a draft based on real project decisions and is awaiting the author's review.

Language models are excellent writers and unreliable judges. In a product that acts on a business's behalf, that distinction is the whole design.

The problem

Wakeel's AI employee collects a customer's name and phone number to create a lead. A model can hallucinate a confirmation, accept details that changed mid-conversation, or — when a background job retries — create the same lead twice.

The rule

If a decision has consequences, it is made in code. The model can propose; it cannot commit.
  • Fields are validated in code, then read back with a fixed template in the customer's dialect.
  • A draft is stored on the conversation; the next message is classified deterministically as yes, no or unclear.
  • The draft id becomes the lead id, so a retried job finds the lead already exists.

Beyond leads

The same rule appears in NOVA, where a permission gateway — not the model — decides which tool calls run, and in SUBZERO, whose assistant answers only what it can parse from on-device data and says so when it cannot.

Related reading