Skip to content

feat: add cli-proxy feature flag for AWF gh CLI proxy sidecar (firewall v0.25.14)#24997

Merged
lpcox merged 8 commits intomainfrom
copilot/add-cli-proxy-feature-flag
Apr 7, 2026
Merged

feat: add cli-proxy feature flag for AWF gh CLI proxy sidecar (firewall v0.25.14)#24997
lpcox merged 8 commits intomainfrom
copilot/add-cli-proxy-feature-flag

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

Bump default AWF firewall to v0.25.14 and add cli-proxy / cli-proxy-writable feature flags that wire up the new gh CLI proxy sidecar — secure gh access in the agent container without exposing GITHUB_TOKEN.

Changes

  • pkg/constants/version_constants.goDefaultFirewallVersionv0.25.14; added AWFCliProxyMinVersion = "v0.25.14" minimum version constant for the version gate
  • pkg/constants/feature_constants.go — two new flags:
    • CliProxyFeatureFlag = "cli-proxy"
    • CliProxyWritableFeatureFlag = "cli-proxy-writable"
  • pkg/workflow/awf_helpers.goBuildAWFArgs() injects after --enable-api-proxy:
    • --enable-cli-proxy when cli-proxy: true (gated on awfSupportsCliProxy() version check)
    • --cli-proxy-writable when cli-proxy-writable: true (gated on cli-proxy)
    • --cli-proxy-policy <json> reusing getDIFCProxyPolicyJSON() when tools.github has min-integrity / allowed-repos
    • Added awfSupportsCliProxy() version gate (mirrors awfSupportsExcludeEnv) — skips all cli-proxy flags with a log message when the workflow pins an AWF version older than v0.25.14, preventing unknown-flag startup failures
  • pkg/workflow/awf_helpers_test.go — 16 unit tests covering all injection/non-injection paths, including pinned-old-version path (TestAWFSupportsCliProxy and updated TestBuildAWFArgsCliProxy)
  • All 182 workflow lock files recompiled against the new firewall version

Usage

features:
  cli-proxy: true          # read-only gh CLI access via proxy sidecar
  cli-proxy-writable: true # also allow write ops (create issue, merge PR, …)

tools:
  github:
    min-integrity: approved  # forwarded as --cli-proxy-policy guard policy

Note

Workflows that pin network_permissions.firewall.version to a version older than v0.25.14 will have the cli-proxy flags silently skipped to avoid AWF startup failures.

Copilot AI changed the title [WIP] Add cli-proxy feature flag for AWF gh CLI proxy sidecar feat: add cli-proxy feature flag for AWF gh CLI proxy sidecar (firewall v0.25.14) Apr 7, 2026
Copilot AI requested a review from lpcox April 7, 2026 01:51
Copilot finished work on behalf of lpcox April 7, 2026 01:51
@lpcox lpcox marked this pull request as ready for review April 7, 2026 01:52
Copilot AI review requested due to automatic review settings April 7, 2026 01:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Bumps the default Agentic Workflow Firewall (AWF) version to v0.25.14 and introduces cli-proxy / cli-proxy-writable feature flags that add AWF CLI proxy sidecar arguments (including optional guard policy propagation) to enable secure gh CLI usage inside the agent sandbox.

Changes:

  • Bump default AWF firewall version to v0.25.14.
  • Add cli-proxy and cli-proxy-writable feature flags and wire them into BuildAWFArgs() (including optional --cli-proxy-policy from tools.github guard fields).
  • Add unit tests for CLI proxy arg injection paths and recompile workflow lockfiles to the new AWF version.
