When is an agent the wrong answer?
Most of the time, and that is not a fashionable thing to say. If the inputs can be enumerated, deterministic code is cheaper to run, faster, easier to debug and does not fail in novel ways. An agent earns its cost when the input varies too much to write rules for.