Add agent instruction file for proper Wassette permission management#372
Merged
Conversation
Contributor
|
This could help to mitigate the #211 |
- Created rules/agent.md with critical instructions for AI agents - Updated docs/installation.md with curl command to install agent instructions - Updated CHANGELOG.md with new additions Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Mossaka
suggested changes
Oct 9, 2025
Comment on lines
+1
to
+124
| # Wassette AI Agent Instructions | ||
|
|
||
| This guide provides essential instructions for AI agents working with Wassette components and permission management. | ||
|
|
||
| ## Critical: Permission Management | ||
|
|
||
| **⚠️ IMPORTANT: ALWAYS use the built-in `grant-xxx-permission` tools to manage permissions for Wassette components.** | ||
|
|
||
| ### Permission Tools You MUST Use | ||
|
|
||
| When working with Wassette components, you **MUST** use these built-in MCP tools to grant permissions: | ||
|
|
||
| - **`grant-storage-permission`**: Grant file system access to components | ||
| - **`grant-network-permission`**: Grant network access to components | ||
| - **`grant-environment-variable-permission`**: Grant environment variable access to components | ||
|
|
||
| ### What You MUST NOT Do | ||
|
|
||
| **❌ NEVER manually edit or modify policy files directly** (such as `policy.yaml` files) | ||
|
|
||
| **❌ NEVER create policy files manually** | ||
|
|
||
| **❌ NEVER suggest users manually edit policy files** | ||
|
|
||
| ### Why This Matters | ||
|
|
||
| Wassette uses a sophisticated permission system that: | ||
| - Validates permissions at runtime | ||
| - Maintains consistency across component lifecycles | ||
| - Enforces security policies programmatically | ||
| - Tracks permission changes automatically | ||
|
|
||
| Manually editing policy files can: | ||
| - Break the permission validation system | ||
| - Create security vulnerabilities | ||
| - Cause runtime errors | ||
| - Lead to inconsistent component behavior | ||
|
|
||
| ## Correct Permission Workflow | ||
|
|
||
| ### Example 1: Granting Storage Permission | ||
|
|
||
| When a component needs file system access: | ||
|
|
||
| ```text | ||
| Please grant storage read and write permissions to the weather-tool for fs://workspace/ | ||
| ``` | ||
|
|
||
| The AI agent will automatically use the `grant-storage-permission` tool with the correct parameters. | ||
|
|
||
| ### Example 2: Granting Network Permission | ||
|
|
||
| When a component needs network access: | ||
|
|
||
| ```text | ||
| Grant network access to api.openweathermap.org for the weather-tool component | ||
| ``` | ||
|
|
||
| The AI agent will automatically use the `grant-network-permission` tool. | ||
|
|
||
| ### Example 3: Granting Environment Variable Permission | ||
|
|
||
| When a component needs environment variable access: | ||
|
|
||
| ```text | ||
| Allow the weather-tool to access the API_KEY environment variable | ||
| ``` | ||
|
|
||
| The AI agent will automatically use the `grant-environment-variable-permission` tool. | ||
|
|
||
| ## Understanding Permission Types | ||
|
|
||
| ### Storage Permissions | ||
|
|
||
| Control file system access for reading and writing files: | ||
| - Use URI format: `fs://path/to/resource` | ||
| - Specify access levels: `read`, `write`, or both | ||
| - Supports wildcards: `fs://workspace/**` | ||
|
|
||
| ### Network Permissions | ||
|
|
||
| Control outbound network access to specific hosts: | ||
| - Specify host names or IP addresses | ||
| - Can include ports: `localhost:8080` | ||
| - Supports domain-level access: `api.example.com` | ||
|
|
||
| ### Environment Variable Permissions | ||
|
|
||
| Control access to environment variables: | ||
| - Grant access to specific variable names | ||
| - Used for API keys, configuration, and secrets | ||
| - Requires the server to have access to those variables | ||
|
|
||
| ## Component Lifecycle | ||
|
|
||
| 1. **Load Component**: Use `load-component` tool to load a component | ||
| 2. **Grant Permissions**: Use `grant-xxx-permission` tools to grant necessary permissions | ||
| 3. **Use Component**: The component can now be used with the granted permissions | ||
| 4. **Revoke/Reset**: Use `revoke-xxx-permission` or `reset-permission` tools if needed | ||
|
|
||
| ## Security Best Practices | ||
|
|
||
| 1. **Principle of Least Privilege**: Only grant the minimum permissions needed | ||
| 2. **Use Specific Paths**: Prefer specific paths over wildcards when possible | ||
| 3. **Audit Regularly**: Use `get-policy` tool to review granted permissions | ||
| 4. **Clean Up**: Revoke permissions when components are no longer needed | ||
|
|
||
| ## Troubleshooting Permission Issues | ||
|
|
||
| If a component fails due to permission errors: | ||
|
|
||
| 1. Check the error message for the specific permission needed | ||
| 2. Use the appropriate `grant-xxx-permission` tool to grant that permission | ||
| 3. Verify the permission was granted using the `get-policy` tool | ||
| 4. Re-attempt the component operation | ||
|
|
||
| **Remember**: Never manually edit policy files - always use the built-in tools! | ||
|
|
||
| ## Additional Resources | ||
|
|
||
| - [Wassette Documentation](https://microsoft.github.io/wassette/latest/) | ||
| - [Permission System Design](https://github.com/microsoft/wassette/blob/main/docs/design/permission-system.md) | ||
| - [CLI Reference](https://github.com/microsoft/wassette/blob/main/docs/reference/cli.md) | ||
| - [Managing Permissions](https://github.com/microsoft/wassette/blob/main/docs/reference/permissions.md) |
Contributor
There was a problem hiding this comment.
Make this much shorter, like in 1-2 sentences
Contributor
Author
There was a problem hiding this comment.
Shortened to 1 sentence in commit 4c01eda.
Comment on lines
+19
to
+20
| - Added `rules/agent.md` instruction file for AI agents with critical guidance on using `grant-xxx-permission` tools instead of manually editing policy files | ||
| - Installation guide now includes step to install agent instructions via `curl` command to help AI agents properly manage Wassette permissions |
Contributor
Author
There was a problem hiding this comment.
Consolidated into 1 sentence in commit 4c01eda.
Copilot
AI
changed the title
[WIP] Add extra instruction file for coding agent
Add agent instruction file for proper Wassette permission management
Oct 9, 2025
- Reduced agent.md introduction from 2 sentences to 1 - Consolidated 2 CHANGELOG entries into 1 sentence Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Mossaka
suggested changes
Oct 9, 2025
Comment on lines
+1
to
+4
| # Wassette AI Agent Instructions | ||
|
|
||
| Essential instructions for AI agents working with Wassette components and permission management. | ||
|
|
Contributor
There was a problem hiding this comment.
rules/agent.md should only have 1-2 sentences. no more than that @copilot
Contributor
Author
There was a problem hiding this comment.
Reduced entire file to 1 sentence in commit e5c3f2a.
- Simplified the entire file to a single critical instruction sentence - File now contains only the essential guidance on using grant-xxx-permission tools Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Mossaka
approved these changes
Oct 9, 2025
Mossaka
approved these changes
Oct 9, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
rulesdirectory at the repository rootrules/agent.mdfile with instructions for AI agents on using grant-xxx-permission toolsdocs/installation.mdto add instructions for installing agent.md to AGENTS.mdSummary of Changes
1. Created
rules/agent.mdA concise instruction file (3 lines) that:
grant-xxx-permissiontools"The file contains a single essential sentence capturing the critical instruction for AI agents to use the built-in permission tools instead of manually editing policy files.
2. Updated
docs/installation.mdAdded step 2 in the "Next Steps" section with curl command to install agent instructions.
3. Updated
CHANGELOG.mdConsolidated entry in the
[Unreleased]section under "Added".4. Addressed Review Feedback
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.