-
Notifications
You must be signed in to change notification settings - Fork 368
feat(workflow): support sandbox.agent.version and migrate deprecated network.firewall to sandbox.agent #27626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5d937e0
feat(workflow): support sandbox.agent.version for awf resolution
Copilot f9e7faf
fix(workflow): refine sandbox agent awf version override handling
Copilot 2eb90d0
chore(workflow): improve sandbox agent version override logging
Copilot 940737d
chore(workflow): polish awf version override handling and tests
Copilot 7f58a9c
refactor: remove network.firewall frontmatter and migrate via codemod
Copilot 627f931
chore(cli): tighten firewall version migration normalization
Copilot 3e3e135
docs(adr): add draft ADR-27626 for sandbox.agent.version and network.…
github-actions[bot] c5acf57
Merge branch 'main' into copilot/add-sandbox-agent-version-parameter
pelikhan 6e2022f
fix(codemod): merge firewall disable/version into existing sandbox
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
docs/adr/27626-sandbox-agent-version-and-network-firewall-migration.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # ADR-27626: Introduce sandbox.agent.version and Remove Deprecated network.firewall Field | ||
|
|
||
| **Date**: 2026-04-21 | ||
| **Status**: Draft | ||
| **Deciders**: Unknown (copilot-swe-agent / pelikhan) | ||
|
|
||
| --- | ||
|
|
||
| ## Part 1 — Narrative (Human-Friendly) | ||
|
|
||
| ### Context | ||
|
|
||
| The `network.firewall` frontmatter field was previously used to configure the Agent Workflow Firewall (AWF) in agentic workflow definitions. It was deprecated in favor of the unified `sandbox.agent` configuration block, but the migration codemod only handled the `true` case, leaving `false`, `null`, `"disable"`, and object-with-version forms unmigrated. Additionally, there was no mechanism to pin a specific AWF version via frontmatter — users who needed to run a particular AWF release had no stable, documented way to express that constraint. This PR addresses both gaps simultaneously: removing the deprecated field from the schema and expanding the codemod to cover all value variants. | ||
|
|
||
| ### Decision | ||
|
|
||
| We will remove `network.firewall` from the frontmatter schema entirely and add `sandbox.agent.version` as a first-class string field for pinning the AWF version used during installation and runtime. The codemod will be expanded to migrate all `network.firewall` value forms — `true`, `false`, `null`, `"disable"`, and `{version: ...}` objects — to their `sandbox.agent` equivalents. This consolidates AWF configuration under a single `sandbox.agent` surface and ensures the migration path covers every variant that appears in the wild. | ||
|
|
||
| ### Alternatives Considered | ||
|
|
||
| #### Alternative 1: Retain network.firewall as a Deprecated Alias | ||
|
|
||
| Keep `network.firewall` in the schema with a deprecation warning, parsing it alongside `sandbox.agent` and merging the values at runtime. This avoids a hard removal and gives teams more migration runway, but perpetuates two competing configuration surfaces indefinitely, increases parser complexity, and makes it harder to reason about precedence when both fields are set. | ||
|
|
||
| #### Alternative 2: Introduce a Flat sandbox.awf-version Field | ||
|
|
||
| Add a top-level sibling key `sandbox.awf-version` (or similar) rather than nesting the version under `sandbox.agent`. This is marginally more ergonomic to type but diverges from the `sandbox.agent` object model already established, creates a second place where AWF version information lives, and complicates the precedence rules for effective version resolution. | ||
|
|
||
| ### Consequences | ||
|
|
||
| #### Positive | ||
| - All `network.firewall` value forms now have a deterministic, tested migration path to `sandbox.agent`. | ||
| - Users can pin an explicit AWF version via `sandbox.agent.version`, enabling reproducible builds without relying on the latest release. | ||
| - The schema surface is reduced by removing a deprecated field and its associated validation rules. | ||
|
|
||
| #### Negative | ||
| - Behavioral change: `network.firewall: false` previously produced no `sandbox` block; it now migrates to `sandbox.agent: false`. Workflows relying on the old no-op behavior will see a new block added by the codemod. | ||
| - The `normalizeFirewallVersion` helper must handle all numeric YAML types (int8 through uint64, float32/float64) because YAML parsers may unmarshal numeric version values into any of these types, increasing codemod surface area. | ||
|
|
||
| #### Neutral | ||
| - The codemod expansion requires updating existing tests that asserted `sandbox:` was *not* added for `false` and nested object cases; these expectations were inverted. | ||
| - The `aw-info` AWF version reporting now reads `sandbox.agent.version` in addition to the legacy `firewallVersion` field, requiring both paths to be tested. | ||
|
|
||
| --- | ||
|
|
||
| ## Part 2 — Normative Specification (RFC 2119) | ||
|
|
||
| > The key words **MUST**, **MUST NOT**, **REQUIRED**, **SHALL**, **SHALL NOT**, **SHOULD**, **SHOULD NOT**, **RECOMMENDED**, **MAY**, and **OPTIONAL** in this section are to be interpreted as described in [RFC 2119](https://www.rfc-editor.org/rfc/rfc2119). | ||
|
|
||
| ### Frontmatter Schema | ||
|
|
||
| 1. Implementations **MUST NOT** include `network.firewall` in the frontmatter schema as a valid, non-deprecated field. | ||
| 2. Implementations **MUST** expose `sandbox.agent.version` as an optional string field in the frontmatter schema for specifying an AWF version override. | ||
| 3. The `sandbox.agent.version` field **MUST** be treated as a string type; numeric-like values written in YAML **MUST** be quoted at generation time to prevent YAML parsers from interpreting them as numbers. | ||
|
|
||
| ### Codemod Migration | ||
|
|
||
| 1. The `network.firewall` codemod **MUST** produce a `sandbox.agent` block for every non-absent value of `network.firewall`, including `true`, `false`, `null`, `"disable"`, and object forms. | ||
| 2. When `network.firewall` is `true` or `null`, the codemod **MUST** emit `sandbox.agent: awf`. | ||
| 3. When `network.firewall` is `false` or `"disable"`, the codemod **MUST** emit `sandbox.agent: false`. | ||
| 4. When `network.firewall` is an object containing a `version` key, the codemod **MUST** emit a `sandbox.agent` object block with `id: awf` and `version: "<migrated-value>"`. | ||
| 5. The codemod **MUST NOT** add a `sandbox` block when one already exists in the frontmatter. | ||
| 6. Numeric version values encountered during migration **MUST** be normalized to their string representation before being written as `sandbox.agent.version`. | ||
|
|
||
| ### AWF Version Resolution | ||
|
|
||
| 1. When `sandbox.agent.version` is set, it **MUST** take precedence over any version derived from the legacy `network.firewall` configuration when resolving the effective AWF version for installation and runtime. | ||
| 2. Implementations **SHOULD** surface the resolved AWF version in `aw-info` metadata so that workflow authors can verify which version is active. | ||
|
|
||
| ### Conformance | ||
|
|
||
| An implementation is considered conformant with this ADR if it satisfies all **MUST** and **MUST NOT** requirements above. Failure to meet any **MUST** or **MUST NOT** requirement constitutes non-conformance. | ||
|
|
||
| --- | ||
|
|
||
| *This is a DRAFT ADR generated by the [Design Decision Gate](https://github.com/github/gh-aw/actions/runs/24736713102) workflow. The PR author must review, complete, and finalize this document before the PR can merge.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The codemod only migrates
network.firewallintosandbox.agentwhen there is no existingsandboxblock (if !hasSandbox). If a workflow already hassandbox:for other reasons (e.g.,sandbox.mcpor legacysandbox.type) andnetwork.firewallwasfalse/disableor contained aversion, this codemod will removenetwork.firewallbut skip adding the equivalentsandbox.agentsetting, changing behavior (e.g., losing an explicit disable or version pin). Consider also migrating into an existingsandbox:block when present (at least for the disable/version cases), or declining to removenetwork.firewallunless the equivalentsandbox.agentconfiguration is ensured.