You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shared gh-app-token.cache → 0640 group node, readable by every agent UID. Any agent can cat it and skip the helper's UID/mode gate entirely, holding an unscoped app token. The MITM proxy's mode enforcement then stands alone.
Proposal
The proxy already MITMs api.github.com and inspects every request per agent mode. Complete the design:
Proxy-side auth injection: for requests the mode check allows, the proxy strips whatever Authorization header the agent sent and injects a token minted server-side for that agent's tier. Agents then need no token material at all — gh works with a dummy GH_TOKEN=hive (gh requires the variable to be non-empty), and token theft between agents becomes structurally impossible. This also finishes the story started by the ${GH_AUTH} text ("authentication is handled in transit"), which today is only true for the CA layer.
Tighten the shared cache to 0600 once nothing but the hive runtime (UID 0/dev) needs it — the credential helper runs as the agent but can be given a setuid-free path via a tiny local token broker (unix socket) if needed.
git via injection too: once injection exists, the credential helper can hand out a dummy credential and rely on the proxy, keeping the mode gate as a fast local pre-check.
Why now
Field debugging (2026-07-13/14) showed an agent independently discovering the shared-cache read within one session when its push failed — the gap gets found under pressure. Two layers were designed; today only one holds once a token leaks sideways.
Current state
Agents authenticate to GitHub three different ways, each with a weakness:
git-credential-hive.sh): good — UID-verified, mode-gated — but only covers git.gh-app-token.cache→0640groupnode, readable by every agent UID. Any agent cancatit and skip the helper's UID/mode gate entirely, holding an unscoped app token. The MITM proxy's mode enforcement then stands alone.Proposal
The proxy already MITMs
api.github.comand inspects every request per agent mode. Complete the design:Authorizationheader the agent sent and injects a token minted server-side for that agent's tier. Agents then need no token material at all —ghworks with a dummyGH_TOKEN=hive(gh requires the variable to be non-empty), and token theft between agents becomes structurally impossible. This also finishes the story started by the${GH_AUTH}text ("authentication is handled in transit"), which today is only true for the CA layer.0600once nothing but the hive runtime (UID 0/dev) needs it — the credential helper runs as the agent but can be given a setuid-free path via a tiny local token broker (unix socket) if needed.Why now
Field debugging (2026-07-13/14) showed an agent independently discovering the shared-cache read within one session when its push failed — the gap gets found under pressure. Two layers were designed; today only one holds once a token leaks sideways.
Related: #1860 (interim: per-agent scoped tokens for gh), #1849/#1850/#1856/#1858 (this week's config/enforcement hardening).