github / github/gh-aw

Omit sudo from generated lock.yml when network-isolation sandbox is enabled

Open
#41,267 2 comments 1 reaction 2 assignees Claimed by @lpcox View on GitHub
compiler enhancement workflows
Dominant language
Go
Stars
5.1k
Forks
541
Avg merge
5h 48m
Merged PRs (30d)
773

Description

## Summary

When the AWF **network-isolation** sandbox option is enabled (`sandbox.agent.network-isolation: true`), the compiler still emits `sudo` in the generated `.lock.yml` for the awf binary install and the `awf` invocation. In network-isolation mode, AWF no longer needs `NET_ADMIN`/host-iptables egress enforcement, so it can run **rootless** — a key requirement for ARC (Actions Runner Controller) Kubernetes runners where passwordless `sudo`/host-iptables are often unavailable.

The compiler should **omit `sudo` from the generated lock when network-isolation is enabled**.

## Current behavior

For a workflow with `sandbox.agent.network-isolation: true`, the generated lock contains (line numbers from a real compile):

```yaml
# Install awf binary
sudo tee /usr/local/bin/awf > /dev/null < /dev/null <

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.