Docs

Content Gate

Restrict specific topics from anonymous (unauthenticated) widget visitors. Authenticated users with verified identity see full answers.

Overview#

Content Gate allows you to define topics that should only be discussed with authenticated users. When an anonymous visitor asks about a gated topic, the AI responds with a custom message instead of the actual answer.

This is useful for protecting sensitive information like:

  • Pricing details and discount structures
  • Enterprise features or internal roadmap
  • API documentation or technical specs
  • Partner-specific information

Setup#

Content Gate is configured in your agent settings under the Content Gate section:

1

Enable Content Gating

Toggle on Enable content gating in the Content Gate section of your agent settings.

2

Add Gated Topics

Add up to 10 topics that should be restricted. Be specific — for example, use "enterprise pricing tiers" rather than just "pricing" to avoid false positives.

3

Set the Gated Response

Write a custom message that anonymous users will see when asking about gated topics. For example:

Example gated responsetext
This information is available to registered users.
Please sign in or contact our sales team for details.
4

Set Up User Identification

Content Gate requires user identification to distinguish authenticated from anonymous visitors. See the User Identification docs for setup instructions.

How It Works#

When a message arrives from the widget, the system checks whether the user has a verified identity:

User TypeIdentity FieldsGated Topics
AuthenticatedHas userId or email with valid HMACFull answers — no restrictions
AnonymousOnly visitorId, or no identity at allSees the gated response message
Failed HMACHas userId but invalid userHashTreated as anonymous — sees gated response
Content Gate works at the AI instruction level. When an anonymous user asks about a gated topic, the AI is instructed to respond with your custom message. Non-gated topics are answered normally for everyone.
Content Gate is best-effort, not a cryptographic access control. The AI may occasionally provide partial answers to edge-case questions. For strict data security, consider separating sensitive content into a different agent entirely.

Identity Requirement#

For Content Gate to work, you need to pass user identity when initializing the widget. Here is a minimal example:

Widget initialization with identityhtml
<!-- For authenticated users -->
<script>
  Respondo.init({ agentId: 'YOUR_AGENT_ID' });
  Respondo.identify({
    userId: 'user-123',
    email: 'user@example.com',
    userHash: 'HMAC_SHA256_HASH'  // Required if identity_secret is set
  });
</script>

<!-- For anonymous visitors — just init without identify -->
<script>
  Respondo.init({ agentId: 'YOUR_AGENT_ID' });
  // No identify() call — user is anonymous, gated topics will be restricted
</script>

For HMAC verification setup, see Identity Verification (HMAC).

Content Gate vs Topics to Avoid

Topics to Avoid blocks topics for all users — both authenticated and anonymous. Use it for topics the agent should never discuss (e.g., competitor comparisons, legal advice).

Content Gate blocks topics only for anonymous users. Authenticated users see full answers. Use it for information you want to share with customers but not with the public (e.g., pricing, internal features).