Security model

What keeps a session away from GitHub, what enforces the rules, and the gap that remains in attended operation.

egon starts from one assumption: a session can be talked into things. A feature request, a test fixture, a CI log or a dependency can carry instructions. So nothing that follows from a session is more than commits in its own worktree. Everything beyond that is done or checked by the core and by the rules of your base branch.

Who enforces what

Layer Holds Does not hold
GitHub, the rules of the base everything that comes through a token without bypass commands with an owner's login that has a bypass
the core mistakes, shortcuts, the effects of prompt injection a session that reaches GitHub past it
net 1: deny rules the direct way: gh …, also with a full path, git push … detours; the patterns match the start of a command, so git -C <dir> push and bash -c '…' get through
net 2: the auto-mode classifier much, by judgment nothing reliably: a net, not a gate
net 3: the environment of sessions and commands gh login, Git credential helper, SSH agent and keys for git, logins for kubectl, gcloud and AWS, also over the detours of net 1 a session that deliberately gets around the nets: reads the Keychain, calls ssh directly, or resets its environment
a separate macOS user access to the owner's logins and keys

The core

The core is a loop in TypeScript without a model, with tests. It starts the sessions with fixed commands and holds the rules a prompt could talk away: start conditions, the reservation, allowed transitions, counters, scope, the merge gate. Push, pull request, comment and merge are commands of the core; the commands that write refuse to run inside a session.

The three nets

Three nets keep a session away from GitHub:

  1. Deny rules. Every session starts with deny rules for gh, git push, git tag and git remote, and for the core's writing commands. Deny rules hold in every permission mode and beat every permission.
  2. The classifier of Claude Code's auto mode judges each tool call. It catches much, but it is a judgment, not a gate.
  3. The environment. The core builds the environment of every session and every profile command anew instead of copying it: a small base set (PATH, HOME, USER, LOGNAME, SHELL, LANG, LC_*, TERM, TMPDIR) and the names in env_pass. It points gh, Git, SSH, kubectl, gcloud, AWS, Azure and npm at empty or missing configuration, and Docker at a credential helper of its own that knows no registry, so no stored login is found. Checked live: inside a session, gh auth status fails, Git gets no credential for github.com, git over SSH does not reach GitHub, and npm sees no token.

The remaining gap

A session that deliberately reads the Keychain gets past all three nets: with security, with ssh and UseKeychain, or with a reset environment. Only a separate macOS user closes that gap, in autonomous operation. A GitHub App (identity: app) separates who is the author, not what the process may do.

The gap is per machine, not per repository. A session reaches everything the macOS user reaches, including repositories and access outside the project. Run egon attended only for projects whose risk that carries. A project that cannot carry it belongs on a separate macOS user.

Two more things are inside the same gap, accepted on purpose:

Isolated sessions

Without isolation, every plugin, hook and MCP server of your own Claude Code setup would load into each session, along with your CLAUDE.md, your rules and the auto memory of the repository. So the core starts and continues every session:

For each session the core records which plugins, skills, agents and MCP servers loaded, and the CLI version. egon doctor warns about anything besides egon and Claude Code's built-in plugins.

Against prompt injection

The merge

What egon never does

Touch production; start or restart workflows by hand; create releases; push tags; push secrets; force-push; reset --hard, clean or restore someone else's changes; change the rules of the base; answer a question of its own sessions.

The local page

The page of the channel local binds to 127.0.0.1 only, checks the Host header, and needs a token per run, traded for a cookie, plus a form key for every answer. It sends Content-Security-Policy: default-src 'self' and Cache-Control: no-store, loads nothing from elsewhere and escapes everything from sessions and FRs. See Channels.