A Customer Service AI Example: Where Should a Limit Live?

It is two in the morning, a customer is angry, and your support agent is a language model that has been told never to promise more than a certain amount. The customer is persuasive and the conversation is long. Is that instruction a rule, or a hope? The book's customer-service example is a good place to ask.

What the example puts together

In the ShopFlow retail case study, a customer-service system is assembled from two kinds of artefact. Skill documents describe how to handle situations such as a complaint, a refund or an escalation. One agent configuration then ties those skills to a set of tools and adds a system prompt, a list of limits it calls guardrails, and some settings that shape the conversation.

The book's own summary is that the agent layer is where every lower layer meets. Schemas define the data, Utils do calculations such as refund amounts and credit limits, Resources reach the payment systems, Tools perform the business operations, the API and MCP layers expose them, and the skills supply the playbook. The agent is mostly configuration sitting on top of all that.

A limit in a prompt is a request

The guardrails live in that agent configuration, next to the system prompt. That is a reasonable place to state them, because it is where a reader looks first. It is not a safe place to enforce them. Whatever sits in the agent layer is read by a model that makes a fresh judgement on every turn.

The book treats placement as a real design decision. One of its exercises asks you, for each guardrail in a different scenario, to say whether it is enforced at the agent layer, the skill layer or lower down, and to justify the choice. My own rule of thumb, from general practice rather than from the book: tell the model the limit so that it behaves sensibly, then make the limit true somewhere that code decides.

Here is a sketch in another domain, an airline rebooking assistant with a cap on travel vouchers:

// Tool (L4): the agent can ask, but it cannot override
export async function issueVoucher(req: VoucherRequest) {
  const cap = voucherCap(req.reason, req.fareClass); // Utils: pure policy lookup

  if (req.amount > cap) {
    return { status: "needs_human", cap };
  }
  return vouchers.create(req); // Resources
}

If the model is talked into promising more, the call returns a refusal that it can read and act on. It hands the case to a person instead of quietly paying out.

Why each piece sits where it does

The split has a volatility logic that matches the rest of the model. The wording of the prompt changes often as the team tunes tone and priorities, so it belongs in the cheap, fast-moving agent layer. The business rule changes when policy changes, less often and with more consequence, so it belongs in a Tool, with the number itself kept in a pure Utils function that is trivial to test.

That also keeps edits safe. Someone softening the assistant's phrasing cannot accidentally loosen a financial limit, because the two live in different layers with different review habits. And when a limit is exceeded, the failure is an ordinary, testable return value rather than a model misbehaving in a way you only learn about from a complaint.

The same split applies to anything you would be unhappy to see go wrong: amounts of money, disclosure of internal information, and the point at which a human takes over. State each one to the model, and then give it a second home in code. The skill document can describe what to do when the Tool says no, so the refusal leads somewhere sensible.

The takeaway

An agent's configuration is the right place to describe behaviour and a poor place to rely on for guarantees. For the machinery around that idea, read how agents are watched and bounded and what a skill document contains. For the wider picture of these layers in an AI system, see LVD for AI agent systems.

What the book covers

  • Full skill documents for resolving complaints, processing refunds and escalating cases
  • The complete agent configuration: system prompt, tools, skills and conversation settings
  • The guardrails exactly as the ShopFlow example words them
  • An exercise designing guardrails for a prescription-management agent
  • An exercise designing an observability pipeline for the customer-service agent