-
Notifications
You must be signed in to change notification settings - Fork 71
rbac doc update #629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mishramonalisha76
wants to merge
7
commits into
main
Choose a base branch
from
rbac-doc-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
rbac doc update #629
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5e9414f
docs-rbac-scopes
mishramonalisha76 d916f0c
rbac docs update
mishramonalisha76 a64fc0c
custom roles
mishramonalisha76 d5260f9
roles video
mishramonalisha76 0e4e6b8
cal link
mishramonalisha76 efb8c88
fixed merge conflcits
mishramonalisha76 f078c2d
removed todo
mishramonalisha76 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,10 +44,45 @@ | |
| app = agent_os.get_app() | ||
| ``` | ||
|
|
||
| Set the `JWT_VERIFICATION_KEY` environment variable to your public key in your `.env` file or export it directly in your terminal: | ||
| ```bash | ||
| export JWT_VERIFICATION_KEY="your-public-key" | ||
| ``` | ||
|
|
||
|
|
||
| ## Generate a Verification Key | ||
|
|
||
| `authorization=True` only tells AgentOS to enforce JWT auth. To verify tokens, AgentOS also needs a public key. Generate one from the control plane and wire it in. | ||
|
|
||
| <Steps> | ||
| <Step title="Toggle JWT authorization"> | ||
| Enable JWT authorization when connecting a new AgentOS, or later from the OS Settings page. | ||
|
|
||
| {/* TODO: screenshot of the toggle */} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes pls, this would be helpful
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no we don't need this, we have a video showing the flow below . This was leftover code |
||
| </Step> | ||
|
|
||
| <Step title="Copy the public key"> | ||
| A modal appears with the public key for your AgentOS. | ||
| </Step> | ||
|
|
||
| <Step title="Set the verification key"> | ||
| Set the `JWT_VERIFICATION_KEY` environment variable to your public key in your `.env` file or export it directly in your terminal: | ||
| ```bash | ||
| export JWT_VERIFICATION_KEY="your-public-key" | ||
| ``` | ||
|
|
||
| Or, if you manage keys via a JWKS file, point AgentOS at it instead: | ||
| ```bash | ||
| export JWT_JWKS_FILE="/path/to/jwks.json" | ||
| ``` | ||
| </Step> | ||
| </Steps> | ||
|
|
||
| Authorization is now active for your AgentOS. | ||
|
|
||
| <video | ||
| autoPlay | ||
| muted | ||
| controls | ||
| className="w-full aspect-video" | ||
| src="/videos/auth-on-connect-web.mp4" | ||
| ></video> | ||
|
|
||
| ## Scope Format | ||
|
|
||
|
|
@@ -60,19 +95,53 @@ | |
| | `resource:*:action` | `agents:*:read` | Wildcard (equivalent to global) | | ||
| | `agent_os:admin` | - | Full access to all endpoints | | ||
|
|
||
|
|
||
| ## Complete Scope Reference | ||
|
|
||
| ### Organization Scopes | ||
|
|
||
| Organization scopes are enforced at the control plane and do not map to AgentOS endpoints. | ||
|
|
||
| | Scope | Description | | ||
| |-------|-------------| | ||
| | `os:read` | View AgentOS instances in the organization | | ||
| | `os:write` | Create and update AgentOS instances | | ||
| | `os:delete` | Delete AgentOS instances | | ||
| | `org:read` | View organization details and members | | ||
| | `org:write` | Update organization settings and manage members | | ||
| | `org:delete` | Delete the organization | | ||
| | `billing:read` | View billing details and invoices | | ||
| | `billing:write` | Update billing settings and payment methods | | ||
|
|
||
| ### Admin Scopes | ||
|
|
||
| | Scope | Description | | ||
| |-------|-------------| | ||
| | `agent_os:admin` | Full admin access to all endpoints | | ||
| | `agent_os:admin` | Full admin access to all AgentOS endpoints | | ||
|
|
||
|
|
||
|
|
||
| ### AgentOS config Scopes | ||
|
|
||
| | Scope | Description | | ||
| |-------|-------------| | ||
| | `config:read` | View system configuration and available models | | ||
| | `config:write` | Administrative writes such as database migrations | | ||
|
|
||
| ### System Scopes | ||
|
|
||
| ### Registry Scopes | ||
|
|
||
| | Scope | Description | | ||
| |-------|-------------| | ||
| | `system:read` | View system configuration and available models | | ||
| | `registry:read` | View the code-defined registry (tools, models, databases) | | ||
|
|
||
| ### Component Scopes | ||
|
|
||
| | Scope | Description | | ||
| |-------|-------------| | ||
| | `components:read` | List and view components and their configs | | ||
| | `components:write` | Create and update components and configs | | ||
| | `components:delete` | Delete components and configs | | ||
|
|
||
| ### Agent Scopes | ||
|
|
||
|
|
@@ -176,8 +245,16 @@ | |
| <Tab title="System"> | ||
| | Endpoint | Required Scope | | ||
| |----------|----------------| | ||
| | `GET /config` | `system:read` | | ||
| | `GET /models` | `system:read` | | ||
| | `GET /config` | `config:read` | | ||
| | `GET /models` | `config:read` | | ||
| | `POST /databases/all/migrate` | `config:write` | | ||
| | `POST /databases/*/migrate` | `config:write` | | ||
| </Tab> | ||
|
|
||
| <Tab title="Registry"> | ||
| | Endpoint | Required Scope | | ||
| |----------|----------------| | ||
| | `GET /registry` | `registry:read` | | ||
| </Tab> | ||
|
|
||
| <Tab title="Agents"> | ||
|
|
@@ -236,7 +313,7 @@ | |
| |----------|----------------| | ||
| | `GET /memories` | `memories:read` | | ||
| | `GET /memories/*` | `memories:read` | | ||
| | `GET /memory_topics` | `memories:read` | | ||
| | `GET /user_memory_stats` | `memories:read` | | ||
| | `POST /memories` | `memories:write` | | ||
| | `PATCH /memories/*` | `memories:write` | | ||
|
|
@@ -251,8 +328,11 @@ | |
| | `GET /knowledge/content` | `knowledge:read` | | ||
| | `GET /knowledge/content/*` | `knowledge:read` | | ||
| | `GET /knowledge/config` | `knowledge:read` | | ||
| | `GET /knowledge/*/sources` | `knowledge:read` | | ||
| | `GET /knowledge/*/sources/*/files` | `knowledge:read` | | ||
| | `POST /knowledge/search` | `knowledge:read` | | ||
| | `POST /knowledge/content` | `knowledge:write` | | ||
| | `POST /knowledge/remote-content` | `knowledge:write` | | ||
| | `PATCH /knowledge/content/*` | `knowledge:write` | | ||
| | `DELETE /knowledge/content` | `knowledge:delete` | | ||
| | `DELETE /knowledge/content/*` | `knowledge:delete` | | ||
|
|
@@ -281,6 +361,7 @@ | |
| | `GET /traces` | `traces:read` | | ||
| | `GET /traces/*` | `traces:read` | | ||
| | `GET /trace_session_stats` | `traces:read` | | ||
| | `POST /traces/search` | `traces:read` | | ||
| </Tab> | ||
|
|
||
| <Tab title="Schedules"> | ||
|
|
@@ -308,8 +389,35 @@ | |
| | `POST /approvals/*/resolve` | `approvals:write` | | ||
| | `DELETE /approvals/*` | `approvals:delete` | | ||
| </Tab> | ||
|
|
||
| <Tab title="Components"> | ||
| | Endpoint | Required Scope | | ||
| |----------|----------------| | ||
| | `GET /components` | `components:read` | | ||
| | `GET /components/*` | `components:read` | | ||
| | `GET /components/*/configs` | `components:read` | | ||
| | `GET /components/*/configs/*` | `components:read` | | ||
| | `GET /components/*/configs/current` | `components:read` | | ||
| | `POST /components` | `components:write` | | ||
| | `POST /components/*/configs` | `components:write` | | ||
| | `POST /components/*/configs/*/set-current` | `components:write` | | ||
| | `PATCH /components/*` | `components:write` | | ||
| | `PATCH /components/*/configs/*` | `components:write` | | ||
| | `DELETE /components/*` | `components:delete` | | ||
| | `DELETE /components/*/configs/*` | `components:delete` | | ||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| ## Access Prerequisites | ||
|
|
||
| A few scopes gate access to everything downstream. Without them, finer-grained scopes have no effect because the user cannot reach the resources they apply to. | ||
|
|
||
| | Scope | Without it, the user cannot | | ||
| |-------|-----------------------------| | ||
| | `org:read` | Access the organization at all | | ||
| | `os:read` | List AgentOS instances in the organization | | ||
| | `config:read` | Use any AgentOS endpoint (the UI loads `/config` on startup) | | ||
|
|
||
| ## Custom Scope Mappings | ||
|
|
||
| Customize or extend the default scope mappings using the JWT middleware: | ||
|
|
@@ -339,6 +447,36 @@ | |
|
|
||
| Custom scope mappings are additive to the defaults. To override a default, specify the same route pattern with your custom scopes. | ||
|
|
||
| ## Custom Roles and Scopes | ||
|
|
||
| <Note> | ||
| Custom roles and scopes are available on the Enterprise plan. [Book a call](https://cal.com/team/agno/intro) or email [support@agno.com](mailto:support@agno.com) to enable. | ||
| </Note> | ||
|
|
||
| <Warning> | ||
| Custom roles require JWT authentication. Without it, scope enforcement is skipped entirely by AgentOS and assigned roles have no effect. | ||
| </Warning> | ||
|
|
||
| Compose scopes into named roles in the control plane and assign them to users in your organization. Members inherit the scopes of every role assigned to them. | ||
|
|
||
| ### Create a Custom Role | ||
|
|
||
| 1. Open the [Roles page](https://os.agno.com/settings/roles) in the control plane. | ||
| 2. Define a role name and select the scopes it grants. | ||
| 3. Save the role. | ||
|
|
||
| ### Assign a Role to a User | ||
|
|
||
| Open the [Organization settings page](https://os.agno.com/settings/organization) and assign the role to a user. | ||
|
|
||
| <video | ||
| autoPlay | ||
| muted | ||
| controls | ||
| className="w-full aspect-video" | ||
| src="/videos/roles.mp4" | ||
| ></video> | ||
|
|
||
| ## JWT Token Structure | ||
|
|
||
| Your JWT tokens should include: | ||
|
|
||
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we're not showing this video lets remove it from the directory too? if its not being used anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are showing this video