All articles
Guide
Implementation, cost and ROI9 min

Writing a spec for an AI agent: what to put in it to get what you actually need

A typical brief for an AI agent reads like this: "We need a bot that answers customers on WhatsApp, knows our services and books consultations." The vendor builds exactly that. Then, at sign-off, you discover the agent quotes prices your sales team only gives after a site visit, struggles with Arabic, and has no idea who should handle an angry customer. That is not necessarily the vendor's fault. The brief never said how the agent should behave, so almost any result technically meets it. This article covers the sections a working agent spec needs, how to describe behaviour in a way you can test, the phrases that quietly ruin a spec, and how to build the test set you will use to accept the work.

Why an agent spec is different from a website or CRM spec

A classic software spec lists features and screens: which fields a form has, what happens when a button is pressed, which reports the system produces. Software behaves the same way on the same input, so listing features is enough.

An agent works with natural language. Customers ask the same question a dozen different ways, with typos, in mixed languages, sometimes as voice notes. You cannot list every case. So an agent spec describes behaviour: what the agent handles on its own, what it never does, when it brings in a person, and how you will check that all of this holds.

QuestionWebsite or CRM specAI agent spec
What it describesScreens, fields, buttonsSituations and expected responses
How you accept itClick through the scenariosRun real customer messages and grade the answers
Main riskA feature doesn't workThe agent is confidently wrong
After launchChanges are rareConstant updates: prices, policies, new questions

The nine sections of a working spec

Length doesn't matter much; a good spec for one agent often fits in four to six pages. What matters is that every section is filled with specifics from your business.

1. Job and boundary

One paragraph on which process the agent takes over and where that process ends. For example: "Answers inbound questions about opening hours, location and services, and books first consultations. Does not give expert advice, does not take payments, does not handle existing orders." The boundary matters more than the job, because that is where the surprises live.

2. Channels, languages, hours

Where the agent lives (WhatsApp, Instagram, a website widget), which languages it answers in, and what it does when a customer switches language mid-conversation. Decide on voice notes: transcribe them, or politely ask for text. Decide on nights and weekends: does the agent answer fully, or only take a request for the morning?

3. Knowledge sources

The documents the agent draws facts from: price list, service descriptions, refund policy, FAQ. For each one, note where it lives, who owns it and how often it changes. If the price list exists only in the founder's head, fix that before development starts.

4. Actions and permissions

What the agent can do in your systems, not just say: create a deal in the CRM, check calendar slots, make a booking, send a file. For each action, specify the system, the permission level and whether a person must approve it. Give the agent the minimum access the job requires.

5. Hard limits

Things the agent never does: offer discounts, promise delivery dates, give medical or legal advice, discuss competitors, message people who haven't opted in. Write these as checkable actions, not as wishes.

6. Human handoff

When the agent stops and calls a person: a complaint, a request for a human, a question outside the knowledge base, a large order, repeated misunderstanding. Specify who receives the conversation, through which channel, what they see, and what the agent tells the customer at that moment. Why this rule should be enforced in code, not just in instructions, is covered in our piece on keeping a human in the loop.

7. Tone and format

Formal or casual, answer length, emoji, sign-off. The best input is five to ten real replies from your strongest salespeople. Adjectives like "friendly but professional" will mean different things to you and the vendor.

8. Acceptance

A set of test messages with expected behaviour and a rule for when the work counts as accepted. More on this below; it is the most underrated section.

9. Owner and post-launch changes

Who on your side owns the agent, who updates the knowledge base, how changes are requested and how quickly the vendor responds to an error. Without this, the agent drifts away from reality within a couple of months.

Describing behaviour: the situation table

The most useful format inside a spec is a situation table. It tells the vendor what you want and doubles as the basis for acceptance testing. Here is an illustrative example for a training centre agent that books trial lessons.

SituationExpected behaviourNot acceptable
"How much is the course?"Gives the price from the price list, asks about format (group or one-to-one)Quoting a price that isn't on the list
"Can I get a discount?"Says a manager will discuss discounts, offers to pass on the contactPromising a discount or naming a percentage
Writes in ArabicReplies in Arabic for the rest of the conversationSwitching to English unprompted
"I want a refund"Apologises, hands over to an administrator immediately, tells the customer who will replyNegotiating refund terms itself
Off-topic questionBriefly says it only helps with courses, steers back to bookingChatting about unrelated topics

Fifteen to twenty-five rows are enough for a first spec. Take them from real conversations: export the last two or three months of messages and note recurring question types, plus cases where staff made mistakes or customers left unhappy.

