Skip to content

safe_output_handler_manager ignores allowed-domains, redacts URLs from allowlisted domains #18465

@theletterf

Description

@theletterf

Description

The allowed-domains configuration under safe-outputs: in the workflow frontmatter does not prevent URL redaction by the safe_output_handler_manager.cjs. URLs from explicitly allowed domains are still replaced with (domain/redacted) in comments.

Reproduction

Frontmatter:

safe-outputs:
  allowed-domains:
    - docs.example.com
    - api.example.com
  add-comment:

Compiled output shows two different behaviors:

  1. collect_ndjson_output.cjs (agent job, ingestion step) — correctly receives GH_AW_ALLOWED_DOMAINS: "docs.example.com,api.example.com" as an env var and passes URLs through without redaction. ✅

  2. safe_output_handler_manager.cjs (safe_outputs job) — does NOT receive GH_AW_ALLOWED_DOMAINS. Its GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG only contains {"add_comment":{"max":1},...} with no domain allowlist. It redacts all non-GitHub URLs:

Redacted URL: docs.example....
Redacted URL: docs.example....

The allowed-domains config only populates GH_AW_ALLOWED_DOMAINS in the agent job's collect_ndjson_output step. The safe_outputs job's Process Safe Outputs step has no access to this configuration.

Expected behavior

URLs from domains listed in safe-outputs.allowed-domains should pass through to the final comment unredacted. The allowed domains should be propagated to the safe_output_handler_manager.cjs — either via the GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG JSON, a separate env var, or the agent output artifact.

Environment

  • gh-aw compiler: v0.50.4 (also reproduced on v0.49.4)
  • Engine: Copilot CLI
  • Trigger: issue_comment, issues: labeled

Workaround

Instruct the agent to output doc site paths (e.g. /docs/product/page-name) instead of full URLs to avoid triggering the URL sanitizer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions