Product
User Permissions & Roles
Comprehensive guide to user permissions, roles, and access control in Twig AI
TL;DR
Comprehensive guide to user permissions, roles, and access control in Twig AI. Role-Based Access Control (RBAC) determines user permissions.
Key Takeaways
- Overview
- User Roles
- Permission Matrix
- Managing User Permissions
- Custom Permissions
- Permission Scenarios
Comprehensive guide to user permissions, roles, and access control in Twig AI.
Overview
Role-Based Access Control (RBAC) determines user permissions.
4 roles (from least to most permissions):
- User (readonly): Query agents only
- Manager: Create agents, manage team resources
- Admin: Full agent/data management, user management
- Super Admin: All permissions + billing + org deletion
Assigned: Admin → Users → [User] → Edit → Role dropdown
User Roles
Role Hierarchy
Super Admin (Highest)
↓
Admin
↓
Manager
↓
User (Base)
Role Definitions
Super Admin
Description: Complete platform control, typically for organization owners and IT administrators.
Permissions:
| Category | Permissions |
|---|---|
| Organization | • Full administrative access |
| Users | • Create, edit, delete all users |
| Agents | • Create, edit, delete all agents |
| Data Sources | • Create, edit, delete all data sources |
| Analytics | • Access all analytics dashboards |
| Settings | • Modify all system settings |
Use Cases:
- Organization founders/owners
- IT administrators
- Platform administrators
Assignment: Limited to 2-3 users per organization (recommended)
Admin
Description: Day-to-day administrative control without billing or critical system changes.
Permissions:
| Category | Permissions |
|---|---|
| Organization | • View organization settings |
| Users | • Create, edit, delete users (except Super Admins) |
| Agents | • Create, edit, delete all agents |
| Data Sources | • Create, edit, delete all data sources |
| Analytics | • Access admin dashboards |
| Settings | • Modify most settings |
Use Cases:
- Team leads
- Department heads
- Operations managers
Assignment: 5-10 users typically
Manager
Description: Team-level management with permissions for their department or group.
Permissions:
| Category | Permissions |
|---|---|
| Organization | • View organization settings |
| Users | • View users in their groups |
| Agents | • Create agents |
| Data Sources | • Create data sources |
| Analytics | • Access management dashboard |
| Settings | • Manage their own API keys |
Use Cases:
- Team managers
- Project leads
- Department supervisors
Assignment: Team/project leaders
User
Description: Standard user access for day-to-day use of AI agents.
Permissions:
| Category | Permissions |
|---|---|
| Organization | • View basic organization info |
| Users | • View their own profile |
| Agents | • Use agents they have access to |
| Data Sources | • ❌ Cannot access data sources |
| Analytics | • View their own usage statistics |
| Settings | • Update profile (name, photo) |
Use Cases:
- End users
- Employees using AI assistance
- External users (with restrictions)
Assignment: All standard users
Permission Matrix
Complete Permission Reference
| Permission | Super Admin | Admin | Manager | User |
|---|---|---|---|---|
| Organization Management | ||||
| View organization | ✅ | ✅ | ✅ | ✅ |
| Edit organization settings | ✅ | ✅ | ❌ | ❌ |
| Delete organization | ✅ | ❌ | ❌ | ❌ |
| Manage billing | ✅ | ❌ | ❌ | ❌ |
| Configure SSO | ✅ | ✅ | ❌ | ❌ |
| User Management | ||||
| View all users | ✅ | ✅ | Group only | Self only |
| Create users | ✅ | ✅ | ❌ | ❌ |
| Edit users | ✅ | ✅ | ❌ | Self only |
| Delete users | ✅ | ✅ | ❌ | ❌ |
| Assign roles | ✅ | ✅ (up to Manager) | ❌ | ❌ |
| Group Management | ||||
| View groups | ✅ | ✅ | Assigned only | ❌ |
| Create groups | ✅ | ✅ | ❌ | ❌ |
| Edit groups | ✅ | ✅ | Own groups | ❌ |
| Delete groups | ✅ | ✅ | ❌ | ❌ |
| Add/remove members | ✅ | ✅ | Own groups | ❌ |
| Agent Management | ||||
| View agents | ✅ All | ✅ All | Assigned | Assigned |
| Create agents | ✅ | ✅ | ✅ | ❌ |
| Edit agents | ✅ All | ✅ All | Own/Assigned | ❌ |
| Delete agents | ✅ | ✅ | Own only | ❌ |
| Manage agent permissions | ✅ | ✅ | Own agents | ❌ |
| Use agents in Playground | ✅ | ✅ | ✅ | ✅ |
| Data Source Management | ||||
| View data sources | ✅ | ✅ | Own only | ❌ |
| Create data sources | ✅ | ✅ | ✅ | ❌ |
| Edit data sources | ✅ | ✅ | Own only | ❌ |
| Delete data sources | ✅ | ✅ | ❌ | ❌ |
| Trigger processing | ✅ | ✅ | ✅ | ❌ |
| View connection credentials | ✅ | ❌ | ❌ | ❌ |
| Analytics & Reporting | ||||
| View super admin dashboard | ✅ | ❌ | ❌ | ❌ |
| View admin dashboard | ✅ | ✅ | ❌ | ❌ |
| View management dashboard | ✅ | ✅ | ✅ | ❌ |
| View user dashboard | ✅ | ✅ | ✅ | ✅ |
| Export data | ✅ | ✅ | Own data | Own data |
| View interaction history | ✅ All | ✅ All | Group only | Self only |
| Inbox & Training | ||||
| View all interactions | ✅ | ✅ | Group only | Self only |
| Edit responses | ✅ | ✅ | ✅ | ❌ |
| Mark as accurate/inaccurate | ✅ | ✅ | ✅ | ❌ |
| Create KB articles from inbox | ✅ | ✅ | ✅ | ❌ |
| Knowledge Base | ||||
| View KB articles | ✅ | ✅ | ✅ | ✅ |
| Create KB articles | ✅ | ✅ | ✅ | ❌ |
| Edit KB articles | ✅ | ✅ | Own only | ❌ |
| Delete KB articles | ✅ | ✅ | ❌ | ❌ |
| Manage KB tags | ✅ | ✅ | ❌ | ❌ |
| API & Integration | ||||
| View org API keys | ✅ | ✅ | ❌ | ❌ |
| Create org API keys | ✅ | ✅ | ❌ | ❌ |
| Create personal API keys | ✅ | ✅ | ✅ | If enabled |
| Manage webhooks | ✅ | ✅ | ❌ | ❌ |
| Configure integrations | ✅ | ✅ | ❌ | ❌ |
| Security & Audit | ||||
| View audit logs | ✅ All | ✅ All | Self only | ❌ |
| Configure security policies | ✅ | ❌ | ❌ | ❌ |
| Manage SSO | ✅ | ✅ | ❌ | ❌ |
| View sensitive data | ✅ | ❌ | ❌ | ❌ |
Managing User Permissions
Creating Users with Roles
Method 1: Individual User Creation
- Navigate to Administration → Users
- Click Create New User
- Fill in user details:
- Email: user@company.com (required)
- Name: Full name
- Role: Select from dropdown
- Groups: Assign to groups (optional)
- Status: Active/Inactive
- Click Send Invitation
- User receives email with setup link
Method 2: Bulk User Import
-
Administration → Users → Import Users
-
Download CSV template
-
Fill in user details:
Email,Name,Role,Groups,Status john@company.com,John Doe,MANAGER,"Support Team,Tier 2",ACTIVE jane@company.com,Jane Smith,USER,"Support Team",ACTIVE -
Upload CSV file
-
Review and confirm import
-
Users receive invitations automatically
Method 3: SSO Auto-Provisioning
-
Administration → SSO → Auto-Provisioning
-
Enable Just-In-Time (JIT) Provisioning
-
Configure default role: User (typically)
-
Map SSO attributes to user fields:
SSO Attribute → Twig Field email → email displayName → name department → default_group jobTitle → custom_field -
Users created automatically on first login
Changing User Roles
Single User:
- Administration → Users → Select user
- Click Edit
- Change Role dropdown
- Confirm: "Are you sure? This will change permissions immediately."
- Click Save
Bulk Role Change:
- Administration → Users
- Select multiple users (checkbox)
- Bulk Actions → Change Role
- Select new role
- Confirm changes
- Users notified of permission change (optional)
Deactivating Users
Temporary Deactivation:
- Administration → Users → Select user
- Click Deactivate
- User status: Inactive
- Effects:
- Cannot log in
- API keys disabled
- Removed from groups (temporarily)
- Data and history preserved
Permanent Deletion:
- Administration → Users → Select user
- Click Delete
- Select deletion mode:
- Soft Delete: User hidden, data preserved
- Hard Delete: User and all data removed (irreversible)
- Confirm deletion
- Effects:
- User completely removed
- Group memberships removed
- API keys revoked
- Owned agents reassigned or deleted
Custom Permissions
Fine-Grained Control (Enterprise)
Enterprise customers can create custom permission sets:
Example: "Data Analyst" Custom Role
{
"roleName": "Data Analyst",
"baseRole": "USER",
"additionalPermissions": [
"VIEW_ALL_ANALYTICS",
"EXPORT_DATA",
"VIEW_INTERACTION_HISTORY",
"CREATE_REPORTS"
],
"restrictions": [
"CANNOT_EDIT_AGENTS",
"CANNOT_CREATE_AGENTS",
"CANNOT_MODIFY_DATA_SOURCES"
]
}
Setup:
- Contact support or use Enterprise API
- Define custom role with specific permissions
- Assign to users
- Custom role appears in role dropdown
Resource-Level Permissions
Control access at the individual resource level:
Example: Agent-Specific Permissions
User: john@company.com
├─ Agent 1: View & Use
├─ Agent 2: Edit
├─ Agent 3: No Access
└─ Agent 4: View Only (no use)
Configuration:
- Open Agent → Settings → Permissions
- Click Add User Permission
- Search for user
- Select permission level:
- No Access: Cannot see agent
- View Only: Can see but not use
- View & Use: Can query agent
- Edit: Can modify settings
- Manage: Full control including deletion
- Save
Permission Scenarios
Scenario 1: Customer Support Organization
Roles & Groups:
Super Admin (1)
└─ CEO
Admin (2)
├─ Head of Support
└─ IT Manager
Manager (5)
├─ Support Team Lead (Group: Support Team)
├─ Sales Team Lead (Group: Sales Team)
└─ Engineering Lead (Group: Engineering)
User (100+)
├─ Support Agents → Group: Support Team
├─ Sales Reps → Group: Sales Team
└─ Engineers → Group: Engineering
Agent Access:
- Support Agent → Support Team group only
- Sales Agent → Sales Team group only
- Engineering Agent → Engineering group + private data
Scenario 2: Multi-Tenant Consulting Firm
Structure:
Super Admin
└─ Firm Owner
Admin (per client)
├─ Client A Admin → Group: Client A
├─ Client B Admin → Group: Client B
└─ Client C Admin → Group: Client C
Manager (per client)
├─ Client A Consultants → Group: Client A
└─ Client B Consultants → Group: Client B
User
└─ Consultants assigned to client groups
Agent Isolation:
- Each client has dedicated agents
- Agents restricted to client-specific groups
- Data sources scoped per client
- Complete data isolation
Scenario 3: Enterprise with Contractors
Setup:
Internal Users
├─ Super Admin (2)
├─ Admin (5)
├─ Manager (20)
└─ User (500)
External Users
└─ Contractor (50)
├─ Group: External Contractors
├─ Role: User (limited)
└─ Restrictions:
• No data export
• No analytics access
• Time-limited access
• Specific agents only
Contractor Permissions:
- Cannot view organization settings
- Cannot see other users
- Cannot create/edit agents
- Can only use assigned agents
- No API access
- Session timeout: 30 minutes (vs 8 hours for internal)
Security Best Practices
1. Role Assignment
✅ Do:
- Assign minimum necessary role
- Regular role reviews (quarterly)
- Document why Super Admins are needed
- Limit Super Admins to 2-3 maximum
- Use Manager role for team leads
- Default new users to User role
❌ Don't:
- Give everyone Admin role "just in case"
- Make all managers Super Admins
- Skip role justification
- Forget to review after org changes
2. Principle of Least Privilege
Implement progressively:
Week 1: Assign basic roles Month 1: Add group-based restrictions Month 3: Implement resource-level permissions Month 6: Fine-tune based on usage patterns
3. Access Reviews
Monthly:
- Review new user assignments
- Check for role escalations
- Verify group memberships
Quarterly:
- Full permission audit
- Recertify privileged access (Admin+)
- Remove unused accounts
- Update group structures
Annually:
- Review role definitions
- Update permission policies
- Train admins on permission management
4. Segregation of Duties
For sensitive operations:
| Action | Required Role | Approval Required |
|---|---|---|
| Create agent | Manager+ | No |
| Add sensitive data source | Admin+ | Manager approval |
| Export all org data | Super Admin | CEO approval |
| Delete organization | Super Admin | Board approval |
| Change security policy | Super Admin | CISO approval |
Monitoring & Auditing
Permission Change Logs
All permission changes are logged:
View Logs:
Administration → Audit Logs → Filter: Permission Changes
Logged Events:
- Role changes
- Group membership changes
- Permission grants/revokes
- User activations/deactivations
- Role definition changes
Example Log:
{
"timestamp": "2024-01-15T14:30:00Z",
"event": "ROLE_CHANGED",
"actor": "admin@company.com",
"subject": "user@company.com",
"changes": {
"role": {
"from": "USER",
"to": "MANAGER"
}
},
"reason": "Promoted to team lead",
"ipAddress": "192.168.1.1"
}
Access Reports
Available Reports:
- User Permissions Report
- All users with their roles and groups
- Export to CSV
- Privileged Access Report
- All Admins and Super Admins
- Last login, last activity
- Requires quarterly recertification
- Inactive Users Report
- Users who haven't logged in (configurable period)
- Candidates for deactivation
- Permission Changes Report
- All permission changes in period
- Grouped by type, user, or actor
API Access Control
API Key Permissions
API keys inherit user permissions:
| User Role | API Key Capabilities |
|---|---|
| Super Admin | Full API access, all operations |
| Admin | Most operations, excluding billing |
| Manager | CRUD for own resources, read for group |
| User | Chat/completion, read own data |
Scoped API Keys
Create API keys with limited scope:
curl -X POST https://api.twig.so/api/api-keys \
-H "Authorization: Bearer YOUR_KEY" \
-d '{
"name": "Production Chat API",
"scope": ["CHAT", "VIEW_AGENTS"],
"agentIds": ["agent-1", "agent-2"],
"rateLimit": 1000,
"expiresAt": "2024-12-31"
}'
Scope Options:
CHAT: Chat/completion requests onlyVIEW_AGENTS: List and read agentsMANAGE_AGENTS: Create/edit/delete agentsVIEW_DATA: Read data sources and analyticsMANAGE_DATA: Modify data sourcesADMIN: Full administrative access
Troubleshooting
User Can't Perform Action
Diagnosis:
- Check user's role: Administration → Users → [User]
- Check group memberships
- Check resource-specific permissions
- Review audit logs for any restrictions
Common Issues:
Insufficient Role:
Error: "You don't have permission to create agents"
Solution: User role must be Manager or higher
Not in Group:
Error: "Agent not found"
Solution: Agent is group-restricted; add user to group
Resource-Specific Restriction:
Error: "You can only edit agents you created"
Solution: User is Manager; only Admins can edit all agents
Permission Changes Not Taking Effect
Solutions:
- Have user log out and back in
- Clear browser cache
- Check session timeout settings
- If SSO, verify attribute sync
Next Steps
- Agent Permissions - Control agent access
- Group Management - Organize users
- SSO Integration - Enterprise authentication
- Audit Logs - Track all activities
- Security Best Practices - Secure your org
Agent Instructions: Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.
Perform an HTTP GET request on the current page URL with the ask query parameter:
GET /dev/product/administration/user-permissions.md?ask=<question>
The question should be specific, self-contained, and written in natural language. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.
Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
Related Pages
Integrations
Industries
Last updated January 26, 2026


