Skip to the content

Guardrails

Guardrails keep the assistant on-topic and polite. They screen what customers send and what the assistant replies, act on what breaks your rules, and warn, end or hand over a conversation when someone keeps pushing.

Where
Assistant menuConfigureGuardrails
Permission
Needs Change assistant setup
Time
17 min read
Markdown
01 / 05Start from a template. No rules yet. Refuse off-platform contact opens the rule sheet already written.
  1. Start from a template. No rules yet. Refuse off-platform contact opens the rule sheet already written.
  2. Choose how it acts. Templates start in Monitor. Switch to Enforce so the rule acts; Strike counts toward the warning ladder.
  3. Create the rule. It applies from the next customer message. No restart.
  4. Test it. Test runs a message through every enabled check and rule, as if a customer had sent it.
  5. Read the verdict. The rule matched, so the customer would get the warning instead of an answer.
The story

What happens when a message breaks a rule

Follow a Golden Oven customer through the warning ladder, from their phone and from the Activity log.

1

A message breaks a rule

Golden Oven enforces the Refuse off-platform contact rule with the action Strike, and keeps the default of 2 warnings before the final action. It has set the final action to End + block the contact.

The message never reaches the assistant's model. The customer gets the Warning message instead, and the assistant is told on its next turn that the previous message was blocked, so it carries on normally and does not bring it up again.

Activity records the hit with the time, the conversation, the direction, the rule, the mode, the action taken, the severity, the reason and how long the check took.

2

Strikes add up across rules

Strikes belong to the conversation, not to one rule. Every striking violation adds its weight: one for low or medium severity, two for high.

With 2 warnings, strike 1 gets the warning, strike 2 the Final warning message, and strike 3 the final action.

3

The final action

The Closing message is sent (on a call it is spoken before the line hangs up). The conversation is marked Ended by guardrail, with the rule's name, and your team gets a notification.

Because the final action is End + block the contact, the WhatsApp number is refused for the Cooldown (minutes), 1,440 minutes (one day) unless you change it. It appears under Active cooldowns.

4

During the cooldown

A blocked contact's messages are still stored, so your team can read them, but the only reply is the Blocked contact message. Leave that message empty and the assistant stays silent.

5

Lift the block

Active cooldowns sit at the end of Built-in checksAdvanced. Unblocking takes effect straight away; otherwise the block lifts by itself when the cooldown ends.

01 / 05A message breaks a rule. The customer asks for a staff member's personal number. The rule is enforced, so the warning goes out instead of an answer.
  1. A message breaks a rule. The customer asks for a staff member's personal number. The rule is enforced, so the warning goes out instead of an answer.
  2. Strikes add up across rules. An insult trips the built-in Harassment check. That is strike 2: the final warning.
  3. The final action. Strike 3: the closing message goes out and the conversation ends. The contact is blocked for a day.
  4. During the cooldown. The customer writes again. They get the blocked message, and the assistant never sees it.
  5. Lift the block. If the block was a mistake, Unblock lets the contact write again at once.

What guardrails do

Every turn of a conversation passes through two screens. Input screening checks the customer's message before the assistant answers. Output screening checks the assistant's reply before (or while) it goes out. Each screen runs the built-in checks you have switched on and your own rules, written in plain language.

When something matches, what happens depends on its mode. In Monitor the hit is only logged. In Enforce the guardrail acts: it warns the customer, replaces or rewrites the reply, hands the conversation to your team or ends it. A customer who keeps breaking rules climbs the warning ladder: warning, final warning, then the final action you choose.

The page has three tabs: Rules for your own rules, Built-in checks for the ready-made screens and the safety checker's settings (see Built-in checks), and Activity for the log of every hit.

WhoCan
See assistant setupOpen the page and read the rules, checks and Activity.
Change assistant setupTurn guardrails on or off, create, edit, reorder and delete rules, change checks and unblock contacts.
Run live testsUse Test. The test runs the real checks and the real safety checker.

The master switch

The switch in the page header reads Guardrails on or Guardrails off. It is on for every new assistant.

  • Turning it off asks Turn off all guardrails?: every rule and built-in check stops screening conversations until you turn guardrails back on. Nothing is deleted. Confirm with Turn off guardrails.
  • While it is off, a banner says rules and checks are saved but not applied, with a Turn on button. The checks are greyed out and Activity shows Guardrails are off.
  • Turning it back on applies everything you had set, from the next turn.

