FREE LESSON · LLMs & agents · 4 OF 4
AI Agent Architecture: Tools, State and Safety
Agent mastery: close the loop safely — State, planning, permissions, evaluation, and stop conditions
An agent is a controlled loop around a fallible model.
The system observes state, selects or proposes an action, executes through bounded tools, records the result, and decides whether to continue. Long tasks need explicit state rather than relying on a prompt transcript. Budgets, allowlists, approvals, sandboxing, idempotency, and stop conditions contain mistakes. Evaluation must score final outcomes and the path taken.
More autonomy increases the number of states your safety and evaluation design must cover.
Evaluate trajectories, not demos
A support agent may reach the right final answer after leaking data, calling unnecessary tools, or repeatedly failing. Tests should include task completion, groundedness, authorization, action count, cost, latency, recovery, adversarial inputs, and correct refusal. Production traces then reveal new failure clusters for the suite.
A polished transcript is an anecdote; a versioned evaluation set is evidence.