The Agent That Should’ve Been a Cron Job
Using a language model as the runtime for a repeatable, deterministic task — paying per token, forever, for work a script would do for almost nothing.
What it is
A task that runs the same way every day — pull yesterday’s numbers, format the digest, file the report — wired to re-invoke a large language model every single time it runs. The model re-derives the whole procedure on every execution, bills for every token, and returns a slightly different result each time. It’s a for-loop with a metered genius inside it.
How it happens
The agent worked the procedure out once, interactively, and it worked — so the procedure just… stays inside the agent. Why extract it into code when you can ask the agent to “do that thing again” tomorrow? Each step that should have been compiled into a cheap, deterministic program instead stays a prompt the model re-interprets live. The interactive session that was the right tool for figuring out the task becomes the wrong tool for running it.
Warning signs
- A scheduled job’s per-run cost is measured in dollars, not fractions of a cent.
- You hit API rate limits or credit ceilings doing routine, repeatable work.
- The same input produces subtly different output on different days, for a task that’s supposed to be deterministic.
- The “automation” can’t run while the model provider is down, and slows when they’re under load.
- Asked “what does this job actually do?”, the only answer is “it asks the AI to handle it.”
Why it’s dangerous
Three compounding costs. Money: a model call can be orders of magnitude more expensive than the CPU cycles to run the equivalent compiled logic; multiply by every run, every day, forever, and the “automation” has worse unit economics than the manual process it replaced. Determinism: a reconciliation, a payroll run, an inventory adjustment is supposed to give the same answer from the same inputs — a model in the loop turns that from a guarantee into a probability. Reliability: the longer an agent runs unattended and the more steps it chains, the more its reliability degrades — exactly the wrong property for something that has to run correctly at 3am with nobody watching.
The AI-era hinge: the model didn’t just get good at writing code — it got so good at doing the task directly that the obvious move (have it do the task) out-competes the correct move (have it write the code that does the task) right up until the invoice arrives. The leverage is real; it’s just been pointed at the wrong place.
How to prevent it
Use the model to build the tool, not to be the tool. The right division of labor: the model is brilliant at the one-time, ambiguous, judgment-heavy work of figuring out the procedure and writing the program — let it. Then the program, plain deterministic code, runs on a schedule on near-free CPU, forever, identically. Reach back for the model only at the genuinely fuzzy steps a program can’t do — classifying free text, summarizing prose — and even then call it as a narrow function, not as the whole runtime.
A fast test: would this task be embarrassing to do non-deterministically? If yes, it wants code, not an agent.
The serious team fix
- Default to “agent writes the program,” not “agent is the program.” For any repeatable, scheduled task, the deliverable is source code that runs with no model in the hot path. The model’s job ends when the script is written and tested. This is the cheaper and the more reliable answer — the rare case where the disciplined choice is also the lazy one, paid once.
- Reserve live model calls for irreducibly fuzzy steps. Some steps genuinely need judgment on unstructured input at runtime. Isolate those into a single, well-defined call with a schema’d input and output, surrounded by deterministic code. The model is a function the program calls, not the environment the program lives in.
- Put a cost meter on every scheduled automation. Per-run token cost, visible. The moment a recurring job’s bill is measured in dollars, that’s the signal it should have been compiled to code. Token spend is invisible until it’s a five-figure surprise — you can’t manage what you can’t see.
Letting a model run your nightly batch because it can is like hiring a Michelin chef to microwave the same burrito every morning. They’ll do it. The burrito will be slightly different each day. The bill will be spectacular.