Dev.to AI 🤖 Ai 👁 0 📖 5 min read

Two Books, One Consensus: 5 Hard Rules for Agent Engineering

The Pain There are more Agent books every month, and more vocabulary with them: harness, runtime, memory, A2A. Each book has its own narrative. Teams finish reading and still cannot answer the practical question: what i

Two Books, One Consensus: 5 Hard Rules for Agent Engineering

The Pain

There are more Agent books every month, and more vocabulary with them: harness, runtime, memory, A2A. Each book has its own narrative. Teams finish reading and still cannot answer the practical question: what is mandatory, and what is just a vendor describing its own product?

What You'll Learn

  • The five rules that two independently sourced books both accept.
  • Why an Agent is a system, not a model with a prompt.
  • The difference between an API call and a task lifecycle.
  • How to evaluate an Agent without mistaking a demo for production.
  • A three-step checklist you can run this week.

Agent equals model plus harness

The shared foundation: the model decides, the harness enforces.

Two books, one map

One source is Alibaba Cloud's open-source AI Agent Handbook: seven parts and thirty chapters on how an enterprise Agent moves from prototype to production. The other is Antonio Gulli's Agentic Design Patterns: twenty-one patterns for the inside of a single Agent. One gives the skeleton; the other gives the parts.

They were written for different readers and from different starting points. That is exactly why their agreement is useful. When two independent maps converge on the same roads, those roads are probably real.

Rule 1: An Agent is a system, not a model

The first shared idea is almost embarrassingly simple:

Agent = Model + Harness.

The model understands and decides. The harness owns everything else: context, state, tools, permissions, recovery, and verification. When an Agent fails, do not blame the model by default. Separate the failure into two buckets: a model error, or a harness error. Most production failures I have seen live in the second bucket.

This framing changes what you build. You stop asking "which model is smartest?" and start asking "what does the system around the model guarantee?"

Rule 2: The task is the unit, not the API call

A chat completion is one call. A task is a lifecycle. It may cross requests, processes, and even days. It may need to pause, resume, or hand off to a human.

If the task is the unit, state cannot live only in the model's context window. It has to be externalized: a task record, a status, an owner, an audit trail. The book calls this "task as the unit." In production, it is the difference between an Agent that can recover and an Agent that starts over every time the process restarts.

Five shared rules

Five rules that survived two independent books and our own production checks.

Rule 3: Choose the least sufficient architecture

Workflow and Agent will coexist for a long time. The books repeatedly make the same point: choose the cheapest and least risky architecture that is sufficient for the task — not the one that looks most like an Agent.

A deterministic workflow is often better than an autonomous loop. An Agent is justified when the path cannot be enumerated in advance, when the environment is ambiguous, or when the task requires judgment across tools. If you can draw the flowchart, build the flowchart. Autonomy is not a maturity badge; it is a cost.

Rule 4: Guardrails live outside the model

A constraint written in a prompt is not a constraint. It is a suggestion.

Permissions, sandboxes, budgets, and approvals must be enforced by a system outside the model. Human-in-the-loop is an architectural principle, not a patch you add after an incident. This is also where most "Agent governance" products actually compete: not on the cleverness of the prompt, but on the strength of the boundary.

Rule 5: Evaluation is a production prerequisite

Alibaba's survey of 1,906 organizations found that 55% of enterprises still rely on manual spot checks, while only 6% use automated trajectory evaluation. That gap explains a lot of the gap between demos and production.

If you only test the final answer, you miss the path: wrong tool, wrong permission, wrong retry, wrong handoff. Trajectory evaluation asks whether the Agent did the right thing in the right order. Without it, you are not running production; you are running a demo with a production URL.

Our evidence

Evidence beats opinion: a golden set, boundary cases, and a production comparison.

Our evidence: 50 cases, 95/95 consistency

We applied these rules to a narrow, high-risk problem: two business rules for closing logistics tickets.

We built a golden set of 50 tickets: 25 CIF/FOB cases and 25 non-CIF/FOB cases. The set covered the boundaries that usually break naive rules: three days versus 72 hours, amount tolerance of ±0.01, statement of account, freight collect, and invoice attachments.

The result was 50/50 pass, zero false closes, and zero missed closes. We then compared the rules against the production script ticket by ticket: 95/95 agreement. Every decision was written into a trace table with a hash and a commit identifier.

That is what "evaluation" means in practice. Not a score on a benchmark, but a reproducible answer to: if we change this rule, what breaks?

What to do this week

  1. Pick the one rule that would hurt most if it failed.
  2. Write twenty boundary cases around it, including the ugly ones.
  3. Freeze the expected result, run it, and record false closes and missed closes.
  4. Put the run in a database. Run the same set after every change.

The model will keep changing. The structure — task, boundary, evidence — is what accumulates.

The bottom line

The distance between two Agents is rarely the model. It is the engineering system around the model: how the task is represented, where the guardrails are enforced, and whether the evidence is reproducible.

Put an uncertain model inside a deterministic engineering boundary. Organize around tasks, not calls. Publish with evidence, not with a feeling.

About the author: Guanlan (观澜) — AI / Agent / digital transformation practitioner. Practical, hands-on writing — follow along and it just works.

Further reading

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.