From 623f52031e2bc9f3ffb3659ee17d593e23d28253 Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Tue, 24 Nov 2026 13:52:59 -0800 Subject: [PATCH 1/4] fix(box): Use the v0.3.0 macOS box instead of v0.3.0-preview.1 The macOS build of box v0.3.0 runs: its box and both helpers pass codesign --verify --strict (Developer ID, AMZN Mobile LLC) and box --version prints box 0.3.0. The invalid Info.plist reported when it was pinned away came from that copy on disk, not the release asset: the asset's SHA-256 is the same, and it has not been re-uploaded. So macOS and Linux both take v0.3.0 again, boxRelease.json drops darwin.version, and the install hints and docs no longer send macOS to the preview. bump-box-release.ts keeps --darwin-box for a release whose macOS build does not run. --- README.md | 3 +-- docs/box-local-testing.md | 23 ++++++++++---------- src/core/project/backends/boxRelease.json | 5 ++--- src/core/project/backends/boxRelease.test.ts | 9 +++----- src/core/project/boxProfileResolver.test.ts | 6 +---- src/core/project/templates/boxProfile.ts | 2 +- 6 files changed, 19 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index d1952fad7..df936e765 100644 --- a/README.md +++ b/README.md @@ -217,8 +217,7 @@ box profile; build and deploy stop without them. Build derives the AgentCore Run each runtime from its local profile. box comes from the `box-cli` archives of the public GitHub release `v0.3.0` of [strands-agents/box](https://github.com/strands-agents/box/releases). No token or account is needed to download it. Use that release's build for your machine for `agentcore dev` -and the profile checks of `build`: an older box cannot read the profiles that this CLI writes. On -macOS, use the build of `v0.3.0-preview.1` instead: the macOS build of `v0.3.0` does not run. +and the profile checks of `build`: an older box cannot read the profiles that this CLI writes. `src/core/project/backends/boxRelease.json` pins the Linux build of box that ships to AgentCore Runtime, with its repository, version and SHA-256. It also pins the macOS arm64 build, which the e2e diff --git a/docs/box-local-testing.md b/docs/box-local-testing.md index 8b57579b6..4c0a68d9d 100644 --- a/docs/box-local-testing.md +++ b/docs/box-local-testing.md @@ -48,8 +48,7 @@ fork of [strands-agents/box](https://github.com/strands-agents/box), then run [aws/agentcore-l3-cdk-constructs#481](https://github.com/aws/agentcore-l3-cdk-constructs/pull/481): it gives the runtime's role its Memory grant, and a `PRIVATE_VPC` runtime the AgentCore endpoint of its private VPC. Without it, the box cannot reach Memory. -- `box` `0.3.0` on your `PATH` (`0.3.0-preview.1` on macOS), the release the CLI pins. Use that - release: the box +- `box` `0.3.0` on your `PATH`, the release the CLI pins. Use that release: the box features and the profiles that the CLI writes change together, so an older box can refuse the profiles. The CLI does not check the version of the box on your `PATH` yet. Build, deploy and dev run it to read the box profile with `box profile show --format json --full`, and CodeZip dev runs @@ -70,14 +69,14 @@ without its packs; do not use them. Each `box-cli` archive unpacks flat: `box`, Download the archive for your machine, check it, and unpack it into a versioned folder. -macOS on an Apple chip, from `v0.3.0-preview.1`: the macOS build of `v0.3.0` does not run. +macOS on an Apple chip: ``` -mkdir -p ~/.local/share/box/0.3.0-preview.1 && cd ~/.local/share/box/0.3.0-preview.1 -curl -fSLO https://github.com/strands-agents/box/releases/download/v0.3.0-preview.1/box-cli-v0.3.0-preview.1-aarch64-apple-darwin.tar.gz -curl -fSLO https://github.com/strands-agents/box/releases/download/v0.3.0-preview.1/SHA256SUMS.txt -grep box-cli-v0.3.0-preview.1-aarch64-apple-darwin SHA256SUMS.txt | shasum -a 256 -c - -tar -xzf box-cli-v0.3.0-preview.1-aarch64-apple-darwin.tar.gz +mkdir -p ~/.local/share/box/0.3.0 && cd ~/.local/share/box/0.3.0 +curl -fSLO https://github.com/strands-agents/box/releases/download/v0.3.0/box-cli-v0.3.0-aarch64-apple-darwin.tar.gz +curl -fSLO https://github.com/strands-agents/box/releases/download/v0.3.0/SHA256SUMS.txt +grep box-cli-v0.3.0-aarch64-apple-darwin SHA256SUMS.txt | shasum -a 256 -c - +tar -xzf box-cli-v0.3.0-aarch64-apple-darwin.tar.gz ``` Linux arm64: @@ -93,10 +92,10 @@ tar -xzf box-cli-v0.3.0-aarch64-unknown-linux-gnu.tar.gz The check must print `OK`. Put the folder first on your `PATH`, for this shell and for new ones (use `~/.bashrc` for bash). -`BOX_VERSION` is the folder you unpacked into: `0.3.0-preview.1` on macOS, `0.3.0` on Linux. +`BOX_VERSION` is the folder you unpacked into, `0.3.0`. ``` -BOX_VERSION=0.3.0-preview.1 +BOX_VERSION=0.3.0 export PATH="$HOME/.local/share/box/$BOX_VERSION:$PATH" grep -q "share/box/$BOX_VERSION" ~/.zshrc || echo "export PATH=\"\$HOME/.local/share/box/$BOX_VERSION:\$PATH\"" >> ~/.zshrc ``` @@ -113,11 +112,11 @@ box --version - `which box` must name the folder you unpacked into. An older `box` earlier on your `PATH` (a source build, or Box Core's `box` in `/usr/local/bin`) wins otherwise. -- `box --version` should print the pinned `box 0.3.0`, or `box 0.3.0-preview.1` on macOS (from +- `box --version` should print the pinned `box 0.3.0` (from `src/core/project/backends/boxRelease.json`). An older box can refuse the profiles that the CLI writes. - On macOS, if Gatekeeper refuses to run `box`, clear the download flag with - `xattr -dr com.apple.quarantine "$HOME/.local/share/box/0.3.0-preview.1"`. + `xattr -dr com.apple.quarantine "$HOME/.local/share/box/0.3.0"`. To move to a newer release, unpack it into its own folder the same way and change the `PATH` line to that folder. diff --git a/src/core/project/backends/boxRelease.json b/src/core/project/backends/boxRelease.json index bfa3417c5..d8aa0aed1 100644 --- a/src/core/project/backends/boxRelease.json +++ b/src/core/project/backends/boxRelease.json @@ -8,10 +8,9 @@ "sha256": "9c7c01b22374b0041823429ba068745829ac3800db7c43b762f1836b54b40658" }, "darwin": { - "version": "0.3.0-preview.1", "target": "aarch64-apple-darwin", - "asset": "box-cli-v0.3.0-preview.1-aarch64-apple-darwin.tar.gz", - "sha256": "eaf085e443d0a1f6c9e5566194e786274c5bf30d6f7681923221f5680317bb77" + "asset": "box-cli-v0.3.0-aarch64-apple-darwin.tar.gz", + "sha256": "bc077119fe6b9c4ff84dffea4f895bd23531d7eda36c965aa5503131c69aaa70" } } } diff --git a/src/core/project/backends/boxRelease.test.ts b/src/core/project/backends/boxRelease.test.ts index 59dcb4d8c..ccdca1ca9 100644 --- a/src/core/project/backends/boxRelease.test.ts +++ b/src/core/project/backends/boxRelease.test.ts @@ -268,16 +268,13 @@ describe("the pinned releases", () => { ); }); - test("the install hint names the box-cli archive of the pinned release, and the macOS release", () => { - // The macOS build of 0.3.0 does not run, so macOS gets the darwin pin's release. + test("the install hint names the box-cli archive of the pinned release", () => { + // macOS and Linux come from the same release, so the hint names no other macOS release. expect(BOX_INSTALL_HINT).toBe( "Install box: download box-cli-v0.3.0-.tar.gz for your machine from " + "https://github.com/strands-agents/box/releases/tag/v0.3.0 (not a box-v0.3.0-* archive, " + "which has no packs), unpack it into a folder (tar -xzf -C ), and add " + - "that folder to your PATH. On macOS, use " + - "box-cli-v0.3.0-preview.1-aarch64-apple-darwin.tar.gz from " + - "https://github.com/strands-agents/box/releases/tag/v0.3.0-preview.1 instead: the macOS " + - "build of 0.3.0 does not run.", + "that folder to your PATH.", ); }); }); diff --git a/src/core/project/boxProfileResolver.test.ts b/src/core/project/boxProfileResolver.test.ts index ad1d94b93..8989f7af3 100644 --- a/src/core/project/boxProfileResolver.test.ts +++ b/src/core/project/boxProfileResolver.test.ts @@ -97,11 +97,7 @@ const SHOWN_POLICY = boxReachRules("mcp", "docs", ["docs.example.com"]); /** The last sentence of each error that says to install another box: the pinned release. */ -const INSTALL = - `Install box ${BOX_RELEASE.version} (https://github.com/strands-agents/box/releases/tag/v${BOX_RELEASE.version}), then retry. ` + - "On macOS, use box-cli-v0.3.0-preview.1-aarch64-apple-darwin.tar.gz from " + - "https://github.com/strands-agents/box/releases/tag/v0.3.0-preview.1 instead: the macOS build " + - "of 0.3.0 does not run."; +const INSTALL = `Install box ${BOX_RELEASE.version} (https://github.com/strands-agents/box/releases/tag/v${BOX_RELEASE.version}), then retry.`; /** * `box profile show open --format json --full` for a profile with the routes `auth` and `github` diff --git a/src/core/project/templates/boxProfile.ts b/src/core/project/templates/boxProfile.ts index 50cd627be..5f33412c8 100644 --- a/src/core/project/templates/boxProfile.ts +++ b/src/core/project/templates/boxProfile.ts @@ -109,7 +109,7 @@ const ABSOLUTE_PATH_PATTERN = "(/[.]{0,2}[A-Za-z0-9_+-][A-Za-z0-9_.+-]*)+"; /** * The tools of @box/base that get the project's write grant: box gives each one its own grant, * so each lists the agent's `deny_write` folders as well. Taken from @box/base in the box release - * that `boxRelease.json` pins (0.3.0, and 0.3.0-preview.1 for macOS), which has no tools: it + * that `boxRelease.json` pins (0.3.0), which has no tools: it * dropped `uname`, and refuses a * `[tool.uname]` table with no `command`. When the pin moves, check the tools of @box/base: box * refuses a CodeZip box profile if a tool it misses gets the project write grant. From 0223c282c288fa1bec5c4b6ef735a1249820658b Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Tue, 24 Nov 2026 14:18:18 -0800 Subject: [PATCH 2/4] docs(e2e): Say which macOS box build CI saw killed The macOS skip said the pinned macOS box build is killed at start. That was v0.3.0-preview.1, after the workflow's install; the pin is now v0.3.0, which no CI run has tried yet. --- .github/workflows/e2e-test.yml | 7 ++++--- e2eTest/README.md | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 957f6ad6e..6d5278b5b 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -137,9 +137,10 @@ jobs: aws-region: ${{ vars.E2E_REGION || 'us-east-1' }} unset-current-credentials: true # box ships only arm64 builds, so only the macOS (Apple silicon) and Linux arm64 runners can run - # the Box tests. They skip on a runner with no box on PATH. macOS is left out for now: its pinned - # box build is killed as soon as it starts (`Killed: 9` on `box --version`), so on macOS the Box - # tests skip and the rest of the suite still runs. + # the Box tests. They skip on a runner with no box on PATH. macOS is left out for now: there the + # macOS box (v0.3.0-preview.1, validly signed) was killed as soon as it started after this + # install (`Killed: 9` on `box --version`), so on macOS the Box tests skip and the rest of the + # suite still runs. Re-enable it once a run shows the pinned build starts here. - name: Install box if: matrix.name == 'Linux-arm64' env: diff --git a/e2eTest/README.md b/e2eTest/README.md index 8863a3492..a403b5d46 100644 --- a/e2eTest/README.md +++ b/e2eTest/README.md @@ -28,8 +28,9 @@ are optional and need a `box` on your PATH: `create` checks for one for a CodeZi `build` and `deploy` run `box profile show` for every Box template, the container one too. Without one, they skip. box ships only arm64 builds, so in CI only the Linux arm64 runner (`ubuntu-24.04-arm`) has one: it installs the box that `src/core/project/backends/boxRelease.json` -pins. The macOS runner (Apple silicon) is left out for now, because the pinned macOS box build is -killed as soon as it starts (`Killed: 9`), so there the Box tests skip. `create` also installs the agent's dependencies +pins. The macOS runner (Apple silicon) is left out for now: there the macOS box +(`v0.3.0-preview.1`, validly signed) was killed as soon as it started after the workflow's install +(`Killed: 9`), so the Box tests skip on macOS until a run shows the pinned build starts there. `create` also installs the agent's dependencies and the CDK app's, which `dev` and `deploy` use, so the tests don't pass `--skip-install`. The tests that deploy also need `AGENTCORE_E2E_BOX_CDK`: the pinned `@aws/agentcore-cdk` release From 0dc8f294b17fc7286eae784ef3d91ada39dfabd7 Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Tue, 24 Nov 2026 14:21:13 -0800 Subject: [PATCH 3/4] ci(e2e): Run the Box tests on macOS again, with box unpacked as the runner user macOS now pins box v0.3.0, which runs when unpacked plainly. CI installs it on the macOS runner again, unpacked as the runner user into $RUNNER_TEMP/box and put on PATH, as a developer does, instead of the sudo unpack into /opt/box after which the signed v0.3.0-preview.1 was killed at start. If macOS refuses box, the step prints codesign's verdict and the recent system log before failing. The macOS runner builds the L3 constructs for the Box deploys too. Linux arm64 is unchanged. --- .github/workflows/e2e-test.yml | 36 ++++++++++++++++++++++------------ e2eTest/README.md | 16 +++++++-------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 6d5278b5b..259930608 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -137,12 +137,9 @@ jobs: aws-region: ${{ vars.E2E_REGION || 'us-east-1' }} unset-current-credentials: true # box ships only arm64 builds, so only the macOS (Apple silicon) and Linux arm64 runners can run - # the Box tests. They skip on a runner with no box on PATH. macOS is left out for now: there the - # macOS box (v0.3.0-preview.1, validly signed) was killed as soon as it started after this - # install (`Killed: 9` on `box --version`), so on macOS the Box tests skip and the rest of the - # suite still runs. Re-enable it once a run shows the pinned build starts here. + # the Box tests. They skip on a runner with no box on PATH. - name: Install box - if: matrix.name == 'Linux-arm64' + if: matrix.name == 'macOS' || matrix.name == 'Linux-arm64' env: # The build's key in boxRelease.json, which pins its archive and SHA-256. BUILD: ${{ matrix.name == 'macOS' && 'darwin' || 'linux' }} @@ -166,10 +163,25 @@ jobs: SUM=$(command -v sha256sum || echo "shasum -a 256") echo "${SHA} ${WORK}/${ASSET}" | $SUM -c - # box reads its packs from resources/ beside it, so keep the release together. - sudo mkdir -p /opt/box - sudo tar --no-same-owner -xzf "${WORK}/${ASSET}" -C /opt/box - sudo ln -sf /opt/box/box /usr/local/bin/box - box --version + if [[ "$BUILD" == darwin ]]; then + # On macOS, unpack as the runner user into a folder it owns, as a developer does: the + # signed box was killed at start (Killed: 9) after a sudo unpack into /opt/box. + DIR="${RUNNER_TEMP}/box" + mkdir -p "$DIR" + tar -xzf "${WORK}/${ASSET}" -C "$DIR" + echo "$DIR" >> "$GITHUB_PATH" + # If macOS refuses box, say why before running it. + codesign --verify --strict --verbose=2 "$DIR/box" || codesign -dv --verbose=4 "$DIR/box" || true + if ! "$DIR/box" --version; then + log show --last 2m --predicate 'eventMessage CONTAINS "box"' --style compact 2>/dev/null | tail -40 || true + exit 1 + fi + else + sudo mkdir -p /opt/box + sudo tar --no-same-owner -xzf "${WORK}/${ASSET}" -C /opt/box + sudo ln -sf /opt/box/box /usr/local/bin/box + box --version + fi # Ubuntu 24.04 lets AppArmor stop an unprivileged process from making a user namespace, which # `box run` needs for its sandbox. The runner is a throwaway VM. - name: Allow user namespaces for box @@ -180,7 +192,7 @@ jobs: # repository is private and this job's GITHUB_TOKEN reads only this one, so the token comes # from the repository's GitHub App, scoped to the L3 repository and read-only. - name: Generate a read token for the L3 constructs - if: matrix.name == 'Linux-arm64' + if: matrix.name == 'macOS' || matrix.name == 'Linux-arm64' id: l3-token uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 with: @@ -190,7 +202,7 @@ jobs: repositories: agentcore-l3-cdk-constructs permission-contents: read - name: Check out the L3 constructs - if: matrix.name == 'Linux-arm64' + if: matrix.name == 'macOS' || matrix.name == 'Linux-arm64' uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: aws/agentcore-l3-cdk-constructs @@ -202,7 +214,7 @@ jobs: # Packed onto the runner only: nothing is published. The Box tests install it into each Box # project's agentcore/cdk (AGENTCORE_E2E_BOX_CDK in e2eTest/project/templates.test.ts). - name: Pack the L3 constructs for the Box tests - if: matrix.name == 'Linux-arm64' + if: matrix.name == 'macOS' || matrix.name == 'Linux-arm64' working-directory: .l3-cdk run: | npm ci --no-audit --no-fund diff --git a/e2eTest/README.md b/e2eTest/README.md index a403b5d46..78e07234d 100644 --- a/e2eTest/README.md +++ b/e2eTest/README.md @@ -26,11 +26,9 @@ The `box` tests cover the Strands Box templates, which run their agent in a box. invoke each one on AgentCore Runtime, and run `agentcore dev` with one local invoke for each. They are optional and need a `box` on your PATH: `create` checks for one for a CodeZip box template, and `build` and `deploy` run `box profile show` for every Box template, the container one too. Without -one, they skip. box ships only arm64 builds, so in CI only the Linux arm64 runner -(`ubuntu-24.04-arm`) has one: it installs the box that `src/core/project/backends/boxRelease.json` -pins. The macOS runner (Apple silicon) is left out for now: there the macOS box -(`v0.3.0-preview.1`, validly signed) was killed as soon as it started after the workflow's install -(`Killed: 9`), so the Box tests skip on macOS until a run shows the pinned build starts there. `create` also installs the agent's dependencies +one, they skip. box ships only arm64 builds, so in CI only the macOS runner (Apple silicon) and the +Linux arm64 runner (`ubuntu-24.04-arm`) have one: each installs the box that +`src/core/project/backends/boxRelease.json` pins. `create` also installs the agent's dependencies and the CDK app's, which `dev` and `deploy` use, so the tests don't pass `--skip-install`. The tests that deploy also need `AGENTCORE_E2E_BOX_CDK`: the pinned `@aws/agentcore-cdk` release @@ -38,8 +36,8 @@ cannot deploy a Box project yet. Set it to an `@aws/agentcore-cdk` version or a that can, for example one packed from the `box-integration` branch of [agentcore-l3-cdk-constructs](https://github.com/aws/agentcore-l3-cdk-constructs) with `npm run build && npm pack --ignore-scripts`. The tests install it in the `agentcore/cdk` of each -Box project that deploys. Without it, they skip. In CI, the Linux arm64 runner sets it to a -tarball they build from agentcore-l3-cdk-constructs at the workflow's `l3Ref` input (default +Box project that deploys. Without it, they skip. In CI, the macOS and Linux arm64 runners set it to +a tarball they build from agentcore-l3-cdk-constructs at the workflow's `l3Ref` input (default `box-integration`), checked out with a read-only token from the repository's GitHub App. Remove those steps once a released `@aws/agentcore-cdk` deploys Box projects and the pin is bumped. CI also skips `agent_python_langchain_box` in the deploy tests: its AgentCore Runtime logs hold @@ -65,8 +63,8 @@ The `box-egress` tests check that box lets the agent reach the host its profile on AgentCore Runtime, where the allowed host's calls go through the runtime's Box gateway. The second deploys, so it also needs `AGENTCORE_E2E_BOX_CDK`. They reach public hosts, so the network can make them fail: the dev test retries twice, and the deployed one retries only its invoke. -`--tagsFilter='box'` leaves them out. A full run includes them; in CI they run on the Linux arm64 -runner: +`--tagsFilter='box'` leaves them out. A full run includes them; in CI they run on the macOS and Linux +arm64 runners: ```sh bun run test:e2e -- --tagsFilter='box-egress' From d73bfecc255373b53977d24bf8a3d4b030e3f667 Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Tue, 24 Nov 2026 14:27:19 -0800 Subject: [PATCH 4/4] fix(e2e): Unpack the macOS box into a folder not named box macOS reads a folder named box that holds the executable box as a bundle, so codesign reports the signed box as invalid (Info.plist not bound) and macOS kills it at launch. That is why the macOS box was killed under /opt/box/box and, in the last run, $RUNNER_TEMP/box/box, while the same file runs from a folder with another name. The e2e workflow now unpacks it into $RUNNER_TEMP/box-, and the local testing guide warns against a folder named box. --- .github/workflows/e2e-test.yml | 8 +++++--- docs/box-local-testing.md | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 259930608..35737bbcf 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -164,9 +164,11 @@ jobs: echo "${SHA} ${WORK}/${ASSET}" | $SUM -c - # box reads its packs from resources/ beside it, so keep the release together. if [[ "$BUILD" == darwin ]]; then - # On macOS, unpack as the runner user into a folder it owns, as a developer does: the - # signed box was killed at start (Killed: 9) after a sudo unpack into /opt/box. - DIR="${RUNNER_TEMP}/box" + # On macOS, unpack as the runner user into a folder it owns, as a developer does. The + # folder must not be named `box`: macOS reads a folder `box` that holds an executable + # `box` as a bundle, finds the signature invalid (`invalid Info.plist`), and kills box at + # launch (Killed: 9). That is what happened under /opt/box. + DIR="${RUNNER_TEMP}/box-${VER}" mkdir -p "$DIR" tar -xzf "${WORK}/${ASSET}" -C "$DIR" echo "$DIR" >> "$GITHUB_PATH" diff --git a/docs/box-local-testing.md b/docs/box-local-testing.md index 4c0a68d9d..c18b8d1f1 100644 --- a/docs/box-local-testing.md +++ b/docs/box-local-testing.md @@ -67,7 +67,9 @@ Linux x86_64 (`x86_64-unknown-linux-gnu`). The release's `box-v-*` arch without its packs; do not use them. Each `box-cli` archive unpacks flat: `box`, its two helpers, `release.json`, and `resources/` (box's packs, which it finds beside itself). -Download the archive for your machine, check it, and unpack it into a versioned folder. +Download the archive for your machine, check it, and unpack it into a versioned folder. On macOS, do +not unpack it into a folder named `box`: macOS reads a folder `box` that holds the executable `box` as +a bundle, reports its signature as invalid (`invalid Info.plist`), and kills box at launch. macOS on an Apple chip: