AI agents

Write clear AI agent instructions and guardrails

Define the agent’s job, response style, prohibited behavior and human-handoff conditions.

Published · Updated

Good instructions make behavior more predictable, but do not replace accurate knowledge or access control. Give the agent a defined task and testable rules rather than a broad instruction to answer everything.

Before you start

Identify the audience, channel, language and situations requiring a person. Review approved business policies before drafting any customer commitment.

Steps

  1. 1

    Set the scope

    Describe questions the agent may handle and those outside its job.

  2. 2

    Write answer rules

    Define language and tone, require approved knowledge and tell it to acknowledge uncertainty.

  3. 3

    State prohibitions

    Specify information or actions the agent must not invent or perform.

  4. 4

    Define handoff

    List requests for a person, sensitive complaints or missing information and the receiving team.

  5. 5

    Test edge cases

    Try a clear question, ambiguous question, prohibited request and handoff case, then refine instructions.

Check the result

The agent answers within scope, stops when knowledge is missing, avoids unauthorized actions and hands off defined cases.

Practical example

Structure instructions around task, approved source, action limits and handoff. For example: explain services from enabled knowledge, request missing information and never confirm an unapproved refund or price. Name the handoff destination rather than simply saying to seek help.

Common issues and what to check

IssueWhat to check
The agent makes unsupported promisesReview conflicting instructions and sources, and add a test requesting an unauthorized promise.
Instructions are long and repetitiveConsolidate similar rules with clear priorities, then retest previous failures.