# 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.

AI and LLM interview question Q407, Forward Deployed Engineering and applied AI. Intermediate, common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/when-is-ai-not-the-answer

## Say it in 30 seconds

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.

## Say it in 2 minutes

The first question I ask is whether a model is needed at all. Anthropic's advice for builders is to find the simplest solution possible and add complexity only when it is needed. That can mean not building an agent at all.

AI is a poor fit in three cases. First, when the rule is fixed, like a fee table or a leave policy. Code applies it exactly, every time, and you can test it. Second, when the answer must be exact, like a payout total, because a model can guess a number and sound sure. Third, when a mistake costs more than the time saved and nobody reviews each output.

Where AI does help is the messy part: reading a doctor's letter, sorting emails, drafting a reply. In a claims flow I let code check the policy first, let the model summarise the letter, and have an adjuster approve every payment. The model never sets the amount.

The trade-off is real. An agent costs more and takes longer, and its errors can compound over many steps. So I pick the smallest system that works, and I say that out loud. For many tasks, one well-prompted model call with the right documents attached is enough, and it is far easier to test.

## 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.

- **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:

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

*Diagram, Pick the simplest tool that fits: 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.*
1. The team sorts each request first.
2. Yes: a fixed rule or an exact sum is handled in code.
3. No: the input is messy, so AI can help with the reading.
4. Code gives the same result every time.
5. The model's draft goes to a person before it counts.
6. A repeatable result goes out.
7. An approved draft goes out.

> "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.

*Diagram, A claims flow that splits the work: 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.*
1. Code checks the form, dates and cover first.
2. Claims that pass the policy check go on to the letter reader.
3. The model's summary goes to a person.
4. The adjuster signs off, then payment or refusal follows.

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." Better: Only 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." Better: A 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." Better: Agents 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?

A. The model works out the fee from its own knowledge and writes it in a friendly tone.
B. Code looks up the fee in the fee table, and the model only writes the reply around it.
C. The model adds up interest on the last six statements and quotes the total.
D. The model guesses the fee from similar pages, and a person reads it out.

**Answer:** B. The fee is a fixed rule, so code reads the table and gives the same figure every time. The model only handles the wording. Letting a model work out a fee or a total risks a wrong number on a real account.

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

A. Use the largest model you can afford.
B. Write the limits and the sum in code, and let AI only summarise the claim.
C. Ask the model twice and use the answer it prefers.
D. Skip the rules and let an agent decide each case.

**Answer:** B. A payout is an exact sum from fixed limits, so code does it and can be tested. The model handles the messy text. Asking twice or using a bigger model still gives no guarantee of the same number.

## Can you answer these from memory?

**Flash cards**

- **When is AI not the answer?** When the rule is fixed, the answer must be exact, or a wrong answer costs more than it saves.
- **What is a heuristic?** A rule of thumb a person writes by hand, run as plain code.
- **Why can't a model be trusted with exact sums?** It writes likely next words and can sound sure when it is wrong.
- **What does Anthropic advise first?** Find the simplest solution possible, and add complexity only when needed.
- **What is the main cost of an agent?** More latency and cost, plus errors that compound over many steps.
- **Where does AI help most?** On messy text, with checks in code and a person for the final call.

## Likely follow-up questions

- Q158 Workflow vs agent? https://designervenkat.online/interview/ai/workflow-vs-agent
- Q196 Agent vs RPA vs a plain script? https://designervenkat.online/interview/ai/agent-vs-rpa-vs-a-plain-script
- Q023 What is a hallucination, and why does it happen? https://designervenkat.online/interview/ai/what-is-an-ai-hallucination
- Q187 How do you control agent cost? https://designervenkat.online/interview/ai/how-do-you-control-agent-cost
- Q264 When do you need human evaluation? https://designervenkat.online/interview/ai/when-do-you-need-human-evaluation
- Q281 Fine-tune vs RAG vs prompting: when to use which? https://designervenkat.online/interview/ai/fine-tuning-vs-rag-vs-prompting

## Learn it in depth

- [Where agents pay off](https://designervenkat.online/learn/ai-engineering/agents-usecases)
- [Where RAG fits, and where not](https://designervenkat.online/learn/ai-engineering/rag-usecases)
