Skip to content

Commit b29e196

Browse files
docs: document safe-outputs.environment field (#20384) (#20468)
1 parent 44cb369 commit b29e196

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/src/content/docs/reference/safe-outputs.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,22 @@ Use GitHub App tokens for enhanced security: on-demand token minting, automatic
12741274

12751275
See [Using a GitHub App for Authentication](/gh-aw/reference/auth/#using-a-github-app-for-authentication).
12761276

1277+
### Environment Protection (`environment:`)
1278+
1279+
Specifies the deployment environment for all compiler-generated safe-output jobs (`safe_outputs`, `conclusion`, `pre_activation`, custom safe-jobs). This makes environment-scoped secrets accessible in those jobs — for example, GitHub App credentials stored as environment secrets.
1280+
1281+
The top-level `environment:` field is automatically propagated to all safe-output jobs. Use `safe-outputs.environment:` to override this independently:
1282+
1283+
```yaml wrap
1284+
safe-outputs:
1285+
environment: dev # overrides top-level environment for safe-output jobs only
1286+
github-app:
1287+
app-id: ${{ secrets.WORKFLOW_APP_ID }}
1288+
private-key: ${{ secrets.WORKFLOW_APP_PRIVATE_KEY }}
1289+
```
1290+
1291+
Accepts a plain string or an object with `name` and optional `url`, consistent with the top-level `environment:` syntax.
1292+
12771293
### Text Sanitization (`allowed-domains:`, `allowed-github-references:`)
12781294

12791295
The text output by AI agents is automatically sanitized to prevent injection of malicious content and ensure safe rendering on GitHub. The auto-sanitization applied is: XML escaped, HTTPS only, domain allowlist (GitHub by default), 0.5MB/65k line limits, control char stripping.

0 commit comments

Comments
 (0)