| 1 | # Offline Go for Engineering |
| 2 | |
| 3 | Paul approved this containment change on 2026-11-13. Engineering needs to run |
| 4 | targeted tests and repository gates before Equipo publishes its candidate. |
| 5 | |
| 6 | Claude and Codex Engineering launches mount the runner's configured Go tree at |
| 7 | `/opt/go` and module cache at `/opt/go-mod`, both read-only. They use the same |
| 8 | sources as Checks. A missing module-cache directory omits that mount, including |
| 9 | for non-Go projects; an existing invalid or symlinked source is refused. |
| 10 | `EQUIPO_GO_MODULE_CACHE` remains an optional override. Review keeps its existing policy; Pi Review has no shell, |
| 11 | and changing its tools would extend this work beyond adding read-only trees. |
| 12 | |
| 13 | The shared Go environment sets `GOPROXY=off`, `GOSUMDB=off`, |
| 14 | `GOTOOLCHAIN=local`, `GOFLAGS=` and `CGO_ENABLED=0`. `GOROOT` and `GOMODCACHE` |
| 15 | name those mounts. `GOCACHE` and `GOTMPDIR` are directories under the attempt's |
| 16 | private `/tmp`, backed by the runner's scratch directory and removed with the |
| 17 | attempt. Claude uses `/tmp/claude-${uid}/go-build` and `go-tmp`, under its |
| 18 | `CLAUDE_CODE_TMPDIR=/tmp` temp root. Codex uses `/tmp/go-build` and `/tmp/go-tmp`. |
| 19 | `GOENV` and `GOWORK` are off, as is telemetry. Provider launches receive no |
| 20 | `XDG_CONFIG_HOME`; Git's global config is `/dev/null` and system config is |
| 21 | disabled. `PATH` is `/opt/go/bin:/usr/bin:/bin:/opt`, including the pinned |
| 22 | bubblewrap helper. Repository Makefiles that override the toolchain version need |
| 23 | `GOTOOLCHAIN=local` on the make command line. |
| 24 | |
| 25 | ## Bounds and pins |
| 26 | |
| 27 | This adds the same two readable trees Checks already mount. Engineering's |
| 28 | workspace remains writable. The provider shell policies still deny credential |
| 29 | homes, provider credentials, the forge credential, runner state and tool |
| 30 | sockets, and allow writes only in the workspace and private temporary space. |
| 31 | The outer namespace still has no host network. Provider processes retain |
| 32 | only their existing provider relay; Claude and Codex shell commands retain |
| 33 | their own network isolation. No sandbox setting or permission callback is |
| 34 | relaxed. Native file tools still obey their existing path restrictions. |
| 35 | |
| 36 | Engineering hashes the Go root once for the launch's account lease. Paths, |
| 37 | modes and file bytes enter the policy's file-digest list. Validation, adapter |
| 38 | policy rebuilds, source attestation and containment reuse that digest and the |
| 39 | same retained directory descriptor. The lease closes it on cleanup; containment |
| 40 | owns a duplicate until its mount plan closes. Replacing the source path does |
| 41 | not substitute a different tree. Symlinks inside the Go root and special files |
| 42 | are refused. The configured root must be canonical: a symlinked distro Go root |
| 43 | is refused by the provider policy, so configure its resolved directory. |
| 44 | |
| 45 | The module cache is pinned by path, opened without following symlinks, owned by |
| 46 | the runner user and bound read-only through a retained descriptor using |
| 47 | `--ro-bind-fd`. Trees cannot overlap scratch, workspace or protected paths, or |
| 48 | contain the runner's home. The module cache is never content-hashed. Checks |
| 49 | keep their previous path pins and containment traversal, with no content scan |
| 50 | of either tree. On this box, hashing the pinned Go 1.26.11 root took 1.137 seconds; |
| 51 | hashing the 14 GB module cache previously took 90.096 seconds. |
| 52 | |
| 53 | Agents cannot write the mounted trees. Host processes running as the runner |
| 54 | user are already trusted; they could replace the runner binary itself. They |
| 55 | can also update the live source trees. No snapshot or dedicated quiescent cache |
| 56 | is required. Adding modules leaves the policy hash unchanged. The adapter |
| 57 | compares its rebuilt policy and manifest hashes with the supplied policy; |
| 58 | source validation compares the Go root's recorded digest with the lease's pin. |
| 59 | No certificate is compared against a new module-cache content digest. |
| 60 | |
| 61 | Engineering can read every cached module, including private modules from the |
| 62 | owner's other projects. Paul accepts this for v1 on a single owner's runner. |
| 63 | Per-project caches remain later work for multi-person teams. |
| 64 | |
| 65 | ## Shell evidence and limits |
| 66 | |
| 67 | The offline build test invokes the real pinned Codex sandbox with filesystem |
| 68 | and network permissions generated by `codex.PolicyInputs`. Claude 2.1.312 has |
| 69 | no offline command or exported API for invoking its bundled sandbox builder. |
| 70 | Its test therefore reproduces the namespace setup, consumes generated |
| 71 | filesystem settings, and grants only the working directory and its own temp |
| 72 | directory. It does not grant all of `/tmp`. In the pinned executable, byte |
| 73 | 239371446 selects `CLAUDE_CODE_TMPDIR`, byte 239373000 derives `claude-${uid}`, |
| 74 | bytes 244230927 and 244231106 resolve temp paths, and byte 246036346 adds the |
| 75 | working directory and those paths to the write grants. These probes make no |
| 76 | provider calls and do not replace provider release certification. |
| 77 | |
| 78 | Both the shell probe and a Go-built probe fail to read the CLI's token through |
| 79 | process files. Each has a direct control that can read the synthetic token's |
| 80 | variable; neither prints its value. Claude's `failIfUnavailable`, fresh PID |
| 81 | namespace and token scrubbing remain required. Weaker nested sandbox settings |
| 82 | are not enabled. The historical Bash failure still lacks a raw tool response. |
| 83 | |
| 84 | The real Codex sandbox, using generated Engineering permissions, refuses writes |
| 85 | to `/workspace/.git/config`. Claude's pinned shell builder protects `.git/config` |
| 86 | and hooks (bytes 245813355 and 245845913). Its internal Git calls also neutralize |
| 87 | executable config features: status arguments clear `core.fsmonitor` near byte |
| 88 | 239543350, and the Git helper at byte 240094865 disables hooks, fsmonitor, |
| 89 | askpass and external protocols. Equipo's native file permission callback can |
| 90 | allow a workspace config write; the shell test does not prove native-tool |
| 91 | behavior. No route from that write to execution beside a real CLI token was |
| 92 | established. A generic unsandboxed Git invocation would be vulnerable, but that |
| 93 | is not evidence that either pinned CLI uses such an invocation. No additional |
| 94 | Git configuration restriction is added in this branch. |
| 95 | |
| 96 | An unversioned cache miss reports `module lookup disabled by GOPROXY=off`. |
| 97 | For an explicitly required missing version, Go first tries to create a cache |
| 98 | lock. It prints “downloading” and then fails with `read-only file system`; |
| 99 | that progress line does not mean it fetched anything. Both cases are tested. |
| 100 | The implementation does not wrap Go or rewrite its diagnostics. |
| 101 | |
| 102 | Pi's current policy is different: the connectors spec, section 2.1, explicitly |
| 103 | allows its Bash commands to read its provider key and use the provider-only |
| 104 | relay. A read-only toolchain mount cannot provide the requested token and |
| 105 | network isolation there. Pi toolchain access awaits Paul's decision on whether |
| 106 | to preserve that existing exception or first provide an isolated Pi shell. |
| 107 | |
| 108 | No wire protocol or database schema changes are needed. Older binaries reject |
| 109 | these directory file-digest entries rather than silently accepting the new |
| 110 | policy. Roll back by installing the previous versioned release and using its |
| 111 | matching certificates; Engineering then loses these Go mounts. No data needs |
| 112 | downgrading. Existing certifications are not regenerated by these offline tests. |
| 113 | |