Skip to content

Does the git round trip work, and what keeps the guest's pushes on its own branches?

Answered 2026-10-04. Decided 2026-10-04: A, Go filter plus receive.hideRefs. Source: 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…). Changes 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. and S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq…. Feeds 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:.

host: trustedyour repositoryall branches, tagsexport.gitsession branch onlylanding.gitwb/<session>/*wb-hostdheader checkupload-pack, read-onlyref filter (Go)receive-pack, strict fsckguest, untrustedgit-remote-wbclone, fetch, pushborrowsfetch by IDpush to main

Figure 1. The round trip 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.. The guest reaches only wb-hostd. Fetches come from the export repository, so a fetch by ID from your repository (red, top) has nothing to reach. Pushes pass a Go ref filter before git parses them, so a push to main (red, bottom) stops there. The landing repository borrows objects from the export repository. A push then sends only new objects.

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. said refs are “restricted to refs/heads/wb/<session-id>/*” without saying what restricts them. 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: left this to the spike.

A. Go filter, git’s hidden refs behind it

Section titled “A. Go filter, git’s hidden refs behind it”

wb-hostd reads the list of refs a push wants to update before git sees it, and refuses the whole push if any ref is outside the session’s branches. Git’s receive.hideRefs setting checks the same thing again.

What B41-git-data-scopeB41-git-data-scope: Which git data may reach the guest, and how far does the host trust its own git?Serve the guest from a host-side export repository holding only the session's branch, scan carried-in files, clean remote URLs, and require a minimum git version. recommended for item 5: receive.hideRefs hides everything but the session’s branches, and git refuses a push to a hidden ref.

Replace receive-pack with a Go implementation (for example go-git), so host git never parses guest packs.

RequirementA. Filter and hidden refsB. Hidden refs aloneC. Go receive
FR03-work-as-branchFR03-work-as-branch: Work returns as a branchThe agent never writes to the host working tree. work returns as a branchonly session branchesaccepts the bare session refonly session branches
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. returned work runs nothing on the hosthooks off, strict fscksamechecks to rebuild
SEC10-auditSEC10-audit: AuditEvery egress decision, approval, and returned change is recorded on the host in a persisted log the guest cannot alter. returned changes recordedper-ref logparse git outputper-ref log
NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it. refusals name the rulenames the prefix”hidden ref”own message
NFR07-maintainabilityNFR07-maintainability: MaintainabilityMost code is cross-platform Go. fuzzing for every parserone new fuzz targetno new parsera whole pack parser
  • verified Clone, incremental fetch and push through git-remote-wb over a socketpair, Go repository (679,335 objects, 426 MiB), git 2.56.0 and Apple git 2.54.0. First clone 16.3 s median through the tunnel, against 17.1 s for a local clone without it. A fetch of 200 new commits 0.6 s, a 3-commit push 0.1 s. Source: 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., “Measurements”, and results/run1.txt to run6.txt on the spike branch.
  • verified Protocol v2 upload-pack with uploadpack.hideRefs and every allow*SHA1InWant off served three unadvertised objects by ID. The export repository refused them on the server side under v2. The guest’s own git client refused to send the v0 request, so the server side under v0 against a hostile client wasn’t tested. Source: results/run2.txt and run3-apple.txt, “Hidden data”.
  • verified The Go filter refused pushes to main, a tag, another session, a lookalike session S10, the bare session ref, deletes, and a mixed push, with landing unchanged in every case. Source: results/run5.txt and run3-apple.txt, “Push abuse”.
  • verified receive.hideRefs alone created refs/heads/wb/S1 from a push to that name (one run, Homebrew git, results/run5.txt), and applied the allowed ref of a mixed push (run3-apple.txt, run5.txt).
  • verified Strict fsck refused trees with .git, .GIT, git~1, .., symlinked .gitmodules and .gitattributes, mode 100666, a bad commit date, and a .gitmodules URL starting with -. Garbage, truncated and bit-flipped packs were refused. Your repository’s files were unchanged across the raw protocol attacks. Source: results/run3-apple.txt, “Push abuse” and “Raw protocol abuse”.
  • verified Push commands sent to upload-pack ended in a protocol error, and wb-hostd refused other services, extra arguments and bad protocol values before running git. Source: results/run3-apple.txt, “Raw protocol abuse”.
  • verified The flagger flagged 2% of 400 Go commits, 17% of 400 Express commits and 51% of 43 Wraith Box commits, at 11 to 18 ms per commit. Source: results/run2.txt, “Risky-path flagger”.
  • inferred v2 upload-pack also serves objects from a borrowed object store, since it served an unreferenced object (results/run2.txt), though no run tried a borrowed store. So the export repository stores a copy of every object it serves.
  • assumed That vsock behaves like the socketpair: a byte stream with half-close. X18-vsock-handoffX18-vsock-handoff: Host-guest socket and descriptor hand-offCan wb-guestd, written in Go, open AFVSOCK sockets in a macOS guest? tests vsock in a macOS guest.
Details and glossary

Why a filter and not only git. Git checks hidden refs after it has read and unpacked the pack, one ref at a time. The filter reads only the short list of refs at the start of the push, so a refused push never reaches git’s pack parser, and the refusal names the session’s prefix. Keeping receive.hideRefs as well means a bug in either layer alone does not open the landing repository.

Why the landing repository borrows. Git sends what the receiving side doesn’t have. An empty landing repository has nothing. The guest then sends the project’s whole history on its first push. With the export repository listed as an alternate object store, the landing repository already has that history. Garbage collection on the export repository must then keep what landing branches still use (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 6).

Glossary

  • Remote helper: a program git runs to reach a remote it has no built-in transport for. git-remote-wb handles wb:: URLs.
  • connect capability: the helper only opens a byte stream to the remote git program and copies bytes both ways.
  • Pkt-line: git’s framing: a 4-digit hex length, then the data.
  • Command list: the lines at the start of a push that say which ref moves from which commit to which.
  • fsck: git’s object checker.
  • Alternates: a list of other object stores a repository may read objects from.
  • Socketpair: two connected sockets in one machine, used here in place of vsock.