Repository navigation
Description
Summary
Track item 4 of github/gh-aw-firewall#11130: gh-aw emits Copilot installation without --rootless on a native no-sudo self-hosted runner. A custom primary-agent command does not remove the standard Copilot installation needed by external threat detection.
Reported environment
- gh-aw v1.0.1, default Copilot CLI 1.0.103, AWF v0.29.0 and threat-detect v0.5.3.
- Native self-hosted Linux VM,
runs-on: linux64-selfhosted; not ARC/DinD and norunner.topology. - No sudo; non-Debian image; runner cannot write
/usr/local/bin; Docker available.
Release-source evidence
Copilot installation generation sets rootless := isArcDindTopology(workflowData). Native self-hosted jobs therefore omit the installer flag.
install_copilot_cli.sh supports ${HOME}/.local/bin with --rootless, but otherwise invokes sudo, including during ownership preparation before binary installation. Merely setting an install directory or having a binary on PATH does not remove these privileged operations.
buildExternalDetectorWorkflowData deliberately clears a custom Copilot engine.command: threat-detect resolves the standard executable and currently has no custom-command option. Thus the primary-agent installation skip is not an end-to-end workaround.
Current workaround
Insert --rootless into generated Copilot installer commands, including detection-job installation.
Requested outcome
- Support unprivileged Copilot installation independently of ARC/DinD topology, using a shared privilege-selection policy with threat-detect installation where appropriate.
- Apply the policy consistently to the primary agent and external detection workflow data; avoid changing detection's engine-command contract simply to bypass installation.
- Preserve trusted version/checksum selection, existing toolcache policy, writable-directory checks and PATH propagation so AWF/detection find the correct executable.
- Document the supported setting or default; clarify the scope of
engine.commandand preinstalled executables. - Add coverage for UID >1000/primary GID 31 with no sudo and unwritable
/usr/local/bin, including a custom primary-agent command plus external Copilot detection. Preserve existing ARC and supported privileged installation behavior.
The installer's broad /tmp chroot cleanup is also relevant to shared runners, but run-scoped cleanup is tracked separately from this privilege-selection issue.
This is release-source-backed; the original issue provides no failing run logs. The older github/gh-aw#18188 was closed after no-sudo support work, but v1.0.1 still gates this installer flag on ARC/DinD.
Activity