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:
- Deny rules. Every session starts with deny rules for
gh,git push,git tagandgit remote, and for the core's writing commands. Deny rules hold in every permission mode and beat every permission. - The classifier of Claude Code's auto mode judges each tool call. It catches much, but it is a judgment, not a gate.
- 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 inenv_pass. It pointsgh, 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 statusfails, Git gets no credential for github.com,gitover SSH does not reach GitHub, andnpmsees 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:
- The Claude token. A session gets the token from
claude setup-tokenin its environment and could read it. As the same macOS user it could reach the stored login anyway. - Process environments. On macOS,
ps ewwshows the environment of other processes of the same user, and every user sees process arguments. egon keeps secrets out of arguments; the environment stays inside the gap.
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:
- with
--setting-sources projectand--strict-mcp-config; - with a
CLAUDE_CONFIG_DIRof its own per project, under.egon/claude, and deny rules for reading and editing it, because the transcripts there hold FR text and code; - with auto memory off;
- without
ANTHROPIC_API_KEY,ANTHROPIC_AUTH_TOKENor cloud provider settings, so a session never runs over the API by accident.
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
- A session gets only a fixed command with the FR's number as its prompt. It reads its brief from the core with
egon brief. - From CI, the brief carries the check's name, its result, the link and at most the last 200 lines of the failed step, marked as a quote.
- Comments on the pull request never reach a brief. The core takes the review result from its own file, not from the pull request.
- Answers from channels reach a session only from the sender that channel knows.
- The review session sees the FR, the diff and the check results, not the build's conversation, and weighs each finding against the FR. A real secret stops the FR always.
- Before each session the core checks that the branch did not change
.claude/,CLAUDE.md,AGENTS.mdor.mcp.json, at any depth. A change is stop condition 6.
The merge
merge: autoworks only with a protected base and at least one required check. If the base requires a code owner's review, it must also dismiss approvals on a push; otherwise egon's own pushes, such as a conflict resolution, would slip changes past an approval. If any of this is missing, egon waits for you to merge, andegon doctorsays so. With the dismissal on, an FR that waits for a code owner needs a new approval if the base moves between the request and the merge; egon asks for it again and tells you.- egon merges with squash and
--match-head-commiton the commit it checked, with a commit message it sets itself. A push between the gate and the merge makes GitHub refuse. - Never
--admin, never a bypass, never an approval by egon. Checked live: with a bypass for admins in the mode "pull requests only", GitHub refuses a merge without--adminwhile a required check is pending or red. - egon commits with Conventional Commits and never with a CI skip marker.
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.