esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

When Is AI Not the Answer?

When a fixed rule, an exact sum or a person beats an AI model, and how to say so, explained simply for your AI interview.

In short

AI is not the right tool when the answer must be exact and repeatable, when a simple rule already solves the problem, or when a wrong answer costs more than the time saved. Use plain code for those jobs, and use AI only for the messy part, with checks around it.

11 min readIntermediateCommon · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

I start by asking whether AI is needed at all. If the rule is fixed, like a tax table or a refund cap, plain code is cheaper, faster and easy to test. If the answer must be exact, or a wrong answer would cost a customer real money, I keep the model out of the decision. I use AI for the messy part, like reading a letter or sorting emails, and a person or a check approves what it produces.

When is AI not the answer, in plain words?

A language model reads messy text, sorts things and drafts words well. A calculator, a rulebook or a database does exact work better. Saying AI is not the answer means picking the tool that fits the job, and the simplest one that works is usually the best.

A heuristic is a rule of thumb that a person writes by hand, such as a refund limit of 50 dollars that needs no approval. Plain code runs it the same way every time.

Think of a hospital pharmacy. The dose for a child is worked out from a fixed rule based on weight, and the pharmacist checks it against the prescription. Nobody asks a chatbot to work the dose out from memory. AI belongs where no table exists, such as a handwritten note from a ward nurse.

Key words

Heuristic
A rule of thumb written by hand, run as code.
Deterministic
Same input, same output, every time.
Hallucination
A confident answer from a model that is wrong.
Latency
How long the user waits before the answer appears.

When is plain code the better tool?

Use plain code when the rule is written down and the answer must be exact. Code is deterministic: the same input gives the same output, so it can be tested with fixed inputs. A model may word or number its answer differently on a second run, which makes it harder to test.

  • Fixed rule

    Refund limits, leave days, tax tables

    Write the rule once in code. Change it in one place, and tests check it.

  • Exact sum

    Interest, payouts, fee totals

    A model can add the wrong figure and still sound sure. Code adds it the same way every time.

  • Clear lookup

    Account status, branch hours

    Read the database. A model only repeats what it reads, and adds risk on the way.

Here is a made-up bank's late-fee rule in plain Python. No AI is involved, and a fee with no rule goes to a person instead of being guessed.

Python
# A bank's late-fee rule. Plain code, no AI: the same input always gives the same answer.
FEES = {"late_card_payment": 25, "late_loan_payment": 40}

def fee_for(kind):
    if kind not in FEES:
        return "NO RULE: send to a person"  # never guess a fee
    return "Fee: " + str(FEES[kind]) + " dollars"

print(fee_for("late_card_payment"))
print(fee_for("late_loan_payment"))
print(fee_for("late_gift_card_payment"))

Output

Fee: 25 dollars
Fee: 40 dollars
NO RULE: send to a person

Pick the simplest tool that fits

A new request

what the team wants done

Fixed rule or exact sum?

same input, same answer

Plain code

Rules run in code

tested and repeatable

AI with checks

Model reads messy text

drafts or sorts only

Same answer each time

easy to test

A person checks

before anything counts

Answer goes out

logged for audit

  1. 1The team sorts each request first.
  2. 2Yes: a fixed rule or an exact sum is handled in code.
  3. 3No: the input is messy, so AI can help with the reading.
  4. 4Code gives the same result every time.
  5. 5The model's draft goes to a person before it counts.
  6. 6A repeatable result goes out.
  7. 7An approved draft goes out.
Sort each request first. Fixed rules and exact sums go to plain code, where tests can check them. Messy text can use AI, but a person checks the draft before it counts.
  • “When building applications with LLMs, we recommend finding the simplest solution possible, and only increasing complexity when needed. This might mean not building agentic systems at all.”

    Anthropic

  • “Don't be afraid to launch a product without machine learning.”

    Google

Google's machine learning guide makes the same point with a rule of thumb: if machine learning might double a result, a simple heuristic may already deliver half of that gain. Start with the rule, and add learning only where it pays.

Why can't a model be trusted with exact answers?

A model writes the words that most likely come next. It can give a wrong figure in the same calm tone as a right one, and nothing in the sentence warns you. That is why code should own the numbers, and the model should only explain them.

