-
Notifications
You must be signed in to change notification settings - Fork 295
[docs] docs: reduce bloat in permissions.md #20003
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
Merged
Merged
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,32 +18,15 @@ safe-outputs: | |
|
|
||
| ## Permission Model | ||
|
|
||
| ### Security-First Design | ||
| Agentic workflows follow a principle of least privilege: the main job runs read-only, and all write operations happen in separate [safe outputs](/gh-aw/reference/safe-outputs/) jobs with sanitized content. | ||
|
|
||
| Agentic workflows follow a principle of least privilege: | ||
| This separation provides an audit trail, limits blast radius if an agent misbehaves, supports compliance approval gates, and defends against prompt injection. Safe outputs add one extra job but provide critical safety guarantees. | ||
|
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. Nice consolidation of the rationale. Combining audit trail, blast radius, compliance, and prompt injection defense into one sentence keeps the docs concise without losing clarity. |
||
|
|
||
| - **Read-only by default**: Main job runs with minimal read permissions only | ||
| - **Write through safe outputs**: Write operations happen in separate jobs with sanitized content | ||
| - **No direct write permissions**: Use safe-outputs instead of `write` permissions in the main job | ||
|
|
||
| This model prevents AI agents from accidentally or maliciously modifying repository content during execution. | ||
|
|
||
| ### Why This Model? | ||
|
|
||
| AI agents require careful security controls: | ||
|
|
||
| - **Audit Trail**: Separating read (agent) from write (safe outputs) provides clear accountability for all changes | ||
| - **Blast Radius Containment**: If an agent misbehaves, it cannot modify code, merge PRs, or delete resources | ||
| - **Compliance**: Many organizations require approval workflows for automated changes - safe outputs provide the approval gate | ||
| - **Defense in Depth**: Even if prompt injection occurs, the agent cannot perform destructive actions | ||
|
|
||
| This model trades convenience for security. Safe outputs add one extra job but provide critical safety guarantees. | ||
|
|
||
| ### Permission Scopes | ||
| ## Permission Scopes | ||
|
|
||
| Key permissions include `contents` (code access), `issues` (issue management), `pull-requests` (PR management), `discussions`, `actions` (workflow control), `checks`, `deployments`, `packages`, `pages`, and `statuses`. Each has read and write levels. See [GitHub's permissions reference](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) for the complete list. | ||
|
|
||
| #### Special Permission: `id-token` | ||
| ### Special Permission: `id-token` | ||
|
|
||
| The `id-token` permission controls access to GitHub's OIDC token service for [OpenID Connect (OIDC) authentication](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect) with cloud providers (AWS, GCP, Azure). | ||
|
|
||
|
|
@@ -62,8 +45,6 @@ This permission is safe to use and does not require safe-outputs, even in strict | |
|
|
||
| ## Configuration | ||
|
|
||
| ### Basic Configuration | ||
|
|
||
| Specify individual permission levels: | ||
|
|
||
| ```yaml wrap | ||
|
|
@@ -116,10 +97,6 @@ permissions: read-all | |
| manual-approval: production | ||
| ``` | ||
|
|
||
| ## Safe Outputs | ||
|
|
||
| Write operations use safe outputs instead of direct API access. This provides content sanitization, rate limiting, audit trails, and security isolation by separating write permissions from AI execution. See [Safe Outputs](/gh-aw/reference/safe-outputs/) for details. | ||
|
|
||
| ## Permission Validation | ||
|
|
||
| Run `gh aw compile workflow.md` to validate permissions. Common errors include undefined permissions, direct write permissions in the main job (use safe outputs instead), and insufficient permissions for declared tools. Use `--strict` mode to enforce read-only permissions and require explicit network configuration. | ||
|
|
@@ -155,20 +132,9 @@ gh aw fix workflow.md --write | |
| This automatically converts all write permissions to read permissions. | ||
|
|
||
| > [!TIP] | ||
| > Use Safe Outputs Instead | ||
| > For workflows that need to make changes to your repository, use [safe outputs](/gh-aw/reference/safe-outputs/) instead of write permissions. Safe outputs provide a secure way to create issues, pull requests, and comments without granting direct write access to the AI agent. | ||
| ::: | ||
|
|
||
| #### Scope | ||
|
|
||
| This validation applies to: | ||
| - Top-level workflow `permissions:` configuration | ||
|
|
||
| This validation does **not** apply to: | ||
| - Custom jobs (defined in `jobs:` section) | ||
| - Safe outputs jobs (defined in `safe-outputs.job:` section) | ||
| > For workflows that need to make changes to your repository, use [safe outputs](/gh-aw/reference/safe-outputs/) instead of write permissions. | ||
|
|
||
| Custom jobs and safe outputs jobs can have their own permission requirements based on their specific needs. | ||
| This validation applies only to the top-level `permissions:` configuration. Custom jobs (`jobs:`) and safe outputs jobs (`safe-outputs.job:`) can have their own permission requirements. | ||
|
|
||
| ### Tool-Specific Requirements | ||
|
|
||
|
|
||
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.
Good simplification! The condensed explanation of the least privilege principle is much more readable. The single sentence captures the essence well.