Docs/Guides
Playbooks
The playbook is one Markdown file that tells your agent how to handle a call: how to greet, what public callers may ask for, how to run an outbound call and how to sound. Edit it and the next call follows it.
What the playbook is
At the start of every call the gateway reads the playbook from the agent's workspace, keeps the sections that apply to that call, and places them in the agent's instructions. The default file is:
~/.openclaw/workspace/protocols/dojo-voice-agent-playbook.md
The installer creates it once. Updates and reinstalls never overwrite it, so your edits are yours to keep.
The playbook controls what the agent does on calls. Who the agent is (name, personality, background) comes from SOUL.md and IDENTITY.md, and the same persona serves inbound and outbound calls. Business facts are better kept in the knowledge base.
Sections
The gateway sorts the file by its ## headings. Three headings are tied to a kind of call; everything else is shared and goes into every call.
| Heading | Used on | Purpose |
|---|---|---|
## Private Mode | Calls from the owner's number in private mode | How to serve the owner, with full access to the owner's tools. |
## Public Mode | Every other inbound call | What callers may ask, what the agent may do for them, what it must never do, and what to collect. |
## Outbound Mode | Calls the agent places | Opening, how to run the call, edge cases, closing, and named script profiles. |
## Greeting | All calls | How to open when no fixed greeting is set in the dashboard. |
## When Checking Something | All calls | What to say while a lookup runs, so there is no dead air. |
## Tone & Style | All calls | How replies should sound on the phone. |
## Learned Patterns | All calls | Short notes about recurring situations. Keep it brief: it is the first thing cut when the instructions run long. |
A mode section runs until the next ## heading, so keep its own subsections at ### and below.
Edit the playbook
Open the file on the server, change it, save. There is nothing to restart: the next call reads the new version.
nano ~/.openclaw/workspace/protocols/dojo-voice-agent-playbook.md
If your agent has a chat channel, you can also ask it to make the change, for example: "Update the Public Mode section of my voice playbook so callers can ask about delivery areas." Read the result before your next real call.
If our team runs your agent, send us the change and we make it with you, or edit it yourself if you have access to the workspace.
Writing Public Mode
A good public section answers four questions, in this order:
- What the agent must not do. Write this list first. It is your safety net.
- What the agent can say: services, hours, policies. Point at the knowledge base for anything long.
- What the agent can do: take a booking, capture a lead, look up an order. Name the actions you allow; tools marked owner-only are never offered to public callers at all.
- What to collect from each caller before the call ends.
## Public Mode
### Never
- Never quote a delivery date the order system has not confirmed.
- Never discuss other customers or the owner's personal details.
### You can tell callers
- Opening hours, the returns policy, which areas we deliver to.
For anything detailed, search the knowledge base.
### You can do
- Look up an order once the caller gives the order number and the
email on the order.
- Take a message for the team: name, callback number, what they need.
### Before the call ends
- Confirm the caller's name and the best number to reach them.
Greeting
If you set a Greeting in the dashboard, the agent says that line word for word and the playbook's ## Greeting section is not used for the opening. Two cases replace that line: a pre-call compliance notice, after which the agent opens in its own words, and a returning caller with a confirmed name, who gets a short personal greeting. Leave the dashboard field empty to let the playbook decide, which is useful when the opening should depend on who is calling:
## Greeting
The call just connected. You speak first.
- If the Caller Profile shows a confirmed name: greet them by name.
- Otherwise: "Thanks for calling Northwind Supply, this is Alex.
How can I help?"
Keep it to one or two short sentences.
Outbound calls and script profiles
The ## Outbound Mode section governs calls the agent places. Each call arrives with its own purpose and facts; the playbook says how to conduct it. Under a ### Script profiles subsection you can define named profiles, each a #### heading:
### Script profiles
#### appointment-confirmation
Brief and direct. Say who you are, state the appointment from the Facts,
ask whether it still works, note the answer, thank them, end the call.
#### payment-reminder
Polite and clear. Name the invoice and amount from the Facts and ask for
a payment date. If they dispute it, do not argue: say the team will
follow up, then end the call.
When an outbound call names a script, the agent follows the profile with that heading. Names may use letters, digits, hyphens and underscores, up to 64 characters. If no heading matches, the call still goes ahead on the general outbound guidance and the gateway logs that the script was not found, so check the log after a new profile's first call. See the Voice API for placing calls.
Playbook and dashboard scripts
The dashboard has Scripts and Router tabs for structured call flows. When you publish scripts and add them to the router, the agent first decides whether the caller's request belongs to one of them. Until it does, the call runs on the playbook. Once a script is chosen, it takes the playbook's place while it runs. Calls no script covers stay on the playbook, unless the router names a default script for them, so keep the playbook complete either way.
Use a different playbook file
To try a seasonal variant or compare two versions, point the gateway at another file in config.json and restart:
"context": {
"files": ["SOUL.md", "IDENTITY.md", "USER.md"],
"voicePlaybook": "protocols/holiday-playbook.md"
}
The path is relative to the workspace, must end in .md and must stay inside the workspace. A rejected path falls back to the default playbook and logs an error, so calls keep working. Set it back to null to return to the default.
Limits and gotchas
- 30 KB per playbook. A larger file is not trimmed, it is rejected, and the agent runs on built-in instructions until you shorten it. The same happens to a symlink. Check for
hasPlaybook: truein the log after a big edit. - A total budget for the call's instructions. Persona files, playbook, facts and platform rules share about 44 KB. When a call runs over, the gateway trims in this order: always-loaded facts, then
## Learned Patterns, then the end of the playbook. Put what matters most near the top. - Platform rules come after the playbook and cannot be overridden by it. Impersonation blocking, prompt-injection defence and separation between callers apply whatever the playbook says. The playbook is also treated as content, not as commands that change those rules.
- Write for speech. The agent speaks what it reads. Short sentences and plain words work; tables and links do not.
- Examples are copied. The agent treats example lines as patterns to follow. Keep example facts (prices, dates, names) out of rules unless they are true.