Human in the loop
Two blocks on the agent decide when a person takes over.
agent:
instructions: ...
hours:
timezone: America/Santiago
mon: 09:00-18:00
tue: 09:00-13:00, 14:00-18:00
sat: 10:00-14:00
handoff:
after_turns: 8
when:
- el cliente pide hablar con una persona
- reclamo por un cobroDeclaring handoff is what gives the agent the tool to hand a conversation over. Calling it marks the chat as waiting for a person; it shows up that way in the inbox, and whoever replies there or from the WhatsApp Business app takes it over. Vatio does not notify anyone yet.
The agent says so plainly. It is an assistant, it does not pretend otherwise, and when it hands something over it tells the visitor it is checking with a colleague and will come back with an answer — no invented errand to cover for it. Several jurisdictions require disclosing that a person is talking to a machine, and a single honest behavior is one less thing to get wrong.
When it escalates
handoff.when is your own list of conditions, in your words, and goes into the prompt. handoff.after_turns is the deterministic floor under it: past that many visitor messages the handoff happens whether or not the model asked for one. A visitor who asks for a human in plain words always triggers one — that never depends on the model's judgement. Declare neither and escalation is entirely the model's judgement.
Hours
hours says when a person is on duty, in a real timezone, 24h ranges, one line per day. A day you leave out is a day nobody is on. The hours do not decide who answers — the agent triages and tries to resolve either way. They decide what happens after it gives up:
| Inside hours | Outside hours | |
|---|---|---|
| The agent | Goes quiet, someone is there to pick it up | Keeps answering — it promised a person for the morning, and going silent on top of that is worse than helping |
Declare no hours and the agent is treated as always reachable, so a handoff always quiets it. A handoff nobody picks up within an hour hands the conversation back to the agent rather than leaving the visitor with a promise and silence.
