Overview
Before a container starts, clawker checks each enabled lane against the host: GPG key material and the gpg-agent socket, a reachable SSH agent, a git credential helper, and the
.gitconfig file. A lane the host cannot serve prints one warning on stderr; the container still starts, and that lane fails when it is used. Lanes you disable in config are not checked.
SSH Agent Forwarding
SSH agent forwarding lets the agent use your host SSH keys for Git operations, without exposing the private keys inside the container.SSH agent forwarding handles the authentication side (your keys). But the firewall must also allow SSH traffic to your Git host. By default, no SSH destinations are allowed. You need an explicit rule:The
clawker project init template includes this rule for GitHub. See the Firewall guide for more examples.- When a container starts, Clawker spawns a socket bridge daemon on the host
- The daemon uses
docker execto establish a muxrpc connection with a socket server inside the container - The container-side server creates a Unix socket at
~/.ssh/agent.sock SSH_AUTH_SOCKis set automatically inside the container- Git SSH operations (
git clone [email protected]:...) use the forwarded agent transparently
GPG Agent Forwarding
GPG forwarding lets the agent sign commits with your host GPG key. How it works:- The same socket bridge daemon handles GPG forwarding alongside SSH
- A socket is created at
~/.gnupg/S.gpg-agentinside the container - Your GPG public key is exchanged via the muxrpc protocol
- The container’s
gpg.confis configured withno-autostartto prevent a local GPG agent from conflicting
Git HTTPS Credential Forwarding
HTTPS credential forwarding lets the agent authenticate with Git remotes over HTTPS using your host’s credential store (e.g., macOS Keychain, Windows Credential Manager). How it works:- The host proxy daemon runs on your machine (default port 18374)
- Inside the container, a
git-credential-clawkerhelper is configured - When Git needs HTTPS credentials, the helper sends a request to the host proxy
- The host proxy queries your host’s native
git credential fillcommand - Credentials are returned to the container without being stored there
- The host proxy must be running (
security.enable_host_proxy: true) forward_httpsdefaults to follow theenable_host_proxysetting
Setting
forward_https: true has no effect if enable_host_proxy is false. HTTPS credential forwarding requires the host proxy.Git Config Copying
By default, Clawker copies your host~/.gitconfig into the container so Git operations use your name, email, aliases, and other settings.
Important: The credential.helper lines are filtered out during copying. This forces the container to use Clawker’s forwarded credential helpers instead of trying to access a host-side credential store that doesn’t exist inside the container.
Disable:
Harness Authentication
Host harness credentials — OAuth tokens, API keys stored in keyrings, credential files — are never copied into containers. Each container authenticates on its own:- On first run, the harness prompts for login (e.g.
/loginin Claude Code,codex loginfor Codex) - Browser-based OAuth flows are proxied to your host browser automatically — the container’s
BROWSERhandler forwards the auth URL through the host proxy, and the OAuth callback is forwarded back into the container - The resulting token is written to the harness’s config directory (e.g.
~/.claude,~/.codex), which is backed by a named Docker volume scoped to the harness that declared it (clawker.<project>.<agent>-<harness>.<name>, e.g.clawker.myapp.dev-claude.config) - The token persists across container restarts and recreates — any container reusing the same project + agent name with the same harness reuses the volume and stays authenticated. Switching harnesses gets its own volume, so each harness logs in once
Browser proxying requires the host proxy (
security.enable_host_proxy: true, the default). Without it, the harness still prints the auth URL — open it in your host browser manually.API Keys Instead of OAuth
For headless or CI-style workflows, forward an API key into the container through the environment plumbing instead of logging in interactively.agent.from_env/agent.env apply to every harness; the harnesses.<name> overlay applies only when that harness is selected:
env, env_file, and from_env layer on top of the agent base; on a key collision the harness value wins.
Config Strategy
Theharnesses.<name>.config.strategy setting controls how the harness’s configuration is initialized when a container’s config volume is first created:
copy(default) — Stages your host’s managed harness configuration into the fresh volume. For the claude harness this means settings (an allowlisted subset),CLAUDE.md, agents, skills, commands, and plugins (with host paths rewritten to container paths). Credentials are never part of this staging.fresh— Starts with a clean harness configuration; nothing is staged from the host.
clawker run/create — a pre-existing config volume carries your in-container state and is never re-seeded.
Full Configuration Example
Troubleshooting
SSH: “Permission denied (publickey)”
- Verify your SSH agent is running on the host:
ssh-add -l - Check that
forward_sshis enabled - Try restarting the container — the socket bridge daemon reconnects automatically
GPG: “No secret key” when signing commits
- Verify your GPG key is available on the host:
gpg --list-secret-keys - Check that
forward_gpgis enabled - The container’s GPG agent might have auto-started before the forwarded socket was ready. Restart the container to fix.
Git HTTPS: “Authentication failed”
- Verify the host proxy is running: check for the process or look at
~/.local/state/clawker/pids/hostproxy.pid - Verify credentials work on the host:
git credential fillwith your repo URL - Check that
enable_host_proxyandforward_httpsare both enabled
Harness prompts for login
A login prompt on a container’s first run is expected — containers never inherit host credentials. Authenticate once; the token persists in the config volume. If a previously authenticated container prompts again:- Check the config volume still exists (
clawker volume list) — removing it (orclawker volume prune) removes the stored token config.strategy: freshdoesn’t affect credentials, but recreating the agent under a new agent name creates a new (empty) config volume — a new login is expected