Drawing the Line: What Deserves an LLM and What Doesn't A developer building an LLM-powered support agent outlines a decision framework for determining which components should use AI versus deterministic software, emphasizing that AI interprets intent while software enforces policy. The approach uses a static risk-tier lookup to prevent prompt injection from reclassifying actions, and retrieval is treated as a hybrid where fuzzy results sit behind a hard, testable contract. The three questions I use to decide what stays deterministic Part 2 of an ongoing experiment: building an LLM-powered support agent with deterministic boundaries. The companion repo grows with the series. Every AI feature reaches the same fork. This piece here — does it get a model, or does it get a method? Go wrong one way and you've built a rules engine that can't read a sentence. Go wrong the other and a language model is deciding whether someone gets their money back. "The AI interprets intent, software enforces policy" is easy to say — it's the principle this series started from https://dev.to/tonal/an-agent-on-a-leash-or-why-my-ai-agent-doesnt-make-business-decisions-1o1 . Applying it to a specific component on a specific Tuesday is the hard part. This post is the ruler I use for that. For every component, in order: php flowchart LR A "New component" -- B{"Is the answer a fact?"} B -- "no" -- AI "AI" B -- "yes" -- C{"Costs money or trust?"} C -- "no" -- P "Either" C -- "yes" -- D{"Can a test pin it today?"} D -- "yes" -- SW "Deterministic software" D -- "no" -- HY "Software contract around AI" classDef box fill: eef2f6,stroke: 8fa3b8,color: 24313f classDef decision fill: f7f4ec,stroke: b3a988,color: 24313f classDef ai fill: eef0f4,stroke: 8fa3b8,color: 24313f class A,AI,P,HY box class SW box class B,C,D decision Applied to Post 1's components: intent interpretation goes to the AI. Refund eligibility to software. Retrieval targets end up hybrid the interesting case, below . Refund execution is software plus a human gate. Policy exceptions are a job for a rule engine. Retrieval deserves its own paragraph, because it's where most teams get tripped up. "Let the AI find the right knowledge base article" sounds like an AI decision. It isn't — at least not entirely. The results are fuzzy: similarity search returns plausible articles, ranked, sometimes wrong. You cannot write assert search "refund" == refundsArticle and mean it. But the call is rigid: which function runs, with what arguments, against which index. That part is plain software with a typed signature, and it's fully unit-testable: // The results are probabilistic. The invocation isn't. public interface KnowledgeBase { / Returns up to k articles ranked by semantic relevance. Ranking quality is evaluated statistically, never asserted exactly. / List