Fix custom safe-outputs documentation: correct agent data access pattern #11530
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.
Documentation incorrectly showed custom safe-output jobs accessing agent data via
${{ inputs.message }}expressions. This syntax doesn't work—jobs must read from theGH_AW_AGENT_OUTPUTJSON file.Changes
Corrected all examples to use proper agent output access:
${{ inputs.NAME }}rowAdded "Accessing Agent Output" section with working patterns:
Added "Understanding
inputs:" section clarifying:inputs:defines MCP tool schema for AI agent${{ inputs.* }}expressionsGH_AW_AGENT_OUTPUTJSON fileAdded "Common Mistakes" section documenting:
${{ inputs.* }}syntax (won't work)Evidence
Working examples in codebase already use correct pattern:
pkg/cli/workflows/test-copilot-safe-jobs.mdpkg/cli/workflows/test-claude-safe-jobs.mdpkg/cli/templates/create-shared-agentic-workflow.mdpkg/cli/workflows/shared/mcp/slack.mdWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
telemetry.astro.build/opt/hostedtoolcache/node/24.13.0/x64/bin/node node /home/REDACTED/work/gh-aw/gh-aw/docs/node_modules/.bin/astro build bash --no�� js/**/*.json' --ignore-path ../../../.prettierignore(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>Behaviour of custom safe outputs
inputsnot matching docs</issue_title><issue_description>I'm looking in to a bug in safe-outputs
Trying to understand if it's a bug in docs, implementation, or test,
I'm following instructions here: https://githubnext.github.io/gh-aw/guides/custom-safe-outputs/
But inputs.message is not being set. Equally I can't quite see who/what should be setting this. Wondering if docs are wrong.
Workflow is here: https://github.com/githubnext/gh-aw-test/blob/main/.github/workflows/test-claude-safe-jobs.md?plain=1
Lock file here: https://github.com/githubnext/gh-aw-test/blob/main/.github/workflows/test-claude-safe-jobs.lock.yml?plain=1
Looking at other examples uses of
inputs:insafe outputsin gh-aw files, they seem to process like this:const outputContent = process.env.GH_AW_AGENT_OUTPUT;
....
Ian't find an example that goes via inputs like the docs say
I'm asking what the spec is.
Question is whether it is it right to expect this to work, as it says in the docs:
env:
MESSAGE: "${{ inputs.message }}"
This seems unlikely. Inputs is reserved for workflow inputs as far as I can tell. I think the docs have been hallucinated here.
AFAICS all that is available is GH_AW_AGENT_OUTPUT env var and the use code must process that.
I won't fix it just yet, will write it up as an issue for your guidance on how the safe output job gets the agent output.</issue_description>
Comments on the Issue (you are @copilot in this section)
@dsyme # Bug: Documentation Incorrectly Shows `${{ inputs.* }}` Usage in Custom Safe-Output JobsSummary
The Custom Safe Outputs documentation incorrectly suggests that custom safe-output jobs can access agent-provided data via
${{ inputs.message }}or similar expressions. This is misleading - safe-output jobs must instead read from theGH_AW_AGENT_OUTPUTenvironment variable and parse the JSON file.Incorrect Documentation
Location:
docs/src/content/docs/guides/custom-safe-outputs.mdIssue 1: Environment Variables Table (lines 272-279)
Issue 2: Complete Example (lines 282-310)
Issue 3: Quick Start Example (lines 30-45)
The Quick Start example has the same issue: