Role-Based Access Control
Implement security and access management for AI Builder applications with RBAC
Role-Based Access Control (RBAC) is the security model used in Prisme.ai to manage who can access, modify, and use different parts of your workspace. It ensures that users only have the permissions they need while protecting sensitive information and functionality.
RBAC Fundamentals
The RBAC system consists of several key elements:
- Roles: Sets of permissions that can be assigned to users
- Subjects: Resources that can be acted upon (pages, files, events, etc.)
- Actions: Operations that can be performed on subjects (read, create, update, etc.)
- Rules: Define which roles can perform which actions on which subjects
- Conditions: Optional criteria that further restrict when rules apply
These components work together to create a flexible yet secure access control system.
The RBAC system consists of several key elements:
- Roles: Sets of permissions that can be assigned to users
- Subjects: Resources that can be acted upon (pages, files, events, etc.)
- Actions: Operations that can be performed on subjects (read, create, update, etc.)
- Rules: Define which roles can perform which actions on which subjects
- Conditions: Optional criteria that further restrict when rules apply
These components work together to create a flexible yet secure access control system.
RBAC configuration is defined in YAML format and consists of two main sections:
You can access and edit this configuration through your workspace settings.
Prisme.ai includes several built-in roles:
- Owner: Created automatically for workspace creator, has full access
- Editor: Can create and modify content but limited administrative access
- Custom Roles: Additional roles you define for specific needs
The Owner role is special and cannot be modified or deleted. It is automatically assigned to workspace creators and administrators.
Managing Roles and Rules
Accessing RBAC Settings
To view and edit your workspace’s access control configuration:
- Go to your workspace
- Navigate to Settings > Advanced > Manage Roles
- Edit the YAML configuration
- Save your changes
Changes to RBAC settings take effect immediately. Be careful not to lock yourself out!
Defining Roles
Create custom roles to fit your organization’s needs:
The auth
section allows you to automatically assign roles based on authentication providers.
Creating Rules
Define what each role can do with specific rules:
Each rule must include at least:
- action: What can be done (a single action or list)
- subject: What it can be done to (a single subject or list)
Rules can optionally specify:
- role: Which role this applies to (if omitted, applies to everyone)
- conditions: Restrict the rule to specific cases. If omitted (or an empty object), the rule will apply to every instance of specified subject
- inverted: Set to
true
to make this a deny rule instead of allow - reason: Documentation string for the rule
Adding Conditions
Restrict rules to specific situations with conditions:
Conditions use a subset of MongoDB query syntax for powerful filtering.
Common RBAC Patterns
Public Access
Public Access
Control what unauthenticated users can access:
Rules without a role
specified apply to everyone, including unauthenticated users.
Role-Based Access
Role-Based Access
Define what each role can do:
This approach creates a clear hierarchy of access permissions.
API Key Permissions
API Key Permissions
Configure permissions for API access:
This allows creating an internal workspace API key with specific permissions.
The api key value can’t be directly accessed, but instead can be injected in fetch
instruction :
Automatic assignment
Automatic assignment
Automatically assign roles based on SSO provider & auth data :
This reduces manual user management by leveraging authentication information.
Subjects and Actions
RBAC controls access to various resource types through subject and action combinations:
Workspaces
Workspaces
Subject : workspaces
Actions :
read
: allows reading the workspace configurationupdate
: allows updating the workspace configurationdelete
: allows deleting the workspacemanage_security
: allows updating security configurationmanage_permissions
: allows sharing / unsharingaggregate_search
: allows using /search APIget_usage
: allows using /usage APImanage_repositories
: allows managing repositories settingsmanage
: allows all above actions
Pages
Pages
Subject : pages
Actions :
create
: allows creating a pageread
: allows reading pagesupdate
: allows updating pagesdelete
: allows deleting pagesmanage
: allows all above actions
Files
Files
Subject : files
Actions :
create
: allows uploading a fileread
: allows reading filesupdate
: allows updating filesdelete
: allows deleting filesmanage
: allows all above actions
Events
Events
Subject : events
Actions :
create
: allows emitting an eventread
: allows reading eventsmanage
: allows all above actions
Automations
Automations
Subject : automations
Actions :
create
: allows creating an automationread
: allows reading automationsupdate
: allows updating automationsdelete
: allows deleting automationsexecute
: allows executing automationsmanage
: allows all above actions
Secrets
Secrets
Subject : secrets
Actions :
create
: allows creating secretsread
: allows reading secretsupdate
: allows updating secretsdelete
: allows deleting secretsmanage
: allows all above actions
Apps
Apps
Subject : apps
Actions :
create
: allows publishing an appread
: allows viewing/installing appsupdate
: allows updating appsdelete
: allows deleting appsmanage
: allows all above actions
Securing Automations
By default, anyone can execute any automation that has an event or endpoint trigger. To restrict access to sensitive automations:
Define Authorization Action
In your automation, specify an authorization requirement:
The authorizations.action
field specifies a permission key for this automation.
Create Permission Rule
Define who can execute automations with this authorization key:
This restricts execution only to users with the specified role.
Test the Restriction
Verify that:
- Users with the admin role can execute the automation
- Users without the admin role receive an authorization error
- The automation cannot be called indirectly by other automations without permission
Using API Keys
External API Keys
External API Keys
API keys allow programmatic access to your workspace with specific permissions :
- Use Prismeai APIs to generate an api key :
- Include the received apikey in
x-prismeai-api-key
header :
Keep API keys secure. They grant access based on their associated role without requiring user authentication.
Workspace API Keys
Workspace API Keys
For internal API calls from automations, you can define built-in API keys:
This creates an internal API key that automations can use:
Workspace API keys are not visible in the UI and are specifically for internal use.
Example RBAC Configuration
Here’s a complete example of a typical RBAC configuration:
Full RBAC Example
Full RBAC Example
Security Best Practices
Principle of Least Privilege
Give users only the permissions they actually need:
- Start with minimal permissions and add as required
- Use specific conditions to limit rule scope
- Avoid “manage” permission when more specific actions suffice
- Regularly review and prune unnecessary permissions
Secure Public Access
Carefully control what unauthenticated users can do:
- Use explicit conditions on public rules
- Limit event creation to specific event types
- Be cautious with file upload permissions
- Restrict user session events appropriately
Protect Sensitive Automations
Secure automations that access sensitive data:
- Add authorization requirements to important automations
- Create specific roles for administrative functions
- Avoid sensitive data exposure through events
- Test automations with different user roles
Manage API Access
Control programmatic access carefully:
- Create API keys with minimal required permissions
- Rotate API keys regularly
- Monitor API key usage for unusual patterns
- Delete unused API keys promptly
Troubleshooting
Access Denied Unexpectedly
Access Denied Unexpectedly
When users encounter permission errors they shouldn’t:
Check these common issues:
- Verify the user has the correct role assignment
- Look for inverted rules (deny rules) that might be applying
- Check if conditions on rules are unintentionally restrictive
- Ensure the rule order places more specific rules after general ones
Example fix:
Too Much Access
Too Much Access
When users have permissions they shouldn’t have:
Check these common issues:
- Look for overly broad rules without conditions
- Check if the user has multiple roles granting cumulative permissions
- Verify automatic role assignment isn’t giving unintended access
- Ensure public rules (no role specified) aren’t too permissive
Example fix: