Use AI where judgement helps. Use code where certainty matters.
Reliable systems rarely choose one or the other. They give language models the ambiguous work and deterministic code the final authority.
The first question
Does the task need judgement or repeatability?
Language models are good at interpreting messy information. Scripts are good at doing the same defined thing every time. Most dependable workflows combine them.
Choose AI when
The input is ambiguous.
Meaning matters more than exact matching.
The task requires summarising or prioritising.
Several valid answers may exist.
The next step depends on context.
Choose code when
The rule can be written down.
The same input should produce the same result.
A threshold or schema decides success.
The job runs often and should stay cheap.
Failure must be detected precisely.
Decision matrix
Match the executor to risk and uncertainty.
Uncertainty → Impact ↓
Low
High
Low
Script
Deterministic collection, thresholds, formatting and routine maintenance.
AI with tools
Research, classification, drafting and reversible exploratory work.
High
Script + approval
Known operation, but a human confirms the consequential step.
Strong model + human
Investigate and prepare options. Keep the final judgement human.
Practical routing
What should do the work?
TaskBest fitWhy
Check a fixed thresholdScriptThe rule is exact and frequent.
Summarise a noisy reportAIRelevance depends on context.
Validate privacy before publishingCodeSafety needs deterministic authority.
Investigate an unfamiliar failureAI + toolsThe path cannot be known in advance.
Delete or publish something consequentialHuman checkpointImpact matters more than speed.
Render and send a routine reportScriptPredictable work should stay predictable.
The reliable hybrid
Let each part do the job it is good at.
1Code collects
Fetch only the required data in a known format.
2AI interprets
Find meaning, exceptions and useful priorities.
3Code validates
Enforce schema, privacy and hard limits.
4Human decides
Approve the step when impact or judgement is high.
5Code verifies
Check that the external result actually exists.
A quick test
Five questions before adding a model.
Can the rule be expressed clearly in ordinary code?
Would two competent humans reasonably disagree about the answer?
How harmful is a confident but wrong result?
Can success be checked without asking the same model?
Does the task happen often enough that cost and variability matter?