Access Tags
Restrict knowledge items to authorised visitors — enforced on our servers, not by the AI
Overview
Some content is not for everyone: member-only documents, region-specific material, paid-tier resources. Access Tags lets one chatbot serve different audiences safely. You put a tag on a knowledge item, and from that moment the item is invisible to every visitor — except those whose page presents that tag, signed by your own server. The restriction is enforced in our retrieval query, before the AI model is involved at all. A visitor without the tag cannot extract the content by clever prompting, because for them it was never retrieved in the first place.
How It Works
- You tag knowledge items - on the Access Tags page or directly through the API; untagged items keep working for everyone
- Your server signs each visitor's tags - when a logged-in member loads your page, your back end decides their entitlements and signs them with a secret key only you hold
- The widget sends the signed claim - it travels with every chat message; the browser only transports it and cannot alter it without breaking the signature
- We verify and filter - a valid signature unlocks items with matching tags; a missing, tampered or expired claim means the visitor gets public content only
Setting It Up
Turn the feature on at the Access Tags page in your dashboard — a signing secret is generated for you. Keep it on your server only; anyone who has it can mint valid claims.
Tag your content either on the same page, or when pushing items through the API:
POST /api/v1/knowledge/text/
{
"title": "Members-only price list",
"content": "...",
"website_id": "123",
"access_tags": ["premium"]
}
Then have your server print the signed claim next to the widget snippet. The message to sign is the comma-separated tag list, joined with a pipe and the expiry time when you use one:
<?php
$tags = "members,premium"; // this visitor's entitlements
$expires = time() + 3600; // unix seconds, optional but recommended
$sig = hash_hmac("sha256", $tags . "|" . $expires, $SECRET);
?>
<script>
window.Asyntai = window.Asyntai || {};
window.Asyntai.accessTags = "<?php echo $tags; ?>";
window.Asyntai.accessTagsExpires = "<?php echo $expires; ?>";
window.Asyntai.accessTagsSignature = "<?php echo $sig; ?>";
</script>
The same signature in Node.js and Python:
// Node.js
const crypto = require("crypto");
const sig = crypto.createHmac("sha256", SECRET)
.update(tags + "|" + expires).digest("hex");
# Python
import hmac, hashlib
sig = hmac.new(SECRET.encode(), f"{tags}|{expires}".encode(),
hashlib.sha256).hexdigest()
Without an expiry, sign just the tag string on its own. With one, a claim stops working the moment it passes — useful when entitlements can be revoked, since the visitor has to reload a page you control to get a fresh claim.
What Is Guaranteed
- Server-side enforcement - the filter runs inside our database query at retrieval; tagged items are absent from the AI's context for unauthorised visitors, so there is nothing to leak
- Fail closed everywhere - no signature, wrong signature, expired claim, feature switched off, plan downgraded: in every one of these cases the visitor gets public content only, never more
- The browser cannot forge access - editing the tags in developer tools breaks the signature; only your server holds the secret
- Your entitlement logic stays yours - we never learn how you decide who gets which tag; we only verify that your server said so
Good To Know
- Access Tags is authorisation, User Context is personalisation - use User Context to tell the AI about the member; use Access Tags to control which knowledge the AI may draw on
- Website crawl content is always public - it comes from your public website, so there is nothing to restrict; tags apply to text, file and API items
- A visitor needs only one matching tag - an item tagged with two tags is available to a visitor holding either of them
- Regenerating the secret invalidates every old claim - do it if the secret may have leaked, then update your pages to sign with the new one
- Tag names are up to you - up to 20 per item, 50 characters each, no commas or pipes; they never appear in the visitor-facing chat
Pairs with User Context: one feature controls which knowledge the AI may use for this visitor, the other tells the AI who the visitor is.
User Context Pass logged-in user data to your AI chatbot for personalized conversationsNote: Access Tags is part of an Enterprise agreement. Email [email protected] and we will walk you through it.