osfd runs git in a worktree as itself: a hook an agent plants runs outside the sandbox #493
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
osfd commits, checkpoints and diffs in a run's worktree, whose
.gitthe agent writes. Apost-commithook runs throughgit commit --no-verify, andcore.fsmonitorruns ongit add(measured for braid#203's first draft). Both run as osfd, outside the fence and the sandboxes. A push also reads the worktree's own git configuration while it carries the forge token.Fix
The first draft's design: every git command osfd runs in a worktree goes through that worktree's sandbox, and a push takes the run's commits as a bundle into a repository osfd owns, so no configuration an agent wrote is read with the token in reach.
Done when
A test plants a hook and an fsmonitor that copy a token file set up outside: both run and neither finds the file; and a worktree carrying
url.<forge>.insteadOfstill lands its commit on the forge.Split from braid#203 by the owner's decision, 2026-11-11.
Shipped in pull request 566 (change
sandbox-edges-493-532).gitwrapper first on its ownPATH. Each git command whose directory, repository, worktree or index is in a run's folder runs in a one-off bubblewrap: the run's worktrees and.gitread-write, its repository copy read-only, the image less Braid's program, no network. A forge address or a token there is refused.OSF_PYTHONis a launcher with-P.Evidence: in the image, a planted
post-commithook andcore.fsmonitorboth ran during osfd's add and commit, and both failed to read a token file set up outside the run (No such file or directory); the commit was made. A medium test shows a worktree withurl.<forge>.insteadOfand apre-pushhook landing its commit on the forge with the hook never run. The wrapper costs about 28 ms a git command.On production since
19a75bd: osfd installed its git wrapper at boot, and the deploy's self-check passed its 6 simulated runs (git-flow among them) in the image, fenced. Archived in pull request 568.