Skip to main content
Guardrails check what visitors send and what your Agent answers before the answer reaches your page. Turn them on per index in Agent Studio.

How guardrails work

Guardrails run on the Webless servers, inside the Agent runtime. Visitors can’t switch them off from the browser, whether you use the hosted Agent script or a custom UI built with @webless/agent.
Guardrails protect Agentic mode conversations. The classic search widget doesn’t use them. See Agent Studio and Agentic mode.

What guardrails protect

Every index gets the same Webless default protection. You can’t edit individual rules, but you can limit the topics your Agent answers.

Protection from wrong answers

Guardrails check your Agent’s own replies too, not only what visitors send. While your Agent answers, Webless reviews the text of the reply in short parts of a few sentences, before each part reaches the page. It stops the reply if it:
  • reveals your Agent’s instructions, hidden rules or configuration;
  • contains harmful, abusive or illegal content;
  • makes a guarantee, refund, discount or other promise that isn’t your company’s stated policy;
  • wanders outside your allowed topics, other than greetings and questions about your company.
Prices, plans, policies and contact details from your website are allowed. If a reply is stopped, the visitor sees the text up to that point, followed by “I can’t help with that request.” The Answer checks (agent replies) card in the guardrail history counts these stops. If the guardrails service is briefly unavailable, replies continue without this check, and the history counts them as messages with an unavailable check.

Personal data that Webless masks

Webless replaces each detected value with a placeholder, such as <CREDIT_CARD> or <US_SSN>. The AI model only ever sees the placeholder. Agent answers keep email addresses and phone numbers, so your Agent can still share your business’s contact details.

Turn on guardrails

Open the Guardrails tab

In the Webless Console, open your index, go to Agent Studio, and choose the Guardrails tab.

Enable guardrails

Select Enable guardrails. Guardrails are off by default.

Add allowed topics (optional)

In Allowed topics, enter one topic per line, for example:
You can add up to 20 topics of up to 80 characters each. Your Agent politely refuses questions outside these topics. Leave the box empty to allow any topic.Questions about your company itself, such as your services, team, clients and success stories, are always allowed. A topic you add is allowed even when it isn’t about your company.

Save

Choose Save guardrails. Webless applies the settings to your Agent Studio preview right away.

Publish to production

Return to Setup and choose Publish to production. Live visitors get guardrails only after you publish.
Allowed topics are strict. If a topic list is too narrow, your Agent refuses ordinary questions about your business. Start broad, such as “Our products and services”, and test it in the preview with questions your visitors usually ask. Then use the refused topics in the guardrail history to widen the list.

What visitors see

  • A blocked message gets the reply “I can’t help with that request.” The message never reaches the AI model.
  • A blocked answer stops where the check failed, and the reply ends with “I can’t help with that request.” Any text the visitor already saw stays on the screen.
  • A message with personal data still gets an answer. The AI model sees a placeholder, such as <CREDIT_CARD>, instead of the value.

Review what Webless blocked

After you save with guardrails on, the What Webless blocked history appears below the settings. Choose 7d, 30d, or 90d to change the period. Counts include both visitor messages and Agent answers, and one message can fail more than one check. Answer checks (agent replies) usually shows 0: the checks on visitor messages refuse most problems before your Agent writes anything, and your Agent answers from your own content. If a check was unavailable, a note below the cards shows how many messages it affected.
The history stores counts and short topic labels only. Webless never stores the text of a blocked message, and it keeps guardrail history for 90 days. Reload the tab to see the latest counts.

See which topics were refused

When the AI review refuses a question as off-topic, it also names the subject in a few words, such as Weather or Job openings. The Off-topic card lists these refused topics as chips, with how many messages each one refused in the chosen period.
  • The card shows the five most refused topics. Choose +N more to see up to ten, and Show fewer to collapse them.
  • Topics with the same count are listed most recent first, so new refusals don’t hide behind older ones.
  • A topic is a category, never the visitor’s words. It holds letters only, with no digits or @, so it can’t contain a card number, phone number, email address or street number. The AI review is also told never to include names or personal details.
  • Refusals from before this feature have no topic. They still count in the Off-topic total.

Allow a refused topic

If a refused topic is something your Agent should answer, add it from the chip.

Open the topic

In the Off-topic card, choose the topic chip. The popover shows how many times the topic was refused in the chosen period, for example “Refused 3 times in the last 30 days.”

Add it

Choose Add to allowed topics. Webless adds the topic to Allowed topics and saves, the same as Save guardrails. Any other unsaved change in the tab is saved too.

Publish

The preview uses the new topic right away. Publish from Setup to apply it on your live site.
Add to allowed topics is off when the topic is already in your list, in any letter case, or when you already have 20 topics. The popover says which one applies.
Add only topics that fit your business. For example, on a recruiting site, Hiring process belongs in your list, and Jokes doesn’t.

Test guardrails

Save your settings

Save the Guardrails tab and wait for the preview to finish rebuilding.

Start a fresh conversation

Open the Agent Studio preview and start a new conversation. A conversation that was open before you saved keeps the old settings, and reloading the page isn’t enough.

Send a test message

Ask a question that fits your allowed topics and includes the public test card number, for example:
Your Agent answers without seeing the card number. To test prompt injection, send:
Your Agent replies “I can’t help with that request.”

Send an off-topic question

If you set allowed topics, ask something unrelated to your business, for example:
Your Agent replies “I can’t help with that request.”

Check the history

Reload the Guardrails tab. Personal data protected shows Card number 1, Prompt injection shows one blocked check, and Off-topic shows a chip such as Weather 1.

Troubleshooting

Guardrails are rolling out by workspace. If you don’t see the Guardrails tab in Agent Studio, contact the Webless team to switch it on for your workspace.
Check that:
  • You published to production after you saved guardrails.
  • Your index uses Agentic mode. The classic search widget doesn’t use guardrails.
Your allowed topics may be too narrow. Check the refused topics in the Off-topic card and add the ones that fit your business, or clear the box to allow any topic. Then publish again.
Saving guardrails rebuilds the preview, which ends conversations that were already open. Send a new message to start a fresh conversation with the new settings.
Webless detects US personal data formats. Check that your test value is a valid US format, and that the question fits your allowed topics. An off-topic question is refused before masking applies.

Need help?

Contact the Webless team with:
  • Your index ID
  • Whether guardrails are enabled and the time of your last publish
  • The message you sent and the reply you got, without any real personal data