Skip to content

Compiler drops 'blocked' constraints from safe-outputs configs inconsistently #18103

@benvillalobos

Description

@benvillalobos

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:

  1. config.json (MCP server validation during agent execution)
  2. GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG (handler job, last line of defense before writes)

Steps to Reproduce

  1. Define a workflow with blocked on 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]"]
  2. Run gh aw compile
  3. 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 aw version: v0.50.0
  • OS: Windows
  • Workflow: issue-triage.md in microsoft/vscode-engineering

Workaround

Manually patch the .lock.yml after compilation to add the missing blocked fields to both configs.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions