Git guardrails (part 2)
The guard rules git-guardrails gained after launch, each dated and named, from the first September additions through the 2026-10-23 shared-store protections — the running record of what the guard blocks today, kept as a continuation of part 1.
On this page
What it is
This is part 2 of the Git guardrails page. It carries the guard rules added after launch, each dated and named after what it refuses, moved here because a single page is capped at 40,000 characters. Read them together with the launch rules on part 1 to see the whole set the guard enforces today.
Where to find it
Nothing on this page is a surface — part 1 covers pausing the guard, what it blocks at launch, the escape hatches and the limits. What follows is the running list of rules added afterwards, in the order they landed.
How it behaves
One more, added 2026-09-03
#13 — a shell command too long to reach the shell. On Windows, the shell Claude Code uses
silently throws away everything past about 8,186 bytes of a single command. It does not warn and
it does not fail — it just runs a shorter command than the one you sent. When the cut lands
inside a quote (it almost always does), the shell then reports unexpected EOF while looking for matching ' at a line number where nothing is wrong, so the error blames your quoting for a
problem that is really about size. That one misleading message accounted for 124 reports on the
friction ledger; agents spent hours rewriting quotes and swapping heredoc markers chasing a bug
that was never there.
The guard now catches it first and says what actually happened, with your command's real byte
count and the limit. Two things make a command bigger than it looks, and both are in the message:
each apostrophe costs 4 bytes rather than 1 (of the way the command is wrapped), and an em-dash
or curly quote costs 3 — which is why a page of prose fails sooner than its length suggests.
Write file content with the Write tool instead of a cat <<EOF heredoc, or split the command up.
No escape hatch lifts this one — not advisory mode, not an excluded repo, not the approval window. Nothing can make the shell accept more bytes than it accepts, so letting the command through would only restore the silent truncation. It applies to Bash on Windows only.
It is not alone in that, so do not read it as the single unliftable rule. Three separate lists in
the code decide this: long-shell-command, raw-fleet-mutation,
destructive-remote-mutation (the git remote rule, #16 below), whole-tree-staging (a
git add -A / git add ., or any pathspec word or exclude-only run that stages the same tree — #29),
empty-branch-config-write (a config write naming an empty branch), the two process-stop rules
pattern-selected-stop and app-tree-stop (#17 and #18 below), the two repository-store rules
delete-git-store and reinit-existing-repo (#19 and #20 below), raw-git-rebase (a raw
git rebase replay typed in a shell — contention the git-rebase cap cannot count), auth-artifact-write (a write, move or delete of the permission files themselves — see the override section below),
foreign-worktree-write (a write into someone else's worktree),
own-seat-write (on a shared cloud machine, a write into — or a HEAD move of — a checkout that is
not this session's own seat; it fires only under AMC_CLOUD_SESSION_BOX=1),
main-checkout-patch-road-write (on a computer whose agents take the patch road, an Edit, Write
or shell file write into the main checkout the app builds from — change a copy in your scratch folder
and hand master's patch launcher a diff instead; a cd "$AMC_SESSION_TMP" before the write is
read as your scratch folder, and a folder the guard cannot work out is never taken for the main checkout),
owner-order-key-secret-tool (reading or planting the owner-order key through the owner's own
secret scripts — the harm is the read itself), crew-pr-publish (a crew helper creating, readying
or merging a pull request — gh pr create|ready|merge, or a writing gh api call on a pull request
— unless a human approval window is open, an owner push approval names that
exact branch and commit (a create only), or a standing owner approval is recorded for the helper's
crew (a merge needs the approval to name merge explicitly); leaving the crew never restores the right
— and it reads the command through the ONE command parser, so a timeout N, env, nice, npx,
cross-env, leading VAR=value, subshell or brace-group prefix does not hide a publish; a wrapper
the parser cannot place is refused rather than guessed past), the five shared-store
rules store-rewrite-verb, store-rewrite-config, protected-ref-delete, nonhead-ref-delete and
git-dir-write (#23 to #26 below — one way past them, a person's one-time approval),
no-squash (squashing is banned outright — a squashed copy returns from GitHub as a stranger and
re-merges as a conflict forever), local-master-fetch (a bare git fetch, any git pull and
git remote update, but ONLY on a machine whose work lands on local master — see #27),
master-key-print (printing or capturing the app's own master key outside the one command shape
that legitimately sends it; a glob segment inside the app-data folder counts only when it COULD
produce the key file's name — a bare glob, a cli- prefix, a token infix, a bracket class or a
brace alternation all still refuse, while an extension glob such as *.db does not), the two
de-quoted-chain rules
git-chain-ref-write-on-protected and git-chain-pr-create-out-of-reach (a head the shell
reassembles into a real git or gh command), process-chain-real-profile-browser (launching a
browser against the profile a real person is signed in to — on Windows this includes a plain
version query: chrome --version, chrome --help, chrome.exe --product-version and
msedge --version print nothing there and START the browser on your real profile, so they are
refused exactly like a launch; the exemption for a query the browser actually answers is keyed on the
box's platform and holds on the machine-wide Developer guardrails hook too — its one exception is a
plain Chrome launch of a profile a person listed under Agent browser profiles), unbounded-pickaxe
(a git log / rev-list with -S, -G or --pickaxe-* in the Omniscio repo with no explicit range
such as master~200..master — --since and -n do not bound the walk; use rg for current code),
git-chain-raw-pr-head-fetch (a hand-rolled git fetch … refs/pull/<N>/head in an Omniscio
checkout; see #30),
git-chain-partial-clone-refetch (a git fetch carrying --refetch in a partial clone, which
re-downloads every object the filter keeps off the disk into the store every worktree shares; see
#32) and local-heavy-check
(a tsgo, tsc, vue-tsc, vitest or eslint typed straight into a shell on a machine whose
testing setting sends heavy work to the cloud — 2026-11-05, "NO CHECKS CAN RUN ON THIS COMPP"),
safety-root-delete (a recursive delete aimed at the filesystem root or a whole home folder),
safety-fork-bomb (a shell fork bomb that would exhaust the machine's processes),
safety-disk-wipe (a command that formats or overwrites a whole disk or partition),
safety-root-chmod (a recursive permission or ownership change on the filesystem root),
safety-never-allow (a command on the never-allow list, which no saved approval can unlock) and
safety-credential-write (a write into a stored credential or key file).
Five always-enforced rules close the same doors on searches, on bundles, on checkout creation and on a
window nobody asked for: whole-history-bundle (2026-11-13, F317: a git bundle create in the
Omniscio repo that excludes no base, so it packs every object the tip reaches — one hand-off bundle was
3.35 GB and 251 CPU-s; cut only the new commits with git bundle create <file> master..<branch> or
<branch> ^master), git-grep-object-read (a git grep that reads commits or trees rather than
your working tree — a revision operand, a .. range, --all/--branches/--remotes, or a pattern
file beside one; on this blob:none clone every tree it walks hydrates its blobs, so use rg),
git-grep-scratch-whole-tree
(a git grep naming no pathspec in a SCRATCH worktree, which holds only the files its owner opened,
so a miss reads like absence — name your branch, one file or a pathspec), raw-worktree-add
(a hand-rolled git worktree add the ledger never sees, because every new checkout must carry a
recorded owner before it exists — the create API is the paved road, and AMC_ALLOW_RAW_WORKTREE_ADD=1
is the hatch for a repo the API cannot serve), and windowed-detached-child (a child spawned
detached — which opens a black console window over the app — or a Start-Process without
-WindowStyle Hidden; spawn with windowsHide: true and not detached, or run it from the Bash tool,
and CLAUDE_ALLOW_WINDOWED_DETACH=1 is the hatch for a window the person really means to watch).
The rule refuses only where it has something to redirect: it judges every folder the run
actually reaches, not the folder the shell happens to stand in. That is the shell's own cd
timeline plus the folders the command's arguments point at (tsc -p/--project, vitest's
--root/--dir/--config and path operands, eslint's path operands), so tsc -p <this repo>
and eslint <this repo>/src are refused from a lane-less folder, and a cd into another project
makes the same command harmless. A @response operand reaches whatever the LIST names, not
whatever sits beside the list, so the list is read (bounded at 64 KB — past that the run is
unprovable rather than half-read) and each entry is judged from the list's own folder and then the
run's. Whose project a reached folder is comes from
identityEvidence — the repository's own manifest name — never from the presence of a
test:agent script, because another project can define a script of that name for its own
reasons and a byte-order mark is not a reason to refuse a stranger's run. A folder whose
identity proves nothing, and a reach the parser cannot place, both keep the refusal.
The same rule scopes the preload's refusal (2026-11-10). The session Node preload
(scripts/lib/local-check-refusal.cjs) refuses a heavy check through the cloud-enforce apex,
and that refusal used to fire in EVERY repository on the machine — so a project with no cloud
road was let through the hook and stopped one step later, at the tool, by a message pointing at
a npm run test:agent -- --cloud script that project does not have (Ella #1895). The preload
now asks THIS rule's scope (localCheckScope) and stands down only when the run reaches a
folder whose identity proves another project. Nothing else moves: the apex still owns the
policy (windows, pins, the Verdict backup grant), a run from elsewhere that targets this
repository — by -p/--root, a path operand or an @response list — is still refused, and a
reach the parser cannot place, or one that throws, still keeps the refusal.
The fleet-down lane. When the cloud fleet genuinely cannot answer, the owner's D64 ruling
lets a bounded local run happen. The lane is opened by the app's own live /cloud/health
verdict, read over the control server with the caller's own session identity, and only while
that verdict says down and was probed within the last 20 minutes. Nothing on disk opens it: a
hand-written outage record is not a verdict and is not read. A stale, missing, unreadable or
malformed verdict is UNKNOWN and keeps the refusal. A compiler never takes the lane at all — a
typecheck runs the whole import closure of whatever it is handed, so no argument bounds it.
Known limit: a heavy tool inside a nested shell (bash -c "vitest run") is not judged by
this rule. Reading nested payloads is the nested-run traversal the slow-local-test rule owns, and
a second copy of it here is what would drift.
These ignore advisory mode (always enforced); long-shell-command, wedged-tree-commit and
sparse-phantom-deletion can never be lifted by a grant; and the worktree lockdown and
auth-artifact-write sit above the hatch line entirely, so no exclusion, pause or window reaches
them either (see the worktree section below). Nor do the two repository-store rules get a hatch at
all. raw-git-rebase sits between: it is above the approval window and any pause, because a
box-wide human approval window — the publish lane opens one before every push — must not lift the
rail whose subject is uncounted object-store contention; yet a repo exclusion and its own
AMC_ALLOW_RAW_GIT_REBASE=1 switch still lift it. If you are deciding whether an exclusion or an
approval window will get you past a refusal, check which of those the rule is in rather than assuming
it is only this one.
Two more, added 2026-09-03
#11 — a heavy test run that stayed on your machine. A heavy test run started without sending it
to the cloud queues behind a slot gate on a box that may already be busy, so the guard asks you to
send it to the cloud. A direct vitest run or a bare npm test is refused the same way, but only inside an
Omniscio checkout — in another project, even one with its own test script, they are never
interrupted. Adding the cloud flag anywhere in the run clears it.
#12 — staging everything at once. git add -A and git add . sweep up every changed file in
the folder — including work another agent has in flight but has not finished. The guard asks you
to name the files you actually changed. git add --update and any specific path are untouched.
-A (or --all) is allowed when every path beside it is a literal path inside the folder, so
git add -A src/runner.ts reaches git while git add -A ., git add -A src/a.ts '*.ts',
git add -A .. and git add -A --pathspec-from-file=list.txt are all refused. A dot that git
normalises to the folder root — .//, ./., ././ — is the same command as .. The pathspecs
are classified by one table shared by the hook, the shell guard and the native shim, so the two
deliveries decide alike.
Staging into a private index is not staging the folder, so it reaches git: when
GIT_INDEX_FILE names a file of your own (GIT_INDEX_FILE=/tmp/snap.idx git add -A), the add
writes only that file and nobody else's work can be swept into it. This is how the app's own
startup safety check snapshots the source on disk. The real index is still guarded however it is
spelled: a file named index (the checkout's, a worktree's, a submodule's), git's own
index.lock / next-index-*.lock, or any path with .. is treated as the real one and refused.
Both were tuned against the same lesson as #8-#10: writing about a command is not running it.
A commit message, a note to a teammate, a heredoc, or a search of the docs that happens to
mention a guarded test command or git add -A is text, and none of them trip these rules — checked
against every wrong alarm the earlier machine-local version of #11 produced.
Neither can be switched off on its own; that is true of every rule in this family. Use the escape hatches below (advisory mode, an excluded repo, or the approval window) instead.
Two more, added 2026-09-04
#14 — a git command hidden inside a script file. The guard used to read only the command an
agent typed. So git push --force origin master was caught, but putting that same line in a
file and running node cleanup.mjs was not — the command it saw was just node cleanup.mjs,
which contains no git at all. Measured against the shipped guard, exactly that shape was allowed
on a master checkout, silently, with no warning of any kind.
It now opens the script a command runs — node x.mjs, bash x.sh, powershell -File x.ps1 —
and judges what is inside by the same rules. When a block comes from a file, the message says so
and names the file, so you are never told your harmless-looking command was a git push without
being able to see why.
The half of this that reads code passed inline (bash -c '…', node -e '…') already shipped
on 2026-09-03; this is the other half. A script that merely mentions a git command in prose is
still fine — the guard only counts it when the script can actually run something.
#15 — a process kill that would take out every agent's test run. Test and check runs don't carry any marker saying which agent they belong to, so "kill the processes matching this script name" hits everyone's, not just yours. A single such sweep can kill dozens of processes and end other sessions' in-flight runs at once. Those runs die with no result at all, so those agents simply start over — one command, many lost hours.
The rule isn't "never kill". It's "show that you mean your own run", and either proof is enough: name the process id, or name your own worktree in the filter. Every read-only way of listing processes is untouched.
One more, added 2026-09-11
#16 — a git remote change that reaches every worktree. git remote remove, rm, rename,
set-url, set-head, set-branches, and prune edit the repo's ONE .git/config (or the
tracking refs every checkout reads), and a git worktree shares that file with the main checkout
and every sibling worktree. So typing git remote remove origin inside your own feature-branch
worktree does not remove your origin — it removes origin for the whole repo, and every
fetch / push / gh pr list in every checkout then fails with no git remotes found until it is
restored by hand. Removing the promisor remote also drops the partial-clone setting, so even a
bare git remote add afterwards is not a full repair.
Rule #1 already refused these verbs — but only while standing on master, which is the one
place no agent works. This rule refuses them from any branch, and only when the repo's
config is genuinely shared: a linked worktree, or a main checkout that has linked worktrees. A
standalone checkout — every throwaway fixture repo the test suites create in a temp folder — is
left alone, so git remote add / remove on a scratch repo still works. git remote add of a
new remote is allowed everywhere (it is additive, undone by one command, and the first step of
the restore), as is git remote update (a fetch) and a prune --dry-run.
The message says what to do instead: a scratch ref belongs under refs/tmp/<name>/ and is
dropped with git update-ref -d, never with git remote remove. An excluded repo or an
approval window lifts it like the other rules; an agent cannot lift it for itself, because the
damage lands on every other agent's worktree. Unlike most rules, it does not follow the
enforcement level: it refuses at advisory just as at required (the same always-enforced
class as the over-long-command rule), because a warn would only have logged the veto while origin
was deleted for everyone. Only the human escape hatches — an excluded repo or an approval window —
let it through.
One more, added 2026-09-14
#22 — a commit that strands a ready-to-merge tag (stale-ready-tag-commit). When you tag a branch ready-to-merge, the
tag names that branch's exact commit, and the auto-lander only ever lands a branch whose tag still
names its current tip. So committing on top of a live tag does not "add one more thing to a ready
branch" — it moves the tip out from under the tag, the lander silently stops seeing the branch, and
git reports the commit as an ordinary success. The guard now refuses any command that creates a
commit (git commit, and the same commit reached through a script file) on a branch whose live
ready-to-merge tag names its tip, and tells you the way through: withdraw the tag as its own command
first, then commit and run /ready-to-merge again. In an Omniscio checkout the withdraw goes through
the branch side store, where git config --unset clears nothing.
A repo without that side store is decided by where the tag actually is, which the guard checks: git config --unset "branch.<your-branch>.description" when the side store holds nothing for the branch, and
otherwise the app's own road, POST /branch-description/withdraw, printed as a runnable curl.
It only ever fires on a branch already wearing a live tag, so a developer who never uses
/ready-to-merge never sees it. A description it cannot read refuses too, and names the reads to retry
on (git config --get, plus the branch side store's own read in an Omniscio checkout).
An excluded repo or an approval window lifts it like the other rules.
Two more, added 2026-09-25
#17 — a process stop that picks its targets by pattern. A name, a wildcard, a command-line
filter or a pipeline cannot tell your process from the app's or another session's. Omniscio's own
launcher is npx electron-vite dev, so a filter like "every node.exe whose command line contains
vite" matches the app itself — and stopping it takes the app down with every live session. The
guard cannot check what a filter will match, so any stop chosen that way is now refused:
Stop-Process -Name, taskkill /IM,
pkill, killall, … | Stop-Process, ForEach-Object { Stop-Process -Id $_.ProcessId },
kill $(pgrep …), and a variable filled from a process listing in the same command.
What still works, and what the refusal tells you to do: stop the exact process ids you mean.
Stop-Process -Id 1234, taskkill /PID 1234, kill 1234, kill $!, a pid file you wrote when
you started the process, the object Start-Process -PassThru gave you, or a loop over a literal
list of ids. If you do not know the id, LIST first (read-only), check each row is yours, then stop
those exact ids in a second command. Best of all, keep your child's id when you start it.
#18 — stopping the app itself, by its exact id. Listing processes and copying the launcher's
id into Stop-Process -Id would take the app down just the same. So the app tells every session it
starts which processes are its own — its main process and every process it was launched through,
worked out from its live process id, never from names — and a stop of any of them is refused. A
cloud session runs on another machine and gets no such list. If you truly asked for a restart,
the same one-time override as #9 lifts this rule (and only this one).
Both refuse even in advisory mode. Two fixes rode along. First, the guard used to lose the rest of
a powershell -Command "…" after the first escaped quote (\") — which is exactly where that
day's stop was hiding. Second, when two rules had something to say about one command, a warning
from the first used to end the check before a later rule could refuse.
Two more, added 2026-09-26
#19 — deleting a repository's own .git. A command aimed at a temp folder can still land in a
real checkout: a single-quoted path that never expanded means the cd fails, and the delete after
it runs in the folder the shell was already in, taking that checkout's .git — and with it every
commit not yet pushed anywhere. Any delete, move or rename that would take a
repository's .git with it is now refused: rm -rf .git, Remove-Item -Recurse, rd /s, del /s,
mv / Move-Item / Rename-Item / ren of the .git itself (a worktree's .git file included), a
glob that empties it (rm -rf .git/*), a folder that holds a repository, and the same inside
bash -c, powershell -Command, cmd /c, node -e or python -c. The guard works out where the
command really runs: after cd x && … it judges x, and after a cd that may fail followed by ;
it judges the folder the shell was already in as well.
#20 — git init inside an existing repository. Once such a delete has emptied a checkout, the
next move is a git init there, which builds a decoy empty store inside the real repository —
commits and lands go into it, invisible to the true history. git init is now refused whenever its
target sits inside a repository, however the target is named: the
current folder, a folder argument, -C, --git-dir, --bare, --separate-git-dir, or GIT_DIR=.
Both refuse even in advisory mode, and no exclusion, pause or approval window lifts them — a warning
cannot bring a deleted store back. Throwaway repositories are unaffected: anything under your
session's scratch folder ($AMC_SESSION_TMP) or the system temp folder can be created,
re-initialised and deleted freely, which is also the one-line hint every refusal carries. A path only
the shell can work out — "$T/.git", git init "$(mktemp -d)" — is left alone rather than guessed at.
One more, added 2026-09-30
#21 — a git write the guard cannot place. A bare git commit in a checkout sitting on master
can go through, while the very same commit written git -C <that checkout> commit is refused. The
guard works out which repository a command touches from the folder the tool call says your session
is in. When a call did not say —
the detail was missing from what the guard received — it fell back to the folder the guard's own
process happened to be running in, and that is a different folder. If it is not a repository, the
branch reads as unknown, and an unknown branch quietly switches off every master rule at once, so
the write the guard exists to stop was let past with nothing said. A git write the guard cannot
place is now refused rather than guessed at, and it says so. Nothing else changed: reads
(git status, git log, git diff) are untouched, and a command that names its own folder
(git -C <folder> commit, cd <folder> && git commit) is judged on that folder exactly as
before — which is also the way out of the refusal. A related fix rode along: a checkout whose
branch cannot be read at all (its .git is there, but git will not name the branch — a worktree
whose main repository has gone missing) used to be re-checked against the guard process's own
folder, which is how that commit was allowed too; it now refuses, the same way the guard Omniscio
spawns per session has always refused it.
A cloud resource cannot be destroyed without the owner's approval for that command (2026-10-22)
On 2026-10-17 an agent session ran gcloud as the owner's identity and permanently destroyed both
versions of a Secret Manager secret, with no approval. The guard only watched VMs, disks and images.
A new always-enforced rule, cloud-resource-destroy, refuses a shell command that would destroy,
delete, disable or downgrade a cloud resource: gcloud secret / Cloud Run / functions / projects /
SQL / IAM / storage / DNS / scheduler / Firestore deletes, gsutil rm -r and rb,
firebase functions:delete and its siblings, bq rm, terraform destroy, aws delete-* /
terminate-*, and a curl -X DELETE against *.googleapis.com. Reads, deploys and creates are
untouched, and gcloud compute stays with the Fleet Ledger rule — two rules on one verb would refuse
what the ledger had just granted.
The only escape is the owner approving that one exact command, in one click. The agent asks
through POST /git-guardrails/cloud-destroy-approval. That route only enqueues an approval — the
same pending-approval card a settings change raises — and grants nothing. When the owner clicks
Approve, a handler in the app's main process mints a single-use, Ed25519-signed order bound to the
exact command, and the guard spends it on the run that uses it. A second run of the same command is
refused; so is an order minted for a different command, and so is a general yes that names no
operation. The binding runs the other way too: an order minted for one command is refused by every
caller that names no command (the guard-switch door, for one), before anything is spent, so an
approval for one deletion can never be used as a general owner order.
The card's words are the guard's, never the asking agent's. This exists because of a real miss: on 2026-10-16 an owner answered a card reading "Retire the dead Groq key copies? Nothing has been deleted", and an agent read that yes as permission to destroy four secret versions. So the sentence is derived from the command itself — the plain verb, the exact resource, the project, and whether it can be undone ("This permanently destroys secret gateway-groq-key version 2 in the shares project. It cannot be undone.") — and the agent's reason is shown after it, labelled as the agent's own words. A command the guard would allow derives no sentence at all, so no card can be raised for a harmless operation.
No standing "always allow" grant can reach this kind, and an agent cannot mint its own approval: the minting key is refused to any process carrying a session marker, and the pending approval file is itself write-protected against agents.
It does not refuse prose. A commit message, an echo, a curl body and a heredoc fed to cat
are blanked before the verbs are read, unless the shell would run what is inside them: a span carrying
a substitution (git commit -m "$(gcloud … delete …)") is judged as written, and so is an echo, a
printf or a cat heredoc whose output is piped on (echo '…' | bash), because the next command may
run it. A wrapped executor (bash -c, pwsh -Command, cmd /c, env …) is never blanked, because
it runs. Two limits are written into the contract: text a command writes to a file that a later part
of the same command runs (echo '…' > run.sh && bash run.sh) is not judged, and neither is a command
held in a variable.
Paired with it, Secret Manager delayed destruction is set on our own projects so a destroyed version stays recoverable. It is dry-run by default, and it never lowers or clears a value that is already longer.
Four more, added 2026-10-23
#23 — rewriting the shared object store (store-rewrite-verb). Every worktree on a machine shares
one object store, so a hand cleanup of it can take work from every session at once. An agent hand-deleted
pack files and the commit-graph from the main checkout and about a fifth of the branch tips were lost.
The guard now refuses the git commands that rewrite that store: gc, prune, prune-packed,
repack, pack-refs, replace, filter-branch, filter-repo, maintenance run, start and
register, multi-pack-index write, repack and expire, commit-graph write, reflog expire and
delete, and fsck --lost-found. The read-only look-alikes stay open (reflog show,
commit-graph verify, replace --list). Whole-store reads are refused outright with no approval,
because they cost minutes of the whole computer: plain fsck, verify-pack, and every maintenance
call except exactly git maintenance stop, which stays open because it turns background maintenance
off. Agent shells on other engines refuse the same set. The app compacts the store itself,
so nothing an agent needs goes through this door. A dry run (git prune -n) is refused too, because
the guard judges the verb, not its flags. A saved alias for one of these commands is refused as the
command it stands for, both when it is run and when it is saved.
#24 — switching store cleanup on (store-rewrite-config). The same cleanup can be armed from the
side: gc.auto or gc.autoPackLimit set above zero, or any of maintenance.auto,
maintenance.<task>.enabled, fetch.prune, fetch.pruneTags, remote.<name>.prune,
remote.<name>.pruneTags, fetch.writeCommitGraph and receive.autogc turned on, given on the
command line with -c, through --config-env, GIT_CONFIG_PARAMETERS or GIT_CONFIG_COUNT, or saved
with git config. The guard reads the value, not just the name: gc.auto=0 and the thread limits the
app sets for every session (pack.threads, index.threads, checkout.workers, grep.threads) pass.
Taking away a setting that is on by default (git config --unset gc.auto, or removing the whole gc
or maintenance section) is refused too, because the default then applies again. So is naming a
settings file to include (include.path, or includeIf.<condition>.path) with anything in it, because
the guard cannot read what that file turns on.
#25 — deleting the trunk or a non-branch ref (protected-ref-delete, nonhead-ref-delete).
git branch -D master, update-ref -d, tag -d, symbolic-ref -d, remote prune and a pruning
fetch are refused for master/main and for any ref outside refs/heads/ (tags, remote-tracking
refs, refs/amc, refs/cloud). Deleting an ordinary feature branch is still allowed — it leaves a
row in the decision log — and scratch refs under refs/tmp/ are free. To retire a branch use
POST /branches/delete.
#26 — changing anything inside a repository's .git (git-dir-write). Deleting, moving or
rewriting a file inside .git — objects, packs, refs, hooks, config — is refused whether it comes from a
shell command (rm, mv, Remove-Item, del, a redirect, tee, cp, sed -i, truncate,
find -delete), from node -e, python -c or a similar one-liner, or from the Write and Edit tools.
Reading it, and copying from it, stay open, and a throwaway repository under the temp or scratch folder
is exempt. Deleting or moving the .git entry itself is covered by #19. A folder written as
$(git rev-parse --git-dir)/objects (or with --git-common-dir, --absolute-git-dir or --git-path)
is judged by what the text shows: objects, refs, packed-refs, HEAD and worktrees are refused,
and so is the git folder itself; other folders reached that way, such as info/exclude, are not judged.
The one way past all of them. A person's approval, asked for with POST /git-guardrails/approval-request, lifts exactly one tool call and only for ten minutes: the first
refused command it lets through uses it up, and the next refused command is refused again. The agent's own
self-pause, the typed override prefix, a repository exclusion and a standing "always allow" lift
nothing. The refusal holds on a warn-only machine, and the same command is refused on the
agent-shell function as well, which accepts the approved verb for up to two minutes after the approval
is used. If the guard's store files did not install, a command that names a store verb or a .git
path is refused with a "restart Omniscio" message instead of being let through.
Two limits are stated rather than hidden: a hand edit of git's own settings file outside the repository is not judged by value, and the agent-shell function reads no saved aliases and does not judge branch and tag deletes — the hooks do both.
One more, added 2026-10-24
#27 — a fetch that asks a question the machine can answer locally (local-master-fetch). On a
computer whose finished work lands on its OWN master, an agent's habit of running git fetch origin
before checking the trunk is pure cost: the trunk is already there. Measured on the owner's machine,
two sessions' plain fetches ran about twenty-four minutes each and between them burned roughly 570
CPU-seconds — four percent of a 24-core box — in a single ten-minute window, because that repository
carries tens of thousands of refs and both the negotiation and the connectivity check that follows a
fetch scale with them.
So a git fetch that names no refspec is refused, along with git pull in every form and
git remote update, which is the same operation under a third verb. A fetch that does name a
refspec is allowed, because the pull-request roads depend on exactly that shape — with the one
exception of a pull-request HEAD, whose own rule is #30 below. A fetch of a branch by refspec
(git fetch origin master) stays allowed, and the refusal points at reading
the base locally — git log --oneline -10 master, git show master:<path> — rather than at adding
a refspec to get past it.
This rule is the first that fires on some computers and never on others, and that is its design. It is armed per session by the local spawn, from two facts the app already holds: the auto-lander is armed, and the session's project is one it watches. If work on your machine lands by branch, then pull request, then landing, the flag is absent and the rule is inert — the guard behaves exactly as it did before it existed. A cloud box reads the flag as absent too, because it runs from a seeded snapshot and carries none of that ref cost. A machine with an older build of the guard simply ignores the flag.
To reach the remote deliberately, name the refspec you actually need. To turn this one rule off
entirely, switch off git-local-master-fetch in the guard switches.
Two more, added 2026-10-27
#28 — a branch that starts from a moving name (branch-from-moving-name). git switch -c X master
and git checkout -b X origin/main look like two easy commands; on a slow drive they are a race. Git
writes master's tree at the START of the switch and creates the branch ref at the END, and on drive L
those two moments were measured about four minutes apart. If the trunk lands in between, the new branch
carries the trunk's NEW ref over the OLD tree, so the difference between the two masters sits in the
working tree as staged changes, the reflog still reads branch: Created from trunk, and the ready mint
refuses the branch for a dirty tree nobody edited. It happened twice in one day on two Plugin Platform
leases.
So a create whose START POINT is the protected name is refused, in every spelling (-b, -B, -c,
-C, --create, --force-create, and the glued -bname), for master, main, origin/master,
upstream/master and refs/remotes/origin/main. The refusal hands over the fix as two commands you can
run as written: git rev-parse master to resolve it once, then git switch -c <branch> <sha>.
Nothing else changes. A create with no start point, a sha or an abbreviated sha, HEAD~2, another
feature branch, a branch legitimately named feature/master, --orphan and a plain non-create checkout
all stay allowed. The second half of the fix is in the app itself: creating a worktree now resolves its
start point to ONE commit and hands that commit to git, and records the same commit for the cleanup that
runs when a create fails, so the tree and the ref can never disagree.
#29 — a pathspec word that names the whole tree. The tree-sweep rule used to know five
spellings of "the whole tree": -A, --all, ., ./ and :/. Git has more of them, because a
pathspec can carry magic: :(top) and the short :/ match from the repository root, * and
** match across folders, and an arg that is only magic names everything. Measured on git 2.43.0,
each of these stages the entire tree while the old rule judged nothing:
git add ':/*', ':/**', ':(top)', ':(top)*', ':(glob)**', ':(glob)**/*', ':(icase)*',
':', '::' and ':(literal).'. One more shape came from the other side: an add whose only
pathspec is an exclude means "add everything except these", so git add ':!x' also stages the
whole tree — git add ':!*' stages nothing, because that exclude covers everything.
One reader now decides this, resources/git-guardrails/guard-pathspec.mjs: it parses the magic and
the pattern, and only an exclude (:!, :^, :(exclude)) "narrows nothing away". A word refuses
when its pattern reaches every path from where it is anchored — empty, ., or wildcards that cross
folders (* and ** without glob magic, ** with it). Everything that names a path stays
allowed: :/src, :/src/a.ts, :(top)src, :(literal)src, :(icase)src/A.TS, and the two
no-op cells :(top). and :/.. A glob's single * stays scoped too, because with glob magic it
matches root entries only (:(glob)*). A run carrying only excludes refuses unless one of them
covers everything.
The shell twin reads the same vocabulary from that module — the magic names, the short-magic
characters, the top, glob and literal tokens and the add-only whole-tree words all come from it, so
the emitted git() function and the hook cannot disagree about which words are staging words. The
one thing the twin keeps of its own is the reach test itself, which the parity corpus and
whole-tree-pathspec-staging.test.ts hold against the module. An unquoted git add :(top) is a
syntax error in bash, so the quoting is not optional for the caller.
One more, added 2026-11-03
#30 — a pull-request head fetched by hand (git-chain-raw-pr-head-fetch). A blob:none
partial clone with lazy fetching off has the same trap, so a raw git fetch origin refs/pull/<N>/head:refs/heads/pr-N-final
writes a ref whose COMMITS arrive and whose BLOBS do not. Nothing fails at the fetch: the next git diff or git merge-tree against that ref is what grinds, because every absent blob is a separate
lookup git has to give up on. Measured four times in two days on the PR desks — one head's four
commits touched 19 blobs, 9 of them absent, and a diff --stat plus a merge-tree took 26+ minutes
and 943 CPU-seconds between them.
So a fetch whose refspec names refs/pull/<N>/head (or /merge, or the short GitHub form
pull/<N>/head, or a * wildcard over them) is refused in an Omniscio checkout, and the refusal
hands over the one command that replaces it. That command writes
the same head at refs/remotes/prhead/<N> and then fetches only the blobs at the paths that
differ, so git merge --no-ff refs/remotes/prhead/<N> is a normal merge instead of a 30-minute
one.
A fetch from a local bundle file, an ordinary branch fetch, git ls-remote, and every
--filter=blob:none hydrate are untouched.
A PR-head fetch that reaches the network at all is now MEASURED before it starts.
scripts/lib/fetch-size-budget.mjs admits a small declared transfer, refuses one the drive cannot
absorb, and refuses an UNKNOWN size when free space is under the reserve plus this road's worst
measured case — an unknown size is never read as small. It probes rev-list --count <tips> --not --all first, so a head already reachable from master costs no transfer and is admitted on any
drive; a drive-only bound would have refused 45 of 45 landed heads and stalled the desk with nothing
to download. Every refusal names that same command. A closer script calls
the same probe before its chunk fetch and reports a refusal as its existing budget verdict, so the
run defers those PRs rather than failing.
The rule is refused on the advisory dial too. A warn is just a log line there, and the harm — a ref with absent blobs sitting in the shared object store — has already happened by the time anyone reads it. A repository exclusion and a human approval window still lift it, as they lift every other hatch-tier rule.
One more, added 2026-11-05
#31 — a config key stored in a config VALUE (git-chain-sparse-flag-key-as-value). A worktree
reads the repository's ONE shared .git/config alongside its own config.worktree, so a single bad
value there reaches every worktree at once. Measured three times on the owner's box (2026-10-17 and
twice on 2026-11-05): [core] sparseCheckout = core.sparseCheckoutCone — the config KEY stored in
the VALUE slot, the signature of a shifted argument pair.
The write is silent: git validates nothing when a key is written, and git config --get does not
parse the value either, so it goes on answering happily. The failure lands later, on the next command
that PARSES the flag, as fatal: bad boolean config value 'core.sparseCheckoutCone' for 'core.sparsecheckout' — a message that names neither the worktree nor who wrote it. Each occurrence
was found by its blast radius, hours afterwards, with push and checkout-index broken in every
worktree simultaneously.
So the write is refused where it is typed. The rule fires on two shapes and nothing else: a value
that is a config key name in the key's OWN section (the shifted-pair signature), or a non-boolean on
one of the three boolean sparse keys. Reads and removals are read first and let through — --get is
how a broken file is inspected and --unset/--remove-section are how it is repaired — and a dotted
value in a different section (diff.<driver>.textconv textconv.exe) is untouched, so the rule cannot
become the outage it exists to prevent. It is refused on the advisory dial too: the harm is the write
itself.
No shipped code writes these keys at repository scope — every app writer is --worktree scoped with
a literal boolean pair — so a value that still gets in came from somewhere the hook never sees. On
every launch, scripts/ensure-safe-git-state.mjs therefore also reads the three keys with
--get-all (which, unlike a validated read, still answers on a broken file), clears an unparseable
value from the repository's own config and writes false back, reporting one line. A value living
in the user's global or system config is reported with where it is and never edited.
One more, added 2026-11-06
#32 — a refetch that re-downloads the whole object store (git-chain-partial-clone-refetch). A
git fetch normally asks the remote only for what the clone does not already have. --refetch
skips that negotiation and asks for everything, which is a reasonable repair on a full clone and a
very expensive mistake on a partial one: this repository is cloned with a blob:none filter, so the
objects the filter keeps off the disk are exactly the ones a refetch pulls back. One refetch
re-downloaded millions of objects and repacked the shared store while it did, which every worktree on
the machine shares.
So a git fetch whose arguments carry --refetch is refused when every folder the command runs in
is a partial clone — the checkout you are in, the folder cd moves it to, or the one git -C
names. It is refused on the advisory dial too: the harm is the re-download, and a warning is a log
line written after the store has already been fetched again.
The refusal names the road. Fetch normally instead — git fetch origin asks for what the remote
has and you do not, which is what a refetch is usually reached for. On a machine whose finished work
lands on its own master, the base is already local, so read it — git log --oneline -10 master,
git show master:<path>. To hydrate objects whose names you already have, fetch them together in ONE
invocation; one fetch per object mints one
promisor pack each, which is its own storm.
A refetch against a repository that is not a partial clone is untouched: there, "everything" is bounded by a store that already holds it.
The history rule can be fixed while the app runs (2026-10-31)
The rule that decides which git history reads are allowed — the one that refuses unbounded log and
rev-list walks — is no longer frozen into the running app. The app follows the rule file in its
own checkout and re-reads it when it changes, and a fix can also be applied directly from one commit:
POST /git-policy/applywith{"ref":"<branch or commit>"}(full-trust token) reads the rule at that exact commit and puts it into force for every git call the app makes, on the next call. No restart, and no local agent is touched.- Before it switches, the app replays the git calls it actually made recently. If the new rule would
refuse any of them, the apply is held and the answer lists each one. Send the same request with
"acceptNewRefusals": <that number>to apply it anyway. A changed rule file in the checkout that would refuse recent calls is held the same way and shows up in the status. - An applied rule stays in force across an app restart until the checkout itself contains that commit; then the app goes back to following the checkout.
GET /git-policy/statussays which rule is in force, from which commit, and what the last apply held or allowed.POST /git-policy/revertgoes back to the checkout's rule.
A rule file that cannot be loaded is never put into force: the previous rule keeps deciding.
The master-key rule closes three more ways round it (2026-11-05)
The rule that keeps the app's master key out of every tool result allows exactly two uses of it: it
may be captured into a variable (TOKEN=$(cat <the key file>), any variable name), and it may be
sent as the credential of a curl, wget or Invoke-RestMethod call, where the reply can be
piped through head, tail or jq. Three spellings that slipped past it are now refused, and each
refusal names the two shapes that work:
- A wrapper that prints its command.
timeout 120 curl …is still the approved send, butenv -v curl …,time -v curl …and any wrapper flag the guard does not know now make the send untrusted, because those print the whole command line, key included. - A credential flag that makes the client echo the key. The key as the value of
-H @,-d @or-F f=@, as a user flag with noname:part or a cookie flag with noname=part, or as a PowerShell-InFile,-Token,-Credentialor-Authenticationparameter, becomes a file name or a prompt that the client prints when it fails.-Gand--url-queryturn the value into a URL the client can print. - A key name split around an expansion.
cd ~/.amc && echo $(cat cli-token),cat ~/.amc/$(echo cli-token),cat ~/.amc/cli-to$()kenandcat ~/.amc/${X:-cli}-tokenbuild the name from pieces on either side of an expansion; the guard now reads the pieces together.
A key name completed by an expansion on one side is judged too: cat ~/.amc/cli-$(echo token), and the
same trick with a parameter or backticks, is refused when the letters it does spell start and end the key
file's name inside the key folder. A cd into the key folder carries into every nested command, and a long
filter flag such as sort --compress-program=/tmp/prog is read by its name. If the key rule module cannot
run and the small file that spots obfuscated spellings (prescreen.mjs) is missing too, the hook now
refuses every gated call instead of trusting a plain-text check.
Spellings that make a shell evaluate a captured name as arithmetic (declare -i X=T,
[[ T -eq 1 ]]) are not judged yet.
One more, refused on every dial (2026-11-06)
A --depth fetch in a shared object store (shallow-truncating-fetch) — the rule itself is
older; what changed is that it now REFUSES on the advisory dial instead of warning.
A worktree's .git is a file pointing at the main checkout's gitdir, and it shares the common object
store, so git fetch --depth=1 typed in a scratch worktree writes the boundary file in the MAIN
checkout. Git then refuses to walk past that boundary, so merge-base origin/master HEAD answers
nothing — and publishing and catch-up refused for every session on the computer, with a
message saying the branch "was never forked from this trunk".
Measured 2026-11-06 at 19:52:57Z, the
guard's own decision log holds the verdict this rule produced: the detector fired, and the decision
layer answered allow, because the rule was not in the always-enforced set and the box runs the
advisory dial. The road was down for 13 minutes.
So the rule joined the always-enforced set, where a warning is not an option: the harm is the fetch
RUNNING, and the boundary is written before anyone could read a warning. --unshallow is still
allowed — it clears the boundary and is the cure — and the per-repo exclusion and the human approval
window still lift it.
Both PR roads also stopped misreporting the cause. With the store shallow they now say so, and name
the cure (git fetch --unshallow --filter=blob:none origin); a store that holds its own history, or
a probe that cannot answer, keeps the original sentence.
One more, added 2026-11-11
The refusal preload keeps the promisified shape of exec and execFile. The session Node
preload (scripts/lib/local-check-refusal.cjs) replaces every child_process launcher with a guard
wrapper, so it also stands between a caller and util.promisify. Node gives exec and execFile
their own util.promisify.custom: it resolves { stdout, stderr }, rejects with the error carrying
both, and puts the child on promise.child. A wrapper that loses that symbol silently changes what a
caller receives — generic callback promisification resolves the FIRST callback argument, so
promisify(execFile)(…) answers a bare stdout string instead of the object.
That is what broke scripts/owner-ready.mjs: lastCommitMs() destructures { stdout }, read
undefined from a string, returned no commit time, and every owner override was refused (Ella
#1941). The wrapper only preserved the symbol when the function it wrapped still had it, so any
earlier preload or wrapper in the NODE_OPTIONS chain that replaced execFile without copying
symbol-keyed own properties was enough to lose it.
The preload now supplies Node's documented shape itself when the symbol is absent — resolve
{ stdout, stderr }, reject with the error carrying both, expose .child — and still delegates to
Node's own custom first when it survives, so a healthy chain is byte-identical. The guard runs on
both roads before the child starts, so closing this shape gap opens no hole in the refusal.
Related
- Git guardrails — part 1 of this page, with the surfaces and the user-facing behaviour.
Last verified 2026-11-18