Stop trying to make large language models do arithmetic. In the latest edition of The Builderβs Letter, Mian Usman Khalid, Founder and CEO of XICTEK Systems, warns that replacing core business logic with AI prompts is a critical architectural failure. While AI excels at interpreting natural language, it fails at the precise, repeatable execution required for financial calculations, permission checks, and database transactions.
The Probabilistic Trap
The core argument is simple: deterministic software produces the same output for the same input, while AI operates probabilistically. Khalid illustrates this with a financial example where a customer pays PKR 5,000 against a PKR 20,000 balance. A traditional calculation engine yields PKR 15,000 every single time. An AI model, however, might interpret the request differently depending on context, potentially leading to hallucinated balances or inconsistent results in production environments where data integrity is non-negotiable.
Architecture: AI as the Interface, Not the Engine
Khalid proposes a layered architecture where AI serves strictly as an interpretation layer. When a user asks, "Show my expenses for this month," the AI converts this ambiguous request into a structured intention. The application then handles authentication, authorization, and data retrieval using deterministic backend logic. Only after the verified results are retrieved does the AI step back in to explain the findings in natural language. This separation ensures that the "brain" of the operation remains code, while the AI handles the "mouth."
Security and Reliability Concerns
Beyond accuracy, the article highlights security risks when AI is given too much authority. Khalid argues that AI should never be the authorization mechanism. Even if a model perfectly understands a request to view other businesses' financial records, it does not have the right to grant access. Authorization must be enforced by the application backend. Furthermore, relying on AI for critical operations creates a single point of failure; if an AI provider experiences downtime, users should still be able to perform essential tasks like recording transactions via standard forms.
Key Takeaways
- AI is best suited for understanding intent, extracting information from documents, and generating explanations.
- Deterministic logic must handle financial calculations, inventory updates, and permission checks to ensure consistency.
- Never grant AI unrestricted database access; expose specific, controlled APIs instead.
- Products must remain functional without AI to avoid catastrophic downtime during service outages.
- Testing strategies must differ: traditional unit tests for logic, and evaluation suites for AI interpretation accuracy.
The Bottom Line
We are in an era of AI hype, but the best products aren't the ones that use AI for everythingβthey're the ones that know exactly where to stop. Keep your math in the code and your chat in the cloud.