Skip to content

Threat detection jobs inherit rootless AWF when network-isolation enabled (#41267) #44984

Description

@Tarekchehahde

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) copies NetworkIsolation, version, runtime from parent agent sandbox
  • Applied in threat_detection_inline_engine.go and threat_detection_external.go
  • Recompiled 256 lock files (zero sudo -E awf remaining)

Fork PR

Tarekchehahde#15

Test plan

Out of scope (follow-up)

  • Chroot cleanup EACCES warning on rootless runs
  • Opt-in cross-run cache for none/nopolicy

Fixes #41267

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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