OpenAI's research on hallucinations argues that standard training and testing reward guessing over admitting uncertainty, so models are pushed to guess rather than say "I don't know".

  • “Strategically guessing when uncertain improves accuracy but increases errors and hallucinations.”

    OpenAI

  • “Remember, although these techniques significantly reduce hallucinations, they don't eliminate them entirely.”

    Anthropic docs

Anthropic's guide on reducing hallucinations suggests three habits: let the model admit uncertainty, ground answers in quoted text, and check each claim with a citation. Running the same prompt several times and comparing the outputs can also reveal a problem, because inconsistent outputs may signal hallucinations.

Tip

Asked how you would handle exact answers? Say the sum or the rule runs in code, and the model only explains the result in words.

What do speed and cost trade-offs look like in a real case?

Anthropic notes that agentic systems (AI that plans its own steps and uses tools) often trade latency and cost for better task performance. An agent that loops through many steps multiplies the wait and the bill. Its errors also compound, because one wrong step feeds the next.

Anthropic's guidance is that workflows (steps your code runs in a set order, with the model at certain steps) offer predictability and consistency for well-defined tasks. Agents suit open-ended problems where the number of steps is hard to predict. For many applications, optimizing a single model call with retrieval (looking up the right documents first) and examples is usually enough.

Here is a made-up insurance claims flow that uses all three parts: code, AI and a person. Each part does the job it is good at.

A claims flow that splits the work

Claim arrives

form, photos, a doctor's letter

Policy check in code

cover, dates, limit

AI summary of letter

drafts, never decides

Adjuster approves

a person signs off every payout

Payment or refusal

logged for audit

  1. 1Code checks the form, dates and cover first.
  2. 2Claims that pass the policy check go on to the letter reader.
  3. 3The model's summary goes to a person.
  4. 4The adjuster signs off, then payment or refusal follows.
A made-up claims flow that splits the work. Code checks the policy, the model only summarises the doctor's letter, and an adjuster signs off every payment. The model never sets the amount by itself.

Even for its coding agents, Anthropic says human review is still needed to make sure solutions fit the wider system's requirements. That agents guide is from December 2024. Its own note says much of its tooling has changed since, and points to Anthropic's newer Managed Agents guidance, so check that before you quote the tooling.

How would you decide whether to add AI to a claims team?

Ask three questions: what does a wrong answer cost, how fast must it be, and who checks it? If the output is a payout amount, code sets the number and a person approves it. The model can summarise the letter, which saves time without deciding the pay.

  • Without a check

    The model pays

    It reads the letter, guesses a figure, and the payout goes out. One bad guess costs real money.

  • With a check

    Code and a person decide

    Code sets the limit, the model drafts the summary, and an adjuster approves. Most errors get caught before money moves.

What does the interviewer want to hear?

A strong answer covers

  • A clear test: is the rule fixed, is the answer exact, and what does a wrong answer cost?
  • Plain code for fixed rules, sums and lookups, because it can be tested.
  • AI for messy text, with checks in code and a person for the final call.
  • Honesty about cost and speed: each model call adds delay and spend.
  • The simplest version first, then added complexity only when it helps.
  • A real example from your own work, with the trade-off you chose.

Common traps

  • Trap"Every problem can be solved with AI."

    BetterOnly the messy part needs AI. Fixed rules and sums belong in code, which you can test.

  • Trap"A bigger model will be more accurate, so use it."

    BetterA bigger model can still guess with confidence. Add checks and let it say it does not know.

  • Trap"Agents handle anything open-ended, so build one."

    BetterAgents add cost and compounding errors. Use the simplest fix first, such as one model call with retrieval, or a fixed workflow for well-defined tasks. Use an agent only where the steps cannot be fixed in advance.

Can you spot the wrong tool?

Spot the right split

A bank's assistant is asked for the late fee on a card payment. Which reply shows the right split?

Quick check

A team wants AI to work out a claim payout from the policy limits. What is the best advice?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q158Workflow vs agent?10 min
  2. Q196Agent vs RPA vs a plain script?11 min
  3. Q023What is a hallucination, and why does it happen?11 min
  4. Q187How do you control agent cost?13 min
  5. Q264When do you need human evaluation?10 min
  6. Q281Fine-tune vs RAG vs prompting: when to use which?10 min

Learn it in depth

Last updated on 27 November 2026

Deciding whether a process needs AI at all?

I design and build AI products and agents, including the plain code and the checks around them. Book a short call and tell me which step you are unsure about.