Which git data may reach the guest, and how far does the host trust its own git?
Decided 2026-10-04: A. Export repository. The decision and its reasons are in the I41I41 (closed): S08-workspace-and-git: which git data reaches the guest, and host git as a parserS08-workspace-and-git says how bytes move, but not which data the guest may get or how much the host trusts its own git when it parses guest data: comment that starts Decision (2026-10-04):. Source: I41I41 (closed): S08-workspace-and-git: which git data reaches the guest, and host git as a parserS08-workspace-and-git says how bytes move, but not which data the guest may get or how much the host trusts its own git when it parses guest data:, item 5 waits on X07-git-round-tripX07-git-round-trip: Git round tripRemote helper over vsock, read-only upload-pack, restricted receive-pack into the landing repository, flagging of risky paths. (I21I21 (closed): X07-git-round-trip: Git round tripDoes the git round trip work as S08-workspace-and-git describes: a remote helper over vsock, read-only upload-pack against the user's repository, restricted receive-pack into the landing repository, and flagging of…). Affects S05-cliS05-cli: Command Line InterfaceSpecify wb, the single user-facing command. and S08-workspace-and-gitS08-workspace-and-git: Workspace and Git Round TripHow code gets into the guest and how the agent's work gets back out, without sharing the host filesystem.. Note 2026-10-04: X07-git-round-tripX07-git-round-trip: Git round tripRemote helper over vsock, read-only upload-pack, restricted receive-pack into the landing repository, flagging of risky paths. answered item 5 with a Go filter on the command list, and receive.hideRefs as a second layer only (B21-git-round-tripB21-git-round-trip: Does the git round trip work, and what keeps the guest's pushes on its own branches?Yes, with conditions.). Note 2026-10-06: the decision is now in S08-workspace-and-gitS08-workspace-and-git: Workspace and Git Round TripHow code gets into the guest and how the agent's work gets back out, without sharing the host filesystem., see “The spec change” below.
The problem
Section titled “The problem”Figure 1. Both directions of the git round trip in S08-workspace-and-gitS08-workspace-and-git: Workspace and Git Round TripHow code gets into the guest and how the agent's work gets back out, without sharing the host filesystem.. Into the guest, upload-pack serves your repository, and the guest can ask for more than the branch it works on (red). Out of the guest, your own git parses packs the guest built, and later fetches them into your repository at wb land.
The spec change
Section titled “The spec change”What the decision became in S08-workspace-and-gitS08-workspace-and-git: Workspace and Git Round TripHow code gets into the guest and how the agent's work gets back out, without sharing the host filesystem., with the details the table below left open:
- Item 1, “Export repository”: a session selects the branch your
HEADpoints to and the refs you list inexport_refsin the project’s host settings, matched by exact name. Repository-supplied configuration can’t add a ref.export.gitkeeps the selection of every live session underrefs/wb/session/<session-id>/, a detachedHEADincluded, so parallel sessions keep their bases. A session stops being live when it ends, whether or not it is discarded. A guest can still fetch other live sessions’ bases by ID, and keeps what it fetched, which T12-shared-exportT12-shared-export: Sessions of a project share what they can fetchA project's export.git holds the refs that any live session of the project selected (S08-02-export-repository). records. Reading I67I67 (closed): wb-hostd can't read the user's repository under its sandbox profile (S08 upload-pack)Found in the review of #65 (X23-sandboxed-daemons result).’s decision as written,wbfetches from your repository intoexport.gititself and is its only writer, andwb-hostdonly serves it to the guest.uploadpack.hideRefsonly trims the advertised list. It isn’t access control. - Item 2, “Carry-in scan”:
wbscans the new content of each changed file, from the index and the working tree, and each untracked file. A symbolic link goes in as a link, and other special files are skipped. The size cap applies first. A file that matches, or thatwbcan’t read, is skipped whole, and a tracked one keeps itsHEADversion in the guest. The summary names the reason or the scanner rule, never the matched text. With no scanner chosen, or when it fails, the guest gets none of the carry-in. FR04-carry-inFR04-carry-in: Uncommitted changes carried inUncommitted host changes (staged, unstaged, untracked-not-ignored) are carried into the session at start. names these exceptions. - Item 3, “Remote URLs”:
wbreads every URL of each remote after yourinsteadOfrules, and removes the user name, password, query, and fragment. SSH remotes becomehttps://host/pathwithout the port. Every other scheme, an IP-literal host, and a URL that doesn’t parse are withheld, and the summary says so. Nothing else from the repository’s configuration reaches the guest. Project identity stays with I42I42 (closed): S05-cli, S06-vm-lifecycle, S09-policy-credentials-audit: separate configuration trust from VM placement; project identityThe specs use "trusted" for two different things and do not give a default:. - Item 4, “Host git”:
wbandwb-hostdtake git from<config>or a fixed platform path, neverPATH, andwbnever runs a binary or fetches from a path thatwb-hostdnames. The minimum is git 2.54.0, the oldest the spikes ran, and a release candidate of it counts as below.wb landchecks every object it fetches. - Item 6, “Repository lifecycle”: git’s own automatic garbage collection is off in both repositories.
wb discarddeletes the session’s refs and guest worktree, andwb landkeeps them. The landing cap is 4 GiB per project, settable, checked before each push against the current size plus the worst case of one push. When a ref leaves the selection,landing.gitfirst copies the objects its branches still need, and thenexport.gitis pruned, so a later session can’t fetch the removed ref’s objects by ID.
Sub-decisions
Section titled “Sub-decisions”The issue bundles six items. Item 1 is a real fork, with options below. The rest have one recommendation each.
| Item | Recommendation | Now or later |
|---|---|---|
| 1. Ref scope | A below: an export repository with only the HEAD branch and refs the user adds in project settings. |
now |
| 2. Untracked files | Scan carried-in untracked files, and the staged and unstaged diff, with the image-seal secret scanner (S06-vm-lifecycleS06-vm-lifecycle: VM Lifecycle, Images and the Guest AgentHow guest images are built, how VMs are kept warm, how projects and sessions map onto guests, and what wb-guestd does.). Skip a file that matches and list it in the session summary, as for oversize files. | now |
| 3. Remote URLs | Strip user names, passwords and query strings from every URL that reaches the guest. Rewrite SSH remotes to HTTPS for the guest, shared with I47I47 (closed): S07-egress-gateway: non-HTTP streams, SSH remotes and ECHS07-egress-gateway describes TLS and HTTP.. | now |
| 4. Host git | Require a minimum git version, checked by wb setup and at each session start. Keep receive.fsckObjects and receive.maxInputSize. Don’t bundle git (GPL-2.0, against the license rule of S10-tech-stackS10-tech-stack: Technology ChoicesFix languages, libraries, packaging, and repository layout, with the reason for each choice.). A receive side in Go is a later option. |
now |
| 5. Ref restriction | receive.hideRefs set to hide everything but refs/heads/wb/<session-id>/. A Go filter on the command list is optional on top. |
after X07-git-round-tripX07-git-round-trip: Git round tripRemote helper over vsock, read-only upload-pack, restricted receive-pack into the landing repository, flagging of risky paths. |
| 6. Landing lifecycle | wb discard deletes the session’s refs and guest worktree. wb-hostd runs git gc on the landing repository after land and discard. A size cap per project, refused with an explanation (SEC13-bounded-resourcesSEC13-bounded-resources: Bounded resourcesCPU, memory and disk of each VM are capped., NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it.). |
now |
Options for the ref scope (item 1)
Section titled “Options for the ref scope (item 1)”Impact
Section titled “Impact”Items 2 to 6 strengthen SEC03-no-host-execSEC03-no-host-exec: No host code execution via returned workNothing the agent produces executes on the host without an explicit user action; returned changes to files the host may later execute are flagged., SEC04-no-guest-secretsSEC04-no-guest-secrets: No secrets in the guestThis includes the model credential., SEC06-repo-writesSEC06-repo-writes: Repository-scoped writesGit pushes and repository-mutating API calls are allowed only for the repositories of the projects that have a session in the VM. and SEC13-bounded-resourcesSEC13-bounded-resources: Bounded resourcesCPU, memory and disk of each VM are capped., and weaken nothing.
Evidence
Section titled “Evidence”- verified
upload-packwithout extra configuration advertisedHEAD, both branches,refs/notes/commitsand a tag (git 2.56.0, local test). - verified With
uploadpack.hideRefs=refs/and!refs/heads/main, onlyHEADandmainwere advertised, under protocol v0 and v2. - verified Under the same hiding, a fresh repository fetched the hidden branch’s commit by its ID over protocol v2. Over protocol v0 git answered “Server does not allow request for unadvertised object”.
- verified git: “it’s best to keep private data in a separate repository” (
git help config,uploadpack.allowTipSHA1InWant), and the attacks ingitnamespaces(7), “SECURITY”. - verified
receive.hideRefsrestricted pushes torefs/heads/wb/s1/with hooks off (core.hooksPath=/dev/null) andreceive.fsckObjects=true(git 2.56.0, local test). - verified
git ls-files --others --exclude-standardlists a newcredentials.json, the set FR04-carry-inFR04-carry-in: Uncommitted changes carried inUncommitted host changes (staged, unstaged, untracked-not-ignored) are carried into the session at start. carries in. - verified This Mac has Apple git 2.54.0 (Apple Git-157) in
/usr/binand Homebrew git 2.56.0. Upstream’s newest tag isv2.56.0. - verified git is GPL-2.0 (
COPYINGin the Homebrew git package), so shipping it with Wraith Box conflicts with S10-tech-stackS10-tech-stack: Technology ChoicesFix languages, libraries, packaging, and repository layout, with the reason for each choice.. - verified
git remotelists remotes alphabetically, not in the order they were added (local test). - verified The same git behavior holds through
git-remote-wbover a socketpair standing in for the host-guest socket, and with Apple git 2.54.0, except thatreceive.hideRefsalone also accepts the bare session ref (X07-git-round-tripX07-git-round-trip: Git round tripRemote helper over vsock, read-only upload-pack, restricted receive-pack into the landing repository, flagging of risky paths., B21-git-round-tripB21-git-round-trip: Does the git round trip work, and what keeps the guest's pushes on its own branches?Yes, with conditions.). - assumed That the image-seal scanner is precise enough for working trees without too many false hits. No scanner is chosen yet (S06-02-image-buildS06-02-image-build: Image BuildHow wb image build makes a guest image: the build VM, its two provisioning stages, terminfo, sealing, and storage., “Sealing”).
What this unblocks
Section titled “What this unblocks”- Now: the S08-workspace-and-gitS08-workspace-and-git: Workspace and Git Round TripHow code gets into the guest and how the agent's work gets back out, without sharing the host filesystem. pull request for items 1 to 4 and 6, and the SSH rewrite shared with I47I47 (closed): S07-egress-gateway: non-HTTP streams, SSH remotes and ECHS07-egress-gateway describes TLS and HTTP..
- Waits on X07-git-round-tripX07-git-round-trip: Git round tripRemote helper over vsock, read-only upload-pack, restricted receive-pack into the landing repository, flagging of risky paths. (I21I21 (closed): X07-git-round-trip: Git round tripDoes the git round trip work as S08-workspace-and-git describes: a remote helper over vsock, read-only upload-pack against the user's repository, restricted receive-pack into the landing repository, and flagging of…): item 5, whether
receive.hideRefssuffices through the remote helper or a Go filter is also needed. - The git round trip in V1-M4-claude-end-to-endV1-M4-claude-end-to-end: `wb claude` end to endGit round trip with carry-in, landing and flagging, the model credential, the terminal records and the session summary, wb diff and wb land, on a sealed image..
Details and glossary
Why the guest can name a hidden commit. The ID of a commit is in plain sight more often than it seems: cherry-picks with -x, reverts (“This reverts commit …”), issue comments, CI logs. With protocol v2 the guest asks for that ID and receives the commit with its whole history, unless the object isn’t in the served repository at all, which is what an export repository ensures.
Why a minimum version. Each receive-pack parses packs the guest built, and wb land later runs your own git against them. Git has had security fixes in these code paths, and Apple’s git ships them later than upstream. wb setup names the git it uses and refuses one below the minimum, with the reason.
Glossary
- Ref: a name for a commit, such as a branch (
refs/heads/main), a tag, a note, or the stash. - Advertise: the list of refs the serving side offers at the start of a fetch.
upload-pack/receive-pack: the host-side git programs that serve a fetch and accept a push.- Pack: the compressed bundle of objects that a fetch or push transfers.
- Protocol v0 / v2: git’s older and newer wire protocols. v2 is the default.
- Landing repository: the bare repository in Wraith Box’s state that receives the guest’s pushes (S08-workspace-and-gitS08-workspace-and-git: Workspace and Git Round TripHow code gets into the guest and how the agent's work gets back out, without sharing the host filesystem.).
- Userinfo: the
user:token@part of a URL.