No description
  • Go 99.4%
  • Just 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Viktor Varland febe18c577
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/release Pipeline was successful
docs: changelog for v0.4.0
2026-11-02 13:36:19 +01:00
.just chore: sync the files wrangle manages 2026-10-29 09:54:16 +01:00
.woodpecker chore: sync the files wrangle manages 2026-10-29 09:54:16 +01:00
docs feat: show each key's origins and header in --dry-run 2026-11-02 13:31:23 +01:00
e2e feat: show each key's origins and header in --dry-run 2026-11-02 13:31:23 +01:00
internal fix: say when a key is bound to a host on the other scheme 2026-11-02 13:31:18 +01:00
.gitignore feat: read policies strictly, with subcommand tables and brig's shipped ones 2026-10-29 09:20:10 +01:00
CHANGELOG.md docs: changelog for v0.4.0 2026-11-02 13:36:19 +01:00
check.go fix: keep brig check --json --against's stdout to the JSON 2026-10-30 13:25:32 +01:00
go.mod feat: bump bulkhead to v0.3.0, so a run cannot change metadata outside its write rules 2026-10-30 12:35:52 +01:00
go.sum feat: bump bulkhead to v0.3.0, so a run cannot change metadata outside its write rules 2026-10-30 12:35:52 +01:00
justfile chore: sync the files wrangle manages 2026-10-29 10:29:41 +01:00
main.go feat: run the sandbox on bulkhead, brig's plan made its spec 2026-10-29 19:55:15 +01:00
policy.go feat: let a policy put a key in another variable, with as 2026-10-30 13:47:42 +01:00
README.md feat: keys in a direct run, and gh through its socket 2026-10-29 11:22:58 +01:00
run.go feat: show each key's origins and header in --dry-run 2026-11-02 13:31:23 +01:00

brig

Runs one command with what it needs, and nothing else of yours. Its secrets are delivered so that it holds as little of them as the tool allows; and when you think a command is iffy, it runs in a sandbox that exists only for it, driven by a policy that says what the command needs.

Status: being built. The policies, the plan, brig check, the Linux sandbox with its proxy and ports, and keys injected — by proxy or gh's socket, into a sandboxed run or a direct one, from locker's cred brig — are in. A run that needs what is not built yet — a key by file, an ssh agent, macOS — is refused, with exit 125. The design is docs/design.md.

Usage

brig -- npm ci                     # npm's policy: its outputs, the registry, its token injected
brig -- npm publish                # npm.publish's: still sandboxed, PUT allowed
brig -p 5173 -- npm run dev        # and a port it may serve
brig -n api.example.com -- ./fetch.sh
brig -d -- gh pr list              # direct: no sandbox, the token injected
brig --dry-run -- npm ci           # what it would do (--json)
brig policy npm publish            # a policy in force
brig check                         # prove the sandbox on this machine

Everything after the command word, or after --, is the command's. A command named like one of brig's own (check, policy, version) runs after --.

Exit status

The command's own, or 128 plus the signal that ended it. brig's own, as env(1) has them:

Status Meaning
125 brig would not, or could not, run the command as asked — a refusal, a policy that does not read, a sandbox it cannot make — with a line saying why
127 the command was not found
2 brig was called wrong: a bad flag, no command

Proving the sandbox

Two suites, each one command, run on the host from a plain terminal — not inside claudia, where no sandbox can be made:

brig check                         # every probe, directly and under brig
go test -tags e2e ./e2e            # a built brig, run as you would

brig check runs each probe directly first, where it must get through — so a probe that cannot see what it aims at here is skipped, not passed — and then under brig, where it must be refused. Controls must get through under brig too, so a sandbox that refuses everything cannot pass. The probes are the same on every platform, one that does not apply being n/a, so two machines compare line by line:

brig check --json > nikki.json     # on Linux
brig check --against nikki.json    # on the Mac: where the two differ

Unit tests, go test ./..., cover every decision that is not a syscall, and run anywhere.