Roles and Policies#
OSMO ships with preconfigured roles that cover common use cases out of the box. Most administrators do not need to create or modify roles — simply assign users to the built-in roles described below.
If you need more fine-grained access control (for example, restricting users to specific pools or denying certain operations), see Custom Roles and Policies (Advanced) later in this guide.
Note
Roles are only available when authentication is enabled.
Preconfigured Roles (Default)#
OSMO includes the following roles by default. No configuration is required — these roles are created automatically when authentication is enabled.
Role |
Description |
|---|---|
|
User who is responsible to deploy, setup & manage OSMO. They are able to access all APIs except websocket APIs used for backend or tasks (
|
|
OSMO users who are AI developers that use OSMO platform to run workflows and do not need management access to OSMO. They are able to:
|
|
Role for backend agents to communicate with OSMO. They are able to:
|
|
Role for user tasks to communicate with OSMO. They are able to:
|
|
Role that all users have access to. They are able to:
|
Note
The osmo-admin role is immutable and cannot be modified.
Role Fields#
Each role has the following fields:
Field |
Default |
Description |
|---|---|---|
|
(required) |
Unique name for the role. |
|
(required) |
Human-readable description of the role. |
|
(required) |
List of policies that define what this role can do. See Custom Roles and Policies (Advanced) for details. |
|
|
If |
|
|
Controls how IdP role sync affects this role. One of:
See Role sync modes for full details. |
|
|
Maps external IdP group/role names to this OSMO role. When users log in via an IdP, OSMO uses these mappings to determine which OSMO roles to assign.
See Identity Provider (IdP) Setup for configuring IdP integration. |
All preconfigured roles use the defaults (sync_mode: "import", external_roles: null), which means each is automatically mapped 1:1 from its own name in IdP claims. For example, if your IdP sends a group claim containing osmo-user, that user will automatically receive the osmo-user role in OSMO without any additional configuration.
Tip
For most deployments, assigning users to osmo-admin or osmo-user is sufficient. You only
need to read further if you want to create custom roles or understand how policies work internally.
Custom Roles and Policies (Advanced)#
This section is for administrators who need more fine-grained access control beyond the preconfigured roles. For example, you may want to:
Restrict users to specific pools
Create read-only roles
Deny certain operations for specific teams
Scope dataset access to particular buckets
If the preconfigured roles meet your needs, you can skip this section.
Understanding Policies#
How Policies Work#
OSMO determines if a role has access to perform an operation by checking if the role has a policy that matches the requested action and resource.
When a user makes an API request, OSMO:
Resolves the API path and HTTP method to a semantic action (e.g.,
GET /api/workflow/123becomesworkflow:Read) and a resource (e.g.,pool/my-pool).Evaluates each policy the user has access to (based on their roles) and checks if the action and resource match.
If any policy with effect
Denymatches, access is denied regardless of other policies.If any policy with effect
Allowmatches (and no Deny matched), access is granted.
Policy Structure#
Each policy has three fields:
effect:
"Allow"(default) or"Deny". Deny always takes precedence over Allow.actions: A list of semantic action strings that the policy applies to.
resources: A list of resource patterns the policy is scoped to. If omitted, the policy only matches globally-scoped actions. Set to
["*"]to match all resources.
Action Format#
Actions use the semantic format: <resource_type>:<action_name>
resource_type: The category of resource (e.g.,
workflow,pool,dataset,credentials)action_name: The operation (e.g.,
Create,Read,List,Update,Delete)
Wildcards are supported in action strings:
*:*– matches all actions on all resource typesworkflow:*– matches all workflow actions (Create, List, Read, Update, Delete, Cancel, etc.)*:Read– matches all Read actions across all resource types
Examples:
"workflow:Create"– allow creating workflows"pool:List"– allow listing pools"dataset:*"– allow all dataset operations"*:Read"– allow all read operations
See Actions and Resources Reference for the complete list of actions.
Resource Format#
Resources scope a policy to specific instances. They use the format <scope>/<identifier>.
"*"– matches all resources"pool/my-pool"– matches the specific poolmy-pool"pool/*"– matches all pools"bucket/my-data"– matches the specific bucketmy-data"config/*"– matches all config types
See Resource Scope Patterns for details on how different resource types are scoped.
Allow and Deny Policies#
Policies can have an effect of "Allow" or "Deny":
Allow: Grant access to the specified actions on the specified resources.
Deny: Explicitly deny access to the specified actions on the specified resources.
Important: Any Deny policy takes precedence over Allow policies, regardless of how specific the allow policies are. Within a single role, if both a Deny and Allow policy match, the Deny wins.
Role Naming for Pools#
Pool access is determined entirely by a role’s policies, not its name. A role grants access to a pool when it has a policy allowing workflow:Create (or other workflow actions) scoped to that pool’s resource (e.g., pool/my-pool).
Role names can be anything descriptive. For example, ml-training-role, team-alpha, or production-pool-access are all valid.
Policy Examples#
Example 1: Basic Role
This role allows all dataset and credential operations:
{
"name": "example-role",
"description": "Example Role",
"policies": [
{
"actions": [
"dataset:*",
"credentials:*"
]
}
],
"immutable": false
}
Example 2: Scoped Pool Access
This role allows creating and managing workflows only in the production pool:
{
"name": "osmo-production",
"description": "Production pool access",
"policies": [
{
"actions": [
"workflow:Create",
"workflow:Read",
"workflow:Cancel",
"workflow:List",
"pool:List"
],
"resources": ["pool/production"]
},
{
"actions": [
"profile:*",
"credentials:*"
]
}
],
"immutable": false
}
Example 3: Deny Takes Precedence
This role allows all actions except config updates. Even though *:* would normally include config:Update, the explicit Deny policy takes precedence:
{
"name": "example-role",
"description": "Read-only admin",
"policies": [
{
"effect": "Allow",
"actions": ["*:*"]
},
{
"effect": "Deny",
"actions": ["config:Update"]
}
],
"immutable": false
}
Example 4: Multi-Pool Role
This role grants workflow access to multiple pools using separate resource-scoped policies:
{
"name": "osmo-ml-team",
"description": "ML team pool access",
"policies": [
{
"actions": [
"workflow:*",
"pool:List"
],
"resources": ["pool/ml-training", "pool/ml-inference"]
},
{
"actions": [
"dataset:*",
"credentials:*",
"app:*",
"profile:*"
]
}
],
"immutable": false
}
Creating Custom Roles#
Using the OSMO CLI#
To create a custom role using the OSMO CLI:
Fetch Existing Roles
First, retrieve the current roles configuration:
$ osmo config show ROLE > roles.json
Edit the Configuration
Add your new role to the
roles.jsonfile:[ { "name": "new-role", "description": "Demo new role", "policies": [ { "actions": [ "dataset:*", "credentials:*" ] } ], "immutable": false } ]
Update the Roles
Apply the updated configuration:
$ osmo config update ROLE -f roles.json Successfully updated ROLE config
Quality of Life Features#
Auto-Generating Pool Roles#
For pool and backend roles, use the osmo config set CLI to automatically generate roles with required policies:
$ osmo config set ROLE osmo-my-pool pool
Successfully set ROLE config "osmo-my-pool"
This generates a role with the necessary permissions:
$ osmo config show ROLE osmo-my-pool
{
"name": "osmo-my-pool",
"policies": [
{
"actions": [
"http:/api/pool/my-pool*:Post",
"http:/api/profile/*:*"
]
}
],
"immutable": false,
"description": "Generated Role for pool my-pool"
}
Note
Pool access is determined by the role’s policies, not its name. See Role Naming for Pools for more information.
Learn more about the CLI at osmo config set.
Common Use Cases#
Creating a Role for a Pool#
When creating a pool named my-pool, create a corresponding role:
Generate the Role
$ osmo config set ROLE osmo-my-pool -p my-pool Successfully created ROLE config
Assign the role to users
Use the
osmo user updateCLI to assign the role to users:$ osmo user update <user_id> --add-roles osmo-my-pool
See Creating Users and Assigning Roles for full details on user creation and role assignment. If you use an identity provider, you can instead (or additionally) map IdP groups to this role via
external_roles; see IdP Role Mapping and Sync Modes.
Assigning roles to users and creating access tokens#
Roles are assigned to users in OSMO (via the osmo user CLI or, when using an IdP, via IdP group mapping). Access tokens are then created for a user and inherit that user’s roles (or a subset) at creation time.
To create a user and assign roles: use
osmo user create <user_id> --roles <role_name>orosmo user update <user_id> --add-roles <role_name>. See Creating Users and Assigning Roles.To create an access token for the current user: use
osmo token set <token_name>. An admin can create an access token for another user viaosmo token set <token_name> --user <user_id>.
For pool access, assign a role with the appropriate pool-scoped workflow policies, along with osmo-user (or equivalent) so the token can also use workflow management commands (cancel, query, etc.).
Troubleshooting#
Role Not Working as Expected#
Verify Role Assignment: Confirm the user has the role in their JWT token
Check Action Format: Ensure actions follow the semantic format (
<resource_type>:<action_name>, e.g.,workflow:Create)Review Deny Policies: Check if any policy with
"effect": "Deny"is blocking accessCheck Resource Scoping: If the policy uses
resources, verify the resource pattern matches the target (e.g.,pool/my-pool)Test with Admin: Verify the operation works with admin privileges to isolate the issue
Pool Access Issues#
Check role policies: Ensure the role has a policy allowing
workflow:Createscoped to the target pool (e.g.,resources: ["pool/my-pool"])Check role assignment: Ensure the user has the role in OSMO (via
osmo user roles list <user_id>or IdP role mapping)Review resource scope: Verify the policy’s
resourcesfield matches the pool name (e.g.,pool/my-poolorpool/*)
Actions and Resources Reference#
This section provides a complete reference of all semantic actions and resource types available in OSMO’s authorization model.
Action Format#
All actions follow the format <resource_type>:<action_name>. When writing policies, you can use wildcards:
*:*– all actions on all resource types<resource_type>:*– all actions for a resource type (e.g.,workflow:*)*:<action_name>– a specific action across all resource types (e.g.,*:Read)
Workflow Actions
Actions for managing workflows, tasks, and interactive sessions. Workflow actions (except workflow:List) are scoped to the pool that owns the workflow (e.g., pool/my-pool).
Action |
Description |
Resource Scope |
|---|---|---|
|
Submit a new workflow to a pool. |
|
|
List and search workflows and tasks. |
Global (no scope) |
|
View details of a specific workflow. |
|
|
Modify a workflow. |
|
|
Delete a workflow. |
|
|
Cancel a running workflow. |
|
|
Execute commands in a workflow container. |
|
|
Port-forward or access a webserver on a workflow. |
|
|
Rsync files to/from a workflow. |
|
Dataset Actions
Actions for managing dataset buckets. Dataset actions (except dataset:List) are scoped to the specific bucket (e.g., bucket/my-data).
Action |
Description |
Resource Scope |
|---|---|---|
|
List all datasets/buckets. |
Global (no scope) |
|
View a specific dataset/bucket. |
|
|
Create or update a dataset/bucket. |
|
|
Delete a dataset/bucket. |
|
Credentials Actions
Actions for managing user credentials (e.g., cloud provider keys, registry secrets).
Action |
Description |
Resource Scope |
|---|---|---|
|
Create a new credential. |
Global (no scope) |
|
View credentials. |
Global (no scope) |
|
Update a credential. |
Global (no scope) |
|
Delete a credential. |
Global (no scope) |
Pool Actions
Actions for pool management.
Action |
Description |
Resource Scope |
|---|---|---|
|
List pools and pool quotas. |
Global (no scope) |
Profile Actions
Actions for managing user profile settings.
Action |
Description |
Resource Scope |
|---|---|---|
|
View profile settings. |
Global (no scope) |
|
Update profile settings. |
Global (no scope) |
User Actions
Actions for user management.
Action |
Description |
Resource Scope |
|---|---|---|
|
List users. |
Global (no scope) |
App Actions
Actions for managing apps.
Action |
Description |
Resource Scope |
|---|---|---|
|
Create a new app. |
Global (no scope) |
|
View apps. |
Global (no scope) |
|
Update an app. |
Global (no scope) |
|
Delete an app. |
Global (no scope) |
Resources Actions
Actions for viewing cluster resources.
Action |
Description |
Resource Scope |
|---|---|---|
|
View cluster resource information. |
Global (no scope) |
Config Actions
Actions for managing OSMO configuration. Config actions are scoped to the config type (e.g., config/ROLE).
Action |
Description |
Resource Scope |
|---|---|---|
|
View configuration. |
|
|
Modify configuration. |
|
Auth Actions
Actions for authentication and token management. The auth:Token action can be scoped to a specific user (e.g., user/<user_id>).
Action |
Description |
Resource Scope |
|---|---|---|
|
Initiate login and retrieve auth keys. |
Global (no scope) |
|
Refresh JWT tokens from refresh or access tokens. |
Global (no scope) |
|
Create and manage access tokens. |
|
System Actions
Public system actions available to all users.
Action |
Description |
Resource Scope |
|---|---|---|
|
Health check endpoint. |
Global (no scope) |
|
View service version. |
Global (no scope) |
Internal Actions
Restricted actions for internal OSMO components (backends, loggers, routers). Internal actions are scoped to specific backend instances (e.g., backend/<backend_id>).
Action |
Description |
Resource Scope |
|---|---|---|
|
Backend agent communication (listener and worker registration). |
|
|
Task log forwarding. |
|
|
Router backend communication. |
|
Resource Scope Patterns#
The Resource Scope column in the tables above indicates how each action is scoped. When writing policies, use the following patterns:
Scope |
Pattern Examples |
Description |
|---|---|---|
Global (no scope) |
Not required |
The action applies globally and does not need a |
|
|
Restricts workflow actions to a specific pool or all pools. |
|
|
Restricts dataset actions to a specific bucket or all buckets. |
|
|
Restricts config actions to a specific config type or all types. |
|
|
Restricts |
|
|
Restricts internal actions to a specific backend instance. |
When a policy does not specify resources, it only matches actions with global scope (no resource). To match scoped actions (e.g., workflow actions on a specific pool), you must explicitly set resources (e.g., ["pool/my-pool"] or ["*"] for all).
See Also#
Identity Provider (IdP) Setup for configuring an IdP and role mapping
Authentication Flow for understanding authentication
/api/configs/role for complete role configuration reference
Create Resource Pools for pool configuration
osmo user --helpandosmo token --helpfor user and token management CLI commands