Phrases that ruin a spec

  • "The agent must understand any question." Untestable. Replace with "answers the questions in the situation table; hands everything else to a person."
  • "Sound like a real salesperson." Everyone pictures a different salesperson. Provide sample replies.
  • "99% accuracy." Meaningless without a method. State which test set, who grades it and what counts as an error.
  • "CRM integration." Which fields, at what moment, how duplicates are handled. Otherwise you get the minimum version.
  • "The agent closes sales." Decide where the line is: qualify, book, send an invoice? Each step is a separate risk decision.

The test set you will accept the work against

  1. Collect 40–60 real customer messages, unedited. Keep the typos and mixed languages; that is how people write.
  2. Group them: routine questions, tricky ones (discounts, deadlines, guarantees), handoff situations, off-topic messages.
  3. Write the expected behaviour for each in one line, following the situation table logic.
  4. Decide who grades: someone on your side who knows the right answers.
  5. Agree on the acceptance rule. For example: zero hard-limit violations, every handoff case handled, minor wording issues allowed on routine questions but no factual errors.
  6. Keep 10–15 messages hidden from the vendor until acceptance. That shows how the agent handles input it wasn't tuned for.

Reuse the same set after launch, every time the knowledge base or instructions change significantly. How to run the first weeks so the set keeps growing with real cases is covered in our article on running an AI pilot.

A lesson from our own work: a limit written in the spec should be enforced in code, not just in the model's instructions. We had a rule in place and one component simply didn't check it. The write-up is in our approval gate case study.

Checklist before sending the spec

  • The boundary is clear: it says what the agent does not do.
  • Every knowledge source exists as a document with an owner.
  • Each system action lists permissions and whether approval is needed.
  • Hard limits are written as checkable actions.
  • Handoff triggers are listed and a recipient is named.
  • There are five to ten sample replies in the right tone.
  • The situation table has at least 15 rows from real conversations.
  • The test set and acceptance rule are agreed, with part of the set hidden.
  • An owner on your side is named.

More articles on rolling out AI are in our implementation section.

FAQ

Should we write the spec, or should the vendor?

Only your team can write the business part: boundaries, limits, handoff, sample replies, test messages. That knowledge sits with you. The technical part (architecture, model choice, integrations) belongs with the vendor. A common workable split: you draft the sections above, the vendor fills gaps and asks questions.

Should the spec name a specific model?

Usually not. Describe requirements instead — languages, acceptable response time, where data may be stored — and let the vendor choose and justify. Models change quickly; behaviour requirements don't.

What if our process isn't documented?

Start by exporting conversations and talking to two or three people who do the work today. The situation table often becomes the first written description of the process.

How much does building an agent from such a spec cost?

It depends on the number of channels and system actions, the state of your knowledge base and the scope of testing. A spec built on these sections makes estimating much easier. If you want a second pair of eyes on your draft, get in touch; the first conversation is about understanding the task and scoping it.

Subscribe to AI Insights

Case studies, tips and AI automation trends — weekly

Want similar results?

Get a free consultation and ROI calculation for your company

Free Consultation

Related Articles

Guide

Customer Consent to Data Processing When an AI Agent Is the One Replying

The customer is messaging a bot, not a person — but the requirement to get consent for data processing does not disappear. Here is when to ask for it, how to set it up across channels, and what to log.

Guide

AI on your own server: when you genuinely need it, and when it only feels that way

"It's safer" isn't an answer. We separate the checkable reasons for self-hosting AI from the outdated fear driving most of these decisions.

Guide

Open-weight models or a commercial API: which one your business should run on, and when self-hosting pays off

"Host the model ourselves and it's free and private" sounds right until you price the GPU, the engineer and the quality gap. Three options and the criteria that decide between them.

Guide

The system prompt behind your AI agent: what it is and who should write it

A system prompt isn't a knowledge base or a spec — it's the agent's behaviour rules: tone, decision limits, escalation triggers. Here's what goes into one and who should own it.

Guide

Support after launch: what happens to your AI agent a month in

Launch isn't the finish line — it's the start of a different job. Here's what usually happens to an agent in its first month: where it starts drifting, who should notice, and what a weekly review should look like.

Guide

After the pilot: how to scale your AI agent to other departments without repeating the same mistakes

A successful pilot in one department doesn't mean the rest of the company is ready for the same agent. How to choose the next department and what to re-check each time.

AI agent spec: what to write and how to accept the work | UNIKA