Add user-focused permissions documentation under "Using Wassette"#333
Conversation
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
| You can grant permissions in two ways: | ||
|
|
||
| ### Using Policy Files | ||
|
|
||
| Create a `policy.yaml` file alongside your component: | ||
|
|
||
| ```yaml | ||
| version: "1.0" | ||
| description: "Weather tool permissions" | ||
| permissions: | ||
| storage: | ||
| allow: | ||
| - uri: "fs://workspace/**" | ||
| access: ["read", "write"] | ||
| - uri: "fs://config/app.yaml" | ||
| access: ["read"] | ||
| network: | ||
| allow: | ||
| - host: "api.weather.com" | ||
| - host: "api.openweathermap.org" | ||
| environment: | ||
| allow: | ||
| - key: "API_KEY" | ||
| - key: "WEATHER_API_TOKEN" | ||
| ``` | ||
|
|
||
| **Policy file structure:** | ||
| - `version`: Policy format version (currently "1.0") | ||
| - `description`: Human-readable description | ||
| - `permissions`: Permission declarations organized by type | ||
| - `storage.allow`: List of file system URIs and access types | ||
| - `network.allow`: List of allowed hosts | ||
| - `environment.allow`: List of environment variable keys | ||
|
|
||
| ### Using CLI Commands | ||
|
|
||
| Grant permissions at runtime using the `wassette permission grant` command: | ||
|
|
||
| **Grant storage access:** | ||
| ```bash | ||
| # Read-only access to a directory | ||
| wassette permission grant storage weather-tool fs://workspace/ --access read | ||
|
|
||
| # Read and write access | ||
| wassette permission grant storage weather-tool fs://workspace/ --access read,write | ||
|
|
||
| # Access to a specific file | ||
| wassette permission grant storage weather-tool fs://config/app.yaml --access read | ||
| ``` | ||
|
|
||
| **Grant network access:** | ||
| ```bash | ||
| # Allow access to a specific host | ||
| wassette permission grant network weather-tool api.weather.com | ||
|
|
||
| # Allow localhost access | ||
| wassette permission grant network weather-tool localhost:8080 | ||
| ``` | ||
|
|
||
| **Grant environment variable access:** | ||
| ```bash | ||
| # Grant access to an environment variable | ||
| wassette permission grant environment-variable weather-tool API_KEY | ||
|
|
||
| # Grant access to multiple variables | ||
| wassette permission grant environment-variable weather-tool HOME | ||
| wassette permission grant environment-variable weather-tool PATH | ||
| ``` | ||
|
|
There was a problem hiding this comment.
the policy file is not a recommended way for granting. You should modify it to use built-in tools and the agent will figure out how to grant permissions. The CLI experience is secondary to that.
There was a problem hiding this comment.
Reordered the "Granting Permissions" section to prioritize MCP built-in tools as the recommended approach. The section now leads with using the AI agent through natural language, followed by CLI commands, then policy files. Added clear "(Recommended)" label and explanation that policy files are secondary to agent-based permission granting.
Changes in commit 004006a3.
…rmissions Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
| **Available MCP tools:** | ||
| - `grant-storage-permission`: Grant file system access | ||
| - `grant-network-permission`: Grant network access | ||
| - `grant-environment-variable-permission`: Grant environment variable access |
There was a problem hiding this comment.
Add a note that the even after the env var permissions are granted, the server still needs to be able to see those env vars.
One way of doind that is to run wassette secret set to inject secrets into this. Another way is to run the server with the necessasry env vars
There was a problem hiding this comment.
Added a note after the environment variable permissions section explaining that the server must be able to see those environment variables. The note provides two methods: using wassette secret set <component-id> <key> <value> to inject secrets, or running the server with the necessary environment variables already set.
Changes in commit [SHA will be added after commit].
| ```yaml | ||
| version: "1.0" | ||
| description: "Weather tool permissions" | ||
| permissions: | ||
| storage: | ||
| allow: | ||
| - uri: "fs://workspace/**" | ||
| access: ["read", "write"] | ||
| - uri: "fs://config/app.yaml" | ||
| access: ["read"] | ||
| network: | ||
| allow: | ||
| - host: "api.weather.com" | ||
| - host: "api.openweathermap.org" | ||
| environment: | ||
| allow: | ||
| - key: "API_KEY" | ||
| - key: "WEATHER_API_TOKEN" | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Note that this is not meant to be manually write. It's a file that wassette can manipulate using the grant-* built in tools or CLI.
There was a problem hiding this comment.
Updated the "Using Policy Files" section to clarify that policy files are typically managed automatically by Wassette when using the built-in tools or CLI commands, rather than being manually written. The section now states: "Policy files store permissions for components in YAML format. These files are typically managed automatically by Wassette when you use the built-in tools or CLI commands rather than being manually written."
Changes in commit [SHA will be added after commit].
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
docs/using/permissions.mdwith user-focused how-to contentdocs/SUMMARY.mdto add "Using Wassette" section with permissions pageSummary
This PR addresses the issue about improving the permissions documentation by creating a new user-focused "Permissions" page under a "Using Wassette" section.
Changes Made
docs/using/directory for user-focused guidesdocs/using/permissions.mdwith practical how-to contentdocs/SUMMARY.mdto add "Using Wassette" sectionKey Improvements
The permissions documentation is now clearly separated:
docs/using/permissions.md): Practical how-to guidedocs/design/permission-system.md): Technical architecture detailsScreenshots
Environment Variable Note:
Policy Files Clarification:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.