use-native-credential-proxy
Use Native Credential Proxy
This skill adds a native, .env-based credential path for the container agent — an explicit opt-out of the OneCLI gateway. With it enabled, NanoClaw reads the Anthropic credential straight from .env and threads it into the container as standard environment variables, which the Claude Agent SDK reads natively. No OneCLI vault, no HTTPS proxy, no certificates.
Credential-home inversion — read this first. NanoClaw's default is that credentials live in the OneCLI agent vault and are injected per request, never threaded into the container via
-e. This skill deliberately inverts that: the credential lives in.envon the host and is passed into the container's environment. That inversion is the entire point of this skill (simple.envcredentials without OneCLI). Use it only if you accept that tradeoff; everywhere else in NanoClaw, env-threaded credentials are an anti-pattern.
The skill is additive: it ships its proxy logic and tests in this folder, copies them into src/, and makes a single one-line reach-in at the container-spawn seam (gated by an env flag). It does not remove or rewrite the OneCLI gateway — when the flag is unset, the gateway path is exactly as it was, and the native proxy is a no-op.
How it works
src/native-credential-proxy.tsexportsnativeCredentialEnvArgs(). It readsANTHROPIC_API_KEY/ANTHROPIC_AUTH_TOKEN/CLAUDE_CODE_OAUTH_TOKEN(and optionalANTHROPIC_BASE_URL) from.envvia core'sreadEnvFile, and returns the Docker-e VAR=valuearguments.- All gating lives inside that function: it returns an empty array unless
NANOCLAW_NATIVE_CREDENTIALS=true. So the reach-in in core is a single unconditionalargs.push(...nativeCredentialEnvArgs()). - The seam is
buildContainerArgsinsrc/container-runner.ts, right after theTZenv line — the same place container env vars are assembled, just before the OneCLI gateway is applied. With the flag on, the direct credential env vars take precedence in the container; with it off, nothing changes.