A capable model can make an impressive prototype in an afternoon. A dependable AI agent is a different engineering object.
The difference is not just model quality. It is the system around the model: the boundary of the task, the information the agent can access, the actions it may take, the checks applied before those actions become real, and the evidence retained afterward.
That is why the most useful question at the start of an agent project is not “Which model should we use?” It is:
What must be true for this workflow to be safe, observable, and worth automating?
Begin with the operating contract
An agent needs an explicit operating contract. At minimum, the contract should define four things.
Objective. What outcome is the system trying to produce? “Help with support” is vague. “Draft a response using the customer’s current plan, open incidents, and the approved policy library” is testable.
Authority. What may the system read, propose, or change? Reading an account record, drafting a message, sending a message, and issuing a refund are four different authority levels.
Constraints. Which policies, data boundaries, timing limits, and business rules always apply? Constraints should be executable where possible, not buried in a prompt and treated as a suggestion.
Evidence. What record must exist after the task? Useful evidence can include source identifiers, tool calls, policy checks, approvals, confidence signals, and the final state of the external system.
If these elements cannot be described clearly, the workflow is probably not ready for autonomous execution.
Separate reasoning from control
Language models are useful for interpretation, synthesis, and choosing among ambiguous possibilities. They should not be the only control surface for deterministic business rules.
Consider a purchasing agent. The model can interpret a request, compare products, and explain trade-offs. But currency limits, approved vendors, tax handling, and who can authorize the order belong in ordinary code or policy configuration.
A strong system assigns each responsibility to the mechanism best suited to it:
- models handle language, ambiguity, and flexible planning;
- typed tools define the actions the agent can request;
- deterministic code enforces hard rules;
- retrieval supplies current, scoped information;
- humans approve consequential or ambiguous changes; and
- logs preserve the chain of evidence.
This separation reduces prompt complexity and makes failures easier to diagnose.
Design tools as narrow contracts
An agent tool should feel like a small, typed API, not a remote keyboard.
A broad tool such as run_query(sql) gives the model a large and risky action space. A narrower tool such as get_open_invoices(account_id) is easier to authorize, validate, observe, and test.
Good tool contracts have:
- a single clear purpose;
- constrained, validated inputs;
- predictable output shapes;
- explicit error states;
- idempotency where retries are possible; and
- authorization enforced outside the model.
Tool descriptions matter, but server-side enforcement matters more. A prompt instruction cannot substitute for a permission boundary.
Treat context as a designed resource
More context is not automatically better context. Long histories, duplicated documents, stale records, and irrelevant fields can make an agent less reliable while increasing cost and latency.
Context should be assembled for the task at hand. That usually means deciding:
- which system is authoritative for each fact;
- how fresh the information must be;
- which user and organization boundaries apply;
- how retrieved passages map back to their sources; and
- what the model should do when required context is missing.
A useful context layer returns not only information but also provenance. The agent should be able to say where a claim came from, which record version it used, and whether the source was complete.
Build an approval gradient
“Human in the loop” is too coarse as a design principle. Different actions need different levels of review.
A practical approval gradient might look like this:
- Read: retrieve information within the user’s permissions.
- Draft: create a proposed response, report, or change without external effect.
- Confirm: require a person to approve the exact action and payload.
- Execute: carry out a narrow, reversible action within a defined limit.
- Escalate: stop and route the case when policy, confidence, or authority is insufficient.
The goal is not to place approval everywhere. It is to match friction to consequence.
Evaluate the workflow, not only the answer
Pointwise answer quality is necessary, but an operating agent needs system-level evaluation.
Start with a representative task set that includes normal work, incomplete information, conflicting sources, permission failures, tool errors, and adversarial inputs. Then evaluate several layers:
- task completion;
- factual grounding;
- policy compliance;
- correct tool selection and arguments;
- appropriate escalation;
- latency and cost;
- recovery after failure; and
- quality of the evidence trail.
Production monitoring should use the same vocabulary as pre-release evaluation. If “appropriate escalation” matters in testing, it should be observable after launch too.
Make failure a first-class path
Reliable systems do not assume that every dependency is available and every request is well formed.
Design explicit behavior for timeouts, partial records, conflicting sources, expired permissions, duplicate requests, tool-side validation errors, and model uncertainty. A clean stop with a useful explanation is often better than a superficially complete answer built on weak assumptions.
Retries also need design. Retrying a read is usually harmless. Retrying a payment, message, or account change may duplicate an external effect unless the action uses an idempotency key and verifies the resulting state.
Ship in layers of authority
The safest path to a useful agent is often gradual:
- observe the workflow and collect representative cases;
- assist with retrieval and drafting;
- recommend actions with evidence;
- execute reversible actions after confirmation; and
- automate bounded cases with strong monitoring.
Each layer should earn the next by demonstrating reliability on the actual workflow.
The central idea is simple: an AI agent is not a model with access to tools. It is a controlled operating system for a specific job. Reliability emerges when objective, authority, context, action, evidence, and recovery are designed together.
