AI2025-11 · 12 min

LLM Agents in Production: Guardrails Before Magic

Agents are powerful and unpredictable. Here's how to make them safe enough to ship.

An agent is a program that writes its own control flow

The seductive thing about agents is that you describe the goal and the model figures out the steps. The terrifying thing is the same sentence. An agent can call tools, take actions and spend money — so the first rule of agents is: constrain the action surface.

Give the agent the smallest set of tools that can accomplish the task, and make every dangerous action require explicit confirmation. An agent that can only read is a search feature; an agent that can delete is a liability.

Guardrails are boring and essential

Sandbox every tool call, validate every input and output, log every step, and cap iterations. Treat the agent's reasoning like untrusted user input — because in a very real sense, it is. Your app must be correct even when the model is confidently wrong.

Add human-in-the-loop checkpoints for anything irreversible. The best agent UX is one where the model drafts and the human approves.

Start with workflows, graduate to agents

Most 'agent' features would be better as a plain workflow: a fixed sequence of calls you can test. Ship the deterministic version first, then relax constraints only where you've measured that the flexibility pays for itself.