Custom rules

A rule is a sentence that describes what the assistant must never do, or what customers must not do. The safety checker reads each turn against it. Write it the way you would brief a new team member: "The agent must never promise a delivery time for custom cakes."

GoalA rule that logs what it would catch, ready to enforce once you trust it.

  1. 1

    Open ConfigureGuardrails and press New rule

    Or pick a template under Start from a template: when you have no rules yet.

  2. 2

    Name it and write the rule

    Name is what Activity shows. Rule is the plain-language description, at least 10 characters.

  3. 3

    Choose Applies to

    Customer messages for what customers send, Agent replies for what the assistant says, or Both.

  4. 4

    Leave Mode on Monitor

    Monitor logs violations without changing replies. Watch Activity for a few days.

  5. 5

    Press Create rule

    It applies from the next turn, with no restart.

  6. 6

    Switch it to Enforce and choose the Action

    Open the rule from its row (Edit) once the hits in Activity look right.

    Use Test at any time to try a message against the rule without a real conversation.

The rule sheet (New rule / Edit rule)15 controls
NameText
Required. Shown in the rules table and in Activity.
Limit 80 characters
RuleText
Plain language. The judge model evaluates each turn against it.
Limit 10 to 10,000 characters
Applies toChoice
Which side of the conversation the rule checks.
Default Customer messagesOptions Customer messagesAgent repliesBoth
ModeChoice
Off keeps the rule but does not check it. Monitor logs violations without changing replies: start here. Enforce takes the action below.
Default MonitorOptions OffMonitorEnforce
ActionChoice
What an enforced rule does when it matches. Locked unless the mode is Enforce: monitor only records what would have happened. See the table below.
Default StrikeOptions StrikeBlock onlyRewriteHand offEnd immediately
Retry feedbackText
Shown for Rewrite only. Sent back to the model when its reply is rejected. Leave empty for the default guidance. You can use {{trigger_reason}} and {{agent_message}}; any other placeholder is flagged.
Limit 1,000 characters
Only during procedureChoice
Always: checked on every turn. Or pick a procedure: the rule is checked only while that procedure is active. See Procedures.
Default Always
Only in workflow nodeChoice
Shown when the assistant has a workflow. Always, or a node: checked only while the conversation is in that node. See Workflow.
Default Always
SeverityChoice
High counts as two strikes.
Default MediumOptions LowMediumHigh
Advanced > ExecutionChoice
Blocking holds the whole reply until the checks finish whenever this rule is enforced. Streaming follows the assistant's reply screening setting. Inherit follows the assistant's setting.
Default Inherit agent defaultOptions Inherit agent defaultBlocking — check before sendingStreaming — check while sending
Advanced > Judge modelChoice
Which model checks this rule. A rule on a different model is checked in a second call that runs at the same time. A bigger model reasons better and costs more.
Default Inherit agent default
Advanced > History turnsChoice
How many earlier turns the checker sees for context.
Default Use agent defaultLimit 0 to 10 turns
EnabledSwitch
Off pauses the rule without deleting it. The same switch is on the rule's row.
Default On
Create rule / Save changesButton
Saves the rule. Changes apply to the next turn, no restart.
DeleteButton
Shown when editing. Asks for confirmation first.
ActionWhat happensCounts as a strike
StrikeCounts toward the warning ladder (warning → final warning → final action). On a customer message the customer gets the warning instead of an answer.Yes
Block onlySwaps the message for the Replacement reply.No
RewriteAsks the model to rewrite its reply so it complies, then checks the new reply again. Up to 2 rounds; if it still fails, the Replacement reply goes out instead. Agent replies only: on customer messages it acts as Block only.No
Hand offEscalates the conversation to a human right away, whatever the strike count.No
End immediatelyEnds the conversation at once, no warnings, regardless of strikes. It uses your final action: if that is Hand off to a human, the conversation is ended instead.No
What an enforced rule can do

The rules table

