The AI hype cycle has pushed many teams to use models for tasks that would be better served by deterministic code. The result is slower, more expensive, less reliable systems. The discipline is to use AI where it shines and code where it shines, and to know the difference.
The decision rule
Use deterministic code for any task with a clear correct answer that can be specified in rules. Use AI for tasks where the input is unstructured, the correct answer is fuzzy, or the rules cannot be enumerated up front. The mistake is using AI for both because AI is exciting.
Where the line is
Routing, validation, calculation, formatting, and most workflow logic are deterministic. Summarisation, classification of unstructured text, generation, extraction from messy documents, and similarity matching are AI. The architecture should reflect this: deterministic shell, AI core where it earns its place.
The cost of getting it wrong
Using AI for deterministic work means you have introduced variance, latency, and cost where you had none. Using code for fuzzy work means you have shipped a brittle system that fails on every new input pattern. The discipline is recognising which is which before you reach for either.