Skip to content
Isonapse
Install

Run an agent behind the egress exit

Wrap Claude Code or Codex so that its only way out to the network is the egress exit on your machine, which checks each request against your policy before it leaves. What a wrapped agent covers, and what it does not, is on What it does.

1. Before you start

  • Claude Code or Codex. Setup wraps one of them. Hermes Agent and pi cannot be wrapped (wrap_unsupported); they keep running on your machine under the Agent Hook.
  • A local Docker that runs with full system privileges. Anyone who can use that Docker can act as root on the machine. A rootless or remote Docker stops setup with exit_docker_not_local. It has been tried on Docker Engine on Linux, not on Docker Desktop.
  • Your own Anthropic or OpenAI API key. Subscription sign-in for a wrapped agent is not supported. The vendor bills you directly; Isonapse never pays for, resells or shares your usage.
  • What the easy install needs: a plain terminal window that runs no agent, an administrator account and the rest of the list in Install with the wizard and dashboard. The wrapped agent runs beside the Community Edition server and dashboard that setup starts.
  • Your machine, or one you may monitor. The exit reads the agent's traffic on your machine to apply your policy. If other people's sessions run through it, tell them, and check your privacy duties.

2. Wrap the agent

Run one of these in your own terminal:

isonapse setup --egress enforced --wrap claude-code
isonapse setup --egress enforced --wrap codex

Or, in the setup wizard, choose Run an agent behind the egress exit; the plan you approve in your terminal runs the same setup. Before it downloads anything, setup names the agent's npm package, its exact version and the registry, and the vendor's terms, and asks you to accept them. Then it builds the agent's image on your Docker, starts the exit, places the agent's API key, from its environment variable or typed once in your terminal, and finishes only after the agent's model provider answers through the exit and a direct connection is refused.

An exit runs one agent. To switch, add --replace; without it, setup stops with wrap_one_agent and changes nothing.

isonapse setup --egress enforced --wrap codex --replace

isonapse setup --status shows the setup's steps and whether the agent's key is placed.

3. Place or replace the key

To place the key later, or to replace a wrong, rotated or revoked one, use the dashboard or a terminal. This is the key the exit holds for the wrapped agent, not the agent's own sign-in on your machine, which stays as it is.

  • In the dashboard: on Hosts › Wrapped agent, choose Place key, or Replace key when the exit holds one, and type the key into the password field. It leaves the page only encrypted, and the page keeps nothing. Approve the plan with isonapse approve in your terminal: it shows the agent and "key placed" or "key replaced", never the key, and asks for the key's last 8 characters from your own copy.
  • In a terminal: type the key unseen. Add --from-env only when you mean to use the agent's environment variable.
isonapse agent key claude-code

The running exit uses the new key from the agent's next request, with no restart. A key is 20 to 2048 characters.

4. Choose the hosts it may reach

The wrapped agent reaches its model provider, api.anthropic.com for Claude Code or api.openai.com for Codex. Every other host is refused, in every mode, until you allow it. Each change asks for your password in your terminal; from the dashboard it is a plan you approve there. A host is an exact name: a wildcard, an address, a port or a path is refused.

  • Allow a host: Allow host on a refused request in Activity, or the command below. A rule in the exit's policy can still refuse an allowed host. Revoke under Allowed hosts, or the same command with --revoke, takes it back.
  • Ask before a host: Ask before under Allowed hosts, or the command below, for every request to the host or only for one method and path prefix. The exit then refuses each matching request until you approve it, with Approve once on Activity or isonapse egress answer <reference> with the reference the refusal names, within five minutes; the agent's next identical request then goes through once. An ask holds only a host the exit may reach, so allow the host first. Stop asking removes the rule.
  • See the list: Allowed hosts under Hosts › Wrapped agent, or isonapse egress hosts.
isonapse egress allow api.example.com
isonapse egress ask api.example.com --method POST --path /v1/files

Approve once and Allow host show only to administrators, in a browser paired with this machine.

5. Run it in a repository

cd ~/projects/my-app
isonapse agent run claude-code

The agent starts in your terminal, in the repository the current directory is in, or the one --repo names. Without a terminal, pass what the agent should do after --:

isonapse agent run codex --repo ~/projects/api -- exec "run the tests"
  • Your working tree is shared with the session, so the agent's file changes are there as it left them. Your .git is not writable in the session.
  • When the agent ends, or you run isonapse agent stop claude-code, its commits come back as the branch isonapse/<agent>/<session>. Review them with git log -p HEAD..isonapse/<agent>/<session>. Stop on the dashboard ends the session without bringing its commits back.
  • isonapse agent status shows the wrapped agent, how it is governed and its session.
  • One session runs at a time: a second isonapse agent run stops with agent_session_running. A session ends after 8 hours, or when the exit or Docker restarts; continue the conversation in a new session with claude --continue or codex resume --last.
  • Starting and stopping a session ask for no password: an account that can use Docker can already run containers.

Limits

  • A wrapped session is checked at the network only: its tool calls and file edits inside the container are not checked by Isonapse (isonapse agent status says network-governed (exit)). Your own tools may later run what it leaves in the working tree, such as package and build scripts, Git hooks under your own hooks path, editor and task files, or .envrc. Review its changes as you would someone else's. Your .git is readable in the session.
  • It needs a local Docker that runs with full system privileges. It has been tried on Docker Engine on Linux, not on Docker Desktop.
  • Subscription sign-in for a wrapped agent is not supported.
  • Wrapped Codex uses HTTPS only: the exit refuses WebSocket connections, so setup has Codex call OpenAI over HTTPS. A provider you set in Codex's own configuration inside the container replaces setup's, and a WebSocket it opens is refused.
  • Only the commits on the session's HEAD come back: other branches, tags and stashes made in the session do not. Bringing commits back needs Git 2.29 or later on your machine.
  • A linked worktree, a submodule checkout or a repository whose .git is a link cannot be the repository (agent_repo_unsupported). Git inside a submodule fails in the session, and there is no Git LFS filter.
  • Hermes Agent and pi cannot be wrapped.

The exit holds your key and reads the agent's traffic on your machine; Isonapse, the company, never receives your key or your prompts. Claude Code is a product of Anthropic, and Codex is a product of OpenAI. Isonapse is not affiliated with or endorsed by Anthropic or OpenAI.

Stuck? Help finds the message you see.