gh-aw
gh-aw copied to clipboard
Threat detection jobs inherit rootless AWF when network-isolation enabled (#41267)
Problem
Main agent jobs omit sudo when sandbox.agent.sudo: false (network isolation), but detection jobs built synthetic WorkflowData without inheriting parent NetworkIsolation. Generated locks still contained sudo -E awf in detection_agentic_execution while the agent job used rootless awf.
Before (detection job, network-isolation workflow)
run: |
sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" ...
Install step used install_awf_binary.sh without --rootless.
After
run: |
awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" ...
Install step passes --rootless when parent agent has network isolation.
Implementation
buildThreatDetectionAgentConfig(parent)copiesNetworkIsolation, version, runtime from parent agent sandbox- Applied in
threat_detection_inline_engine.goandthreat_detection_external.go - Recompiled 256 lock files (zero
sudo -E awfremaining)
Fork PR
https://github.com/Tarekchehahde/gh-aw/pull/15
Test plan
- [x]
go test ./pkg/workflow/ -run TestNetworkIsolationRootless - [x]
TestCompiledLockFiles_SmokeWorkflowsHaveDetectionJobWithAgenticRunCall - [x] Fork CI green on PR #15
Out of scope (follow-up)
- Chroot cleanup
EACCESwarning on rootless runs - Opt-in cross-run cache for
none/nopolicy
Fixes #41267
Fork PR: https://github.com/Tarekchehahde/gh-aw/pull/15 — all CGO checks green on fork.
File issues as specs, not forks.