Rules tab10 controls
Drag to reorderButton
The grip at the start of each row. You can also use Move up and Move down in the row menu.
Enable / DisableSwitch
Turns the rule on or off without opening it.
RuleShown
The name. A chip shows a scope: Only during {procedure} or Only in {node}.
Applies toShown
Customer messages, Agent replies or Both.
ModeShown
Off, Monitor or Enforce.
ActionShown
Strike, Block only, Rewrite, Hand off or End immediately.
SeverityShown
Low, Medium or High.
Triggers 30dShown
How many times the rule fired in the last 30 days.
UpdatedShown
When the rule was last changed.
Actions for {rule}Button
The row menu: Edit, Duplicate (a copy named "{name} (copy)"), Move up, Move down, Delete.

Deleting asks Delete "{name}"?. The rule stops applying on the next turn. Past violations it logged stay in the activity log. Closing the sheet with unsaved edits asks Discard your changes?.

Rule templates

When an assistant has no rules yet, the Rules tab offers five templates under Start from a template:. Each opens the rule sheet already filled in, in Monitor. Change anything before you press Create rule.

TemplateApplies toAction when enforcedSeverityWhat it says
Stay on topicAgent repliesStrikeMediumOnly discuss your business, products and services; politely decline trivia, homework, coding help, politics and personal opinions, and steer back.
No competitor mentionsAgent repliesRewrite (with retry feedback)LowNever name, recommend, compare against or speculate about competitors.
No pricing promisesAgent repliesRewrite (with retry feedback)MediumNever quote prices, discounts, refunds or terms not in the knowledge, and never promise a price match, future discount or guaranteed refund.
No medical or legal adviceAgent repliesBlock onlyHighNo diagnoses, treatment or dosage advice, or legal advice about specific situations; suggest a qualified professional.
Refuse off-platform contactCustomer messagesStrikeMediumCustomers must not move the conversation to a personal number, email or another app, or ask staff for personal contact details.

Rules can also come from elsewhere: guided setup can add starter rules for your type of business, and Handyman can propose a rule for you to apply.

The Test sheet

Test opens Test guardrails: run a message through every enabled check and rule as if it had arrived now. It is a dry run: nothing is logged against a conversation. It runs the real safety checker, so it needs the Run live tests permission.

GoalProof that a rule catches what you meant, before customers meet it.

  1. 1

    Press Test in the page header

  2. 2

    Pick the direction and channel

    Customer message or Agent reply, and Website chat, WhatsApp or Spoken (any call).

  3. 3

    Paste a message

    Or click a sample: a prompt-injection attempt, a message with a test card number, or an insult.

  4. 4

    Press Run test

    The result appears under the button.

Test result6 controls
VerdictShown
A badge (Pass, Flagged or Blocked) and what would happen: Allowed, Allowed (logged) (a monitored hit), or the action, such as Warning sent or Replaced.
SummaryShown
How many checks ran and the safety checker's result: judge {ms} ms, judge ok or judge skipped (no check needed it).
ViolationsList
Each rule or check that matched, with its kind, severity, mode and reason.
What the model would seeShown
The message after personal data was removed, when redaction applies. For example [card number removed].
What the customer would seeShown
The warning, replacement or closing message the customer would get.
This would end the conversation.Shown
Shown in red when the hit would end the conversation.

The Activity tab

Activity is the log of every guardrail hit: monitored or enforced, customer message or reply. Use it to tune rules before enforcing them and to see who was warned, blocked or handed over.

