Overview
Users are assigned to roles, and roles define permissions. A user’s effective permissions are the union of all permissions from all their roles (OR logic). Permissions are loaded from the database on every request — changes take effect immediately.Default Roles
| Role | Description |
|---|---|
| Admins | Full access to everything (sinas.*:all) |
| Users | Create and manage own resources, chat with any agent, execute own functions |
| GuestUsers | Read and update own profile only |
Permission Format
| Part | Description | Examples |
|---|---|---|
| Service | Top-level namespace | sinas, or a custom prefix like titan, acme |
| Resource | Resource type | agents, functions, states, users |
| Path | Optional namespace/name path | /marketing/send_email, /* |
| Action | What operation is allowed | create, read, update, delete, execute, chat |
| Scope | Ownership scope | :own (user’s resources), :all (all resources) |
Permission Matching Rules
Scope hierarchy::all automatically grants :own. A user with sinas.agents.read:all passes any check for sinas.agents.read:own.
Wildcards can be used at any level:
| Pattern | Matches |
|---|---|
sinas.*:all | Everything in Sinas (admin access) |
sinas.agents/*/*.chat:all | Chat with any agent in any namespace |
sinas.functions/marketing/*.execute:own | Execute any function in the marketing namespace |
sinas.states/*.read:own | Read own states in any namespace |
sinas.chats.*:own | All chat actions (read, update, delete) on own chats |
Custom Permissions
The permission system is not limited tosinas.*. You can define permissions with any service prefix for your own applications:
Checking Permissions from External Services
Use thePOST /auth/check-permissions endpoint to verify whether the current user (identified by their Bearer token or API key) has specific permissions:
logic: "AND"— User must have ALL listed permissions (default)logic: "OR"— User must have AT LEAST ONE of the listed permissions
Managing Roles
Agent Execution & Permissions
Agents define which tools are available (viaenabled_* fields), but the user’s role permissions are checked at execution time. Both conditions must be met:
- Agent declares the tool — the resource is in the agent’s
enabledFunctions,enabledQueries,enabledStores,enabledCollections, orenabledAgents - User has the permission — checked when the tool is actually called
| Resource | Agent config | Permission checked at execution |
|---|---|---|
| Functions | enabledFunctions | sinas.functions/{ns}/{name}.execute:own |
| Queries | enabledQueries | sinas.queries/{ns}/{name}.execute:own |
| Collections | enabledCollections | sinas.collections/{ns}/{name}.download:own (read) / .upload:own (write) |
| Stores | enabledStores | sinas.stores/{ns}/{name}.read_state:own / .write_state:own |
| Sub-agents | enabledAgents | sinas.agents/{ns}/{name}.chat:all |
| Connectors | enabledConnectors | Agent-gated only (no standalone execution path) |
enabledConnectors (with per-operation filtering) is the sole access control.
Namespace wildcards make this manageable. Grant sinas.functions/sales/*.execute:own once on a role, and all functions in the sales/ namespace are accessible.