Summary
The compiled lock file contains two AWF (Agent Workflow Firewall) invocations in the "Execute GitHub Copilot CLI" step: the main agent run and a post-agent threat detection run. On GHE Cloud with data residency, the main agent run succeeds, but the threat detection run fails because it is missing the --copilot-api-target flag and the GHE-specific domains in its --allow-domains list.
This causes the overall step to fail with exit code 1, even though the agent itself completed successfully.
Environment
What Happens
The "Execute GitHub Copilot CLI" step runs two AWF invocations back-to-back:
1. Main agent AWF run — ✅ Succeeds (exit code 0)
sudo -E awf ... \
--allow-domains "...,copilot-api.contoso-aw.ghe.com,..." \
--copilot-api-target copilot-api.contoso-aw.ghe.com \
-- /bin/bash -c '/usr/local/bin/copilot ... --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"'
This invocation has the correct --copilot-api-target and includes copilot-api.contoso-aw.ghe.com in the allowed domains. The Copilot CLI runs, calls tools (glob, list_issues, issue_read), and exits cleanly.
2. Threat detection AWF run — ❌ Fails (exit code 1)
sudo -E awf ... \
--allow-domains "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,github.com,host.docker.internal,raw.githubusercontent.com,registry.npmjs.org,telemetry.enterprise.githubcopilot.com" \
-- /bin/bash -c '/usr/local/bin/copilot ... --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log
This invocation is missing:
--copilot-api-target copilot-api.contoso-aw.ghe.com — not present at all
copilot-api.contoso-aw.ghe.com — not in --allow-domains
api.contoso-aw.ghe.com — not in --allow-domains
It only has github.com-oriented domains. On GHE Cloud DR, the Copilot CLI needs to reach copilot-api.contoso-aw.ghe.com for inference, so this second run fails.
Root Cause
The compiler generates the GHE-specific AWF flags (--copilot-api-target, DR domains in --allow-domains) for the main agent AWF invocation but does not propagate them to the threat detection AWF invocation within the same step.
Suggested Fixes
-
Propagate GHE config to threat detection: When compiling for a GHE instance, ensure the threat detection AWF invocation receives the same --copilot-api-target and --allow-domains as the main agent invocation.
-
Make threat detection non-fatal: If the threat detection step is optional / best-effort, consider not failing the entire step when it exits non-zero (e.g., || true or a separate continue-on-error step).
-
Skip threat detection on GHE: If threat detection only works with github.com Copilot endpoints, skip it on GHE instances rather than running it with incorrect configuration and failing.
Related Issues
Summary
The compiled lock file contains two AWF (Agent Workflow Firewall) invocations in the "Execute GitHub Copilot CLI" step: the main agent run and a post-agent threat detection run. On GHE Cloud with data residency, the main agent run succeeds, but the threat detection run fails because it is missing the
--copilot-api-targetflag and the GHE-specific domains in its--allow-domainslist.This causes the overall step to fail with exit code 1, even though the agent itself completed successfully.
Environment
gh aw compile)contoso-aw.ghe.comWhat Happens
The "Execute GitHub Copilot CLI" step runs two AWF invocations back-to-back:
1. Main agent AWF run — ✅ Succeeds (exit code 0)
This invocation has the correct
--copilot-api-targetand includescopilot-api.contoso-aw.ghe.comin the allowed domains. The Copilot CLI runs, calls tools (glob, list_issues, issue_read), and exits cleanly.2. Threat detection AWF run — ❌ Fails (exit code 1)
This invocation is missing:
--copilot-api-target copilot-api.contoso-aw.ghe.com— not present at allcopilot-api.contoso-aw.ghe.com— not in--allow-domainsapi.contoso-aw.ghe.com— not in--allow-domainsIt only has github.com-oriented domains. On GHE Cloud DR, the Copilot CLI needs to reach
copilot-api.contoso-aw.ghe.comfor inference, so this second run fails.Root Cause
The compiler generates the GHE-specific AWF flags (
--copilot-api-target, DR domains in--allow-domains) for the main agent AWF invocation but does not propagate them to the threat detection AWF invocation within the same step.Suggested Fixes
Propagate GHE config to threat detection: When compiling for a GHE instance, ensure the threat detection AWF invocation receives the same
--copilot-api-targetand--allow-domainsas the main agent invocation.Make threat detection non-fatal: If the threat detection step is optional / best-effort, consider not failing the entire step when it exits non-zero (e.g.,
|| trueor a separatecontinue-on-errorstep).Skip threat detection on GHE: If threat detection only works with github.com Copilot endpoints, skip it on GHE instances rather than running it with incorrect configuration and failing.
Related Issues
configure_gh_for_ghe.shfails with GH_TOKEN (fixed in this run's version)