Numbers and chart6 controls
ViolationsShown
Every logged hit in the window, with the change against the previous period of the same length.
Blocked or rewrittenShown
Hits where a message or reply was blocked, replaced or rewritten.
Sessions endedShown
Conversations a guardrail ended.
HandoffsShown
Conversations a guardrail handed to your team.
Top triggeredList
The rules and checks that fired most. "Nothing triggered in this window." when empty.
Violations per dayShown
A chart by outcome: Logged only, Blocked / rewritten, Handed off, Sessions ended.
Filters8 controls
WindowChoice
The period for the numbers, chart and table.
Options Last 7 daysLast 30 daysLast 90 days
DirectionChoice
Which side of the conversation.
Default Both directionsOptions Both directionsCustomer messagesAgent replies
CheckChoice
Which kind of check fired.
Default All checksOptions ManipulationContentCustom ruleBlocklistPersonal dataTool result injectionPrompt leakSecretLinkCooldownJudge error
ActionChoice
What was done.
Default All actions
SeverityChoice
Low, Medium or High.
Default All severities
ModeChoice
Monitor or Enforce.
Default All modes
RuleChoice
One custom rule.
Default All rules
Include playgroundSwitch
Playground turns are logged as sandbox and left out unless you tick this.
Default Off
ColumnShows
TimeWhen the check fired.
ConversationA link to the conversation. Playground tests carry a sandbox tag.
DirectionCustomer messages or Agent replies.
RuleThe custom rule or built-in check, for example Content · harassment.
ModeMonitor or Enforce.
ActionWhat was done (see below).
SeverityLow, Medium or High.
ReasonWhy it matched, in a sentence.
JudgeHow long the safety checker took, in ms.
Columns of the events table
LoggedMonitor mode: recorded, nothing changed.
RedactedPersonal data removed from the customer's message.
Warning sentThe customer got the warning message (a strike).
Final warningThe customer got the final warning message.
ReplacedThe reply (or the blocked message's answer) was swapped for the replacement reply.
RewrittenThe assistant rewrote its reply to comply.
EndedThe conversation was ended.
Ended + blockedThe conversation was ended and the contact blocked for the cooldown.
Handed offThe conversation was handed to your team.
Blocked contactA message from a contact in cooldown got only the blocked message.
  • The footer reads "Showing {shown} of {total} violations", with paging and Export CSV.
  • From a conversation's Activity link, the tab shows "Showing violations for one conversation" with Show all to clear it.
  • On the conversation page, a guardrails panel lists the checks that fired in that conversation turn by turn, with Open in Activity, and replies that were hit carry a Guardrail hit mark. See Inside a conversation.

What the customer sees

Customers never see a rule's name or reason. They see one of the messages under Built-in checksMessages customers see, sent as the assistant. Each can be worded differently per channel.

SituationThe customer gets
Their message breaks a striking rule, warnings remainThe Warning message instead of an answer. Default: "I can't help with that. Let's keep this conversation respectful and about how I can assist you."
The last warning before the final actionThe Final warning message. Default: "This is a final reminder: if this continues I'll have to end the conversation."
A guardrail ends the conversationThe Closing message, then the conversation ends. On a call it is spoken before the call hangs up. Default: "I'm ending this conversation now. Goodbye."
They write while blockedThe Blocked contact message. Default: "This assistant isn't available to you right now." Empty means silence.
A reply breaks a rule, or a Block only rule matchesThe Replacement reply. Default: "I'm not able to help with that. Is there something else I can do for you?"
A guardrail hands overThe handover acknowledgement from Hand over to a person, or "A human team member will pick this conversation up shortly."
  • A problem in the assistant's own reply never warns the customer: they did nothing wrong. The reply is replaced or rewritten, quietly.
  • If a guardrail replaces a reply, any cards or buttons the reply would have shown are dropped too.
  • After a warning, the assistant carries on normally and does not mention the warning again.

Text channels, calls and streaming

Checked before sending (blocking)
  • The default on WhatsApp, website chat, Messenger, Instagram, SocialHub and email.
  • The reply is held until the checks pass, so the customer only ever sees the final text.
  • A Rewrite rule gets its chance to reword the reply before anything is sent.
Checked while sending (streaming)
  • The default on phone calls, and any channel where Reply screening is set to streaming.
  • The reply goes out while the checks run, and is cut if a violation is found.
  • On a call the assistant is interrupted mid-sentence and speaks the replacement. In a chat the bubble's text is replaced.

Ending or handing over a conversation

A guardrail ends or hands over a conversation in three ways: a rule whose action is Hand off or End immediately, or a customer reaching the end of the warning ladder, where your Final action decides.

Final actionWhat happens
End the conversation (default)The closing message, then the conversation ends (a call hangs up). It is marked Ended by guardrail: {rule}.
Hand off to a humanThe conversation is handed to your team, who are alerted as for any handover. See Hand over to a person.
End + block the contactAs End, and the contact is refused for the cooldown: a WhatsApp number, a website chat visitor or a SocialHub contact. A website visitor's IP address is also refused for a shorter time, so starting a new chat does not help.
  • A Hand off rule wins over everything else that matched in the same turn.
  • Your team gets a notification when a guardrail ends a conversation or hands it over. See Notifications.
  • The ladder, the cooldowns and unblocking are set under Built-in checksAdvanced. See Built-in checks.

Limits

Questions people ask

Keep going
Guardrails · HeyServo Docs