Skip to main content
Use Agents → Permissions → JWT-based permissions to grant permissions from JWT claims. These rules read the decoded JWT payload directly; you do not need to configure field mappings first.

Prerequisites

  • Admin access to AGO
  • Working widget JWT authentication
  • Active permissions created under Agents → Permissions, with the intended agents linked to them
Custom permissions grant access to configured agents and content. A permission named admin or analytics does not grant administration or reporting roles. Manage those roles separately through user management.

From JWT Claims to Permissions

1

Choose the claims to match

For example, your authentication service might issue a signed token with these claims. This is a payload illustration, not a usable token; use the issuer, audience, expiry, and signing configuration required by your workspace.
Use the claim’s exact name as the rule field. Nested claims use dot notation, such as user_metadata.subscription or location.region.
2

Create the rule

  1. Open Agents → Permissions → JWT-based permissions.
  2. Click Add JWT Rule and name the rule.
  3. Add a condition with a field, operator, and value. For the token above, use field department, operator Equals, and value IT.
  4. Select the permissions to grant, keep the rule active, and click Save.
Each condition must match for the rule to apply. An active rule with no conditions does not match. All matching rules contribute permissions; their priorities do not make one rule cancel another rule’s grants.
3

Link agents and test

  1. Edit each intended agent under Agents and select its permissions in its Permissions tab.
  2. Authenticate the widget with a valid token issued for a non-admin test user.
  3. Check that the expected agents are available. Repeat with a user whose claims do not match.
The JWT rule grants permissions, not direct agent assignments. Admin accounts can access every agent regardless of these rules, so they are unsuitable for testing customer restrictions.

Example Conditions

The permission names below are examples to create in your workspace. Link the desired agents to each permission before testing. For enterprise users in Europe, put both conditions in the same rule: user_metadata.subscription Equals enterprise, and location.region Equals europe. To grant one permission to either pro or enterprise subscribers, create two matching rules that grant the same permission. Multiple conditions within one rule use AND, not OR. For a non-trial audience, combine an Exists condition on user_metadata.subscription with a Not Equals condition whose value is trial. The existence check avoids treating a missing claim as a known non-trial subscription.

JWT Field Mappings Are Separate

Under Support → Settings → Your channels → Widget & SDK, JWT field mappings copy claim values into the user’s information under a label, for example user_metadata.subscription shown as Subscription Tier. JWT-based permission rules don’t use these labels. They always read the original claim path, here user_metadata.subscription.

Verify the Result

Use a representative non-admin account with a valid signed token. Check matching and nonmatching values, missing claims, and users who match more than one rule. Confirm both the visible agents and whether the user can start the intended conversation. The chat’s profile selector can help preview a permission, but it does not change your identity or test another user’s JWT. Portal sign-in also has a separate email access check.

Troubleshooting

  1. Check that the rule and its granted permissions are active.
  2. Check the original JWT claim name, including case and nested path.
  3. Verify that every condition matches the actual payload.
  4. Check that the intended agents are active and linked to the granted permissions.
JWT rules read the original token payload. A display label such as Subscription Tier does not replace the claim path user_metadata.subscription. Check the payload issued by your authentication service.
Review all matching rules, including email/domain rules and direct permission assignments. Grants accumulate; increasing a rule’s priority does not remove permissions granted elsewhere. Test with a non-admin account.