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#
Topic gating is currently configured through the agent settings API. Update your agent with three settings keys:
gated_enabled(boolean) — turns topic gating on or offgated_topics(array of strings) — the topics to restrict. Be specific — for example, use "enterprise pricing tiers" rather than just "pricing" to avoid false positives.gated_message(string) — the message anonymous users see when asking about a gated topic. When empty, it defaults to: "This information is available to registered users. Please sign in or contact us for details."
curl -X PATCH https://api.respondo.ai/api/v1/agents/<agent-uuid> \
-H "Authorization: Bearer <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"settings": {
"gated_enabled": true,
"gated_topics": ["enterprise pricing tiers", "internal roadmap"],
"gated_message": "This information is available to registered users. Please sign in or contact our sales team for details."
}
}'Content Gate also 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 Type | Identity Fields | Gated Topics |
|---|---|---|
| Authenticated | Has userId or email (HMAC-verified when identity_secret is configured) | Full answers — no restrictions |
| Anonymous | Only visitorId, or no identity at all | Sees the gated response message |
| Failed HMAC | Has userId but invalid userHash | Treated as anonymous — sees gated response |
identity_secret configured, any userId/email passed to identify() counts as authenticated without verification — a visitor can self-identify from the browser console and unlock gated topics. Set identity_secret and pass userHash to make authentication verifiable; see Identity Verification (HMAC). The "Failed HMAC" row above applies only when identity_secret is set.Identity Requirement#
For Content Gate to work, you need to pass user identity when initializing the widget. Here is a minimal example:
<!-- 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).