-
Notifications
You must be signed in to change notification settings - Fork 251
Description
Summary
When compiling a workflow with blocked constraints on safe-outputs (e.g. assign-to-user, unassign-from-user, add-labels), the compiler inconsistently distributes the blocked field between the two generated configs:
config.json(MCP server validation during agent execution)GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG(handler job, last line of defense before writes)
Steps to Reproduce
- Define a workflow with
blockedon multiple safe-outputs:safe-outputs: add-labels: target: "*" target-repo: "microsoft/vscode" max: 5 blocked: ["[*]*", "~spam", "stale", "triage-needed"] assign-to-user: target: "*" target-repo: "microsoft/vscode" max: 1 blocked: [copilot, "*[bot]"] unassign-from-user: target: "*" target-repo: "microsoft/vscode" max: 2 blocked: [copilot, "*[bot]"]
- Run
gh aw compile - Inspect the generated
.lock.yml
Expected Behavior
Both config.json and GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG should include the blocked constraint for all safe-output types that define it.
Actual Behavior
The blocked constraint is split inconsistently:
| Config | add_labels.blocked |
assign_to_user.blocked |
unassign_from_user.blocked |
|---|---|---|---|
config.json (MCP server) |
❌ missing | ✅ present | ✅ present |
HANDLER_CONFIG (handler job) |
✅ present | ❌ missing | ❌ missing |
Security Impact
The GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG is the last line of defense before writes are applied to the GitHub API. Since the agent job has broad filesystem access, it could theoretically bypass MCP server validation by writing safe-output entries directly. The handler config should enforce all constraints defined in the workflow .md source, including blocked for assign/unassign operations.
Similarly, config.json should enforce blocked for add_labels to provide defense-in-depth during agent execution.
Environment
gh awversion: v0.50.0- OS: Windows
- Workflow:
issue-triage.mdinmicrosoft/vscode-engineering
Workaround
Manually patch the .lock.yml after compilation to add the missing blocked fields to both configs.