Show a summary per file
File Description
pkg/workflow/awf_helpers.go Injects --enable-cli-proxy, --cli-proxy-writable, and optional --cli-proxy-policy into AWF args based on feature flags.
pkg/workflow/awf_helpers_test.go Adds unit tests covering CLI proxy arg injection/non-injection cases.
pkg/constants/version_constants.go Updates DefaultFirewallVersion to v0.25.14.
pkg/constants/feature_constants.go Adds CliProxyFeatureFlag and CliProxyWritableFeatureFlag constants and documentation.
.github/workflows/workflow-health-manager.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/workflow-generator.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/weekly-blog-post-writer.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/test-workflow.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/test-project-url-default.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/test-dispatcher.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/smoke-gemini.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/security-compliance.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/repo-tree-map.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/refiner.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/q.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/pr-triage-agent.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/poem-bot.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/plan.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/notion-issue-summary.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/metrics-collector.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/jsweep.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/issue-triage-agent.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/issue-monster.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/gpclean.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/github-remote-mcp-auth-test.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/firewall.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/example-permissions-warning.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/dictation-prompt.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/dev.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/dependabot-burner.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/daily-team-status.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/daily-secrets-analysis.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/daily-malicious-code-scan.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/craft.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/copilot-token-optimizer.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/contribution-check.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/constraint-solving-potd.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/codex-github-remote-mcp-test.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/code-simplifier.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/changeset.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/brave.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/bot-detection.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/ai-moderator.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.github/workflows/ace-editor.lock.yml Recompiled lockfile to AWF v0.25.14 / image tag 0.25.14.
.changeset/patch-bump-awf-v0-25-14.md Adds a patch changeset documenting the default AWF version bump.
.changeset/minor-add-cli-proxy-feature-flag.md Adds a minor changeset documenting the new CLI proxy feature flags and behavior.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 111/188 changed files
  • Comments generated: 1

Comment on lines +245 to +249
// Enable CLI proxy sidecar when the cli-proxy feature flag is set.
// This gives the agent secure gh CLI access without exposing GITHUB_TOKEN
// in the agent container (firewall v0.25.14+).
if isFeatureEnabled(constants.CliProxyFeatureFlag, config.WorkflowData) {
awfArgs = append(awfArgs, "--enable-cli-proxy")
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CLI proxy flags are injected purely based on the feature flags. Workflows can pin an older AWF version via network_permissions.firewall.version; for versions < v0.25.14 these flags will cause AWF startup to fail (unknown flag). Add a version gate similar to awfSupportsExcludeEnv (e.g., awfSupportsCliProxy with a min-version constant) and skip/ log when the pinned version is too old; update tests to cover the pinned-old-version path.

Copilot uses AI. Check for mistakes.
@lpcox
Copy link
Copy Markdown
Collaborator

lpcox commented Apr 7, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 7, 2026

@copilot apply changes based on the comments in this thread

Done in commit 1adf086. Added AWFCliProxyMinVersion = "v0.25.14" constant and an awfSupportsCliProxy() version gate (same pattern as awfSupportsExcludeEnv). The cli-proxy flags are now skipped with a log message when the pinned firewall version is older than v0.25.14. Added 8 tests for awfSupportsCliProxy and a new test case in TestBuildAWFArgsCliProxy that verifies all three flags are suppressed when pinning v0.25.13.

Copilot finished work on behalf of lpcox April 7, 2026 02:18
Copilot AI and others added 4 commits April 6, 2026 19:44
…#25003)

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/45d7425a-e55e-4a76-8049-e58cad7ee0d6

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/d97ec115-fca7-468f-8455-80e276a712cf

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/7417d3b0-97d5-4b8f-baf1-dff3635cd5d2

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
)

* fix: restore backward compat in assign_to_agent.cjs for standalone tests

The main() function was refactored to a handler factory pattern but tests
still use the old standalone interface (env vars + direct item processing).
Add standalone mode detection when main() is called with no config:
- Reads config from env vars (GH_AW_AGENT_DEFAULT, GH_AW_AGENT_MAX_COUNT, etc.)
- Processes all assign_to_agent items from GH_AW_AGENT_OUTPUT
- Writes summary, sets outputs, calls setFailed on errors
Also fix the "Ignore-if-error mode enabled" log message to match tests.

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e00f51ce-33dd-493d-ba64-e13e1ebeb1be

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* fix: address code review feedback on standalone mode detection

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e00f51ce-33dd-493d-ba64-e13e1ebeb1be

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

* Update; rm -rf /

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* fix: update assign_to_agent tests to use handler factory pattern

Replace `await main()` standalone calls in test evals with a STANDALONE_RUNNER
snippet that simulates the safe-output handler manager flow:
- build config from env vars
- call main(config) to get the handler function
- process assign_to_agent items through the handler
- write summary, set outputs, call setFailed on errors

Also fix the "encounters auth errors" assertion to match the production log message.

No changes to assign_to_agent.cjs production code.

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/d92459b5-9e9b-40ad-a0c6-108c70f23622

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@lpcox lpcox merged commit 640038a into main Apr 7, 2026
56 of 57 checks passed
@lpcox lpcox deleted the copilot/add-cli-proxy-feature-flag branch April 7, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add cli-proxy feature flag for AWF gh CLI proxy sidecar (firewall v0.25.14)

4 participants