Containerized agents with 1claw init --docker
Spin up a sandboxed agent container that runs MCP and a chat UI but never receives the agent key or any LLM provider key.
1claw init --docker provisions a complete agent runtime inside a Docker container in one command. The important property is what the container does not get: it never receives the agent API key or any LLM provider key. The host daemon injects credentials over a Unix-socket mount, which is the same trust boundary as local daemon mode.
- 1
Cloud mode is the default. It provisions an agent with Shroud and the Intents API enabled, a vault, and read policies on secrets/* and providers/*, then wires the chat UI to an LLM through Shroud.
bash1claw init --docker - 2
Run fully offline instead. No cloud account, no LLM: only the /help, /secrets, /info, and /proxy slash commands.
bash1claw init --docker --local - 3
Compose extensions from the bundled module catalog.
bash1claw init --docker --list-modules 1claw init --docker --module=langchain,onchain - 4
Manage the containers you have created.
bash1claw containers list 1claw containers logs <name> 1claw containers stop <name> - 5
Eject to a plain Dockerfile and docker-compose when you want to own the build.
bash1claw eject
The chat UI reaches an LLM through Shroud, and Shroud resolves the provider key from one of three sources in order: the container never holds it:
- 1Claw LLM token billing (default, no key at all): Shroud routes via the Stripe AI Gateway.
- The 1Claw cloud vault: pass --llm-api-key and it is stored at providers/<provider>/api-key for Shroud to fetch.
- A local CLI vault, for BYOK: the daemon injects it as the X-Shroud-Api-Key header.
Pick a model with --llm-provider (default openai) and --llm-model (default gpt-4o-mini). For framework-specific containers (LangChain, CrewAI, the OpenAI Agents SDK), use 1claw spawn with a template instead.
Ejecting hands you a Dockerfile and docker-compose you own outright. From that point the credential-injection wiring is yours to maintain, so re-check it before shipping to production.
What this gives you, and what it does not. The container is a strong boundary for credentials and a weak one for behaviour.
- The container never holds the agent key or a provider key. Credentials are injected by the host daemon over a socket mount, so the image can be shared without carrying secrets.
- It does not sandbox what the agent decides to do. A containerised agent with vault access and network egress has the same trifecta profile as any other; isolation of the process is not isolation of its authority.
- Ejecting transfers ownership. Once you have a Dockerfile of your own, the credential-injection wiring is yours to maintain, and it is the part most easily broken by a well-meaning refactor.
- Modules widen the surface. Each composed module brings its own dependencies into the image, which is the supply chain concern in a different wrapper.
Containerisation answers where the credential lives. It does not answer what the agent may do with it, and conflating the two is how a hardened container ends up running an over-privileged agent.
Decide
Your team runs `1claw eject` to get a Dockerfile they can customise, then adds a build step that copies the agent key into the image so the container can start without the host daemon.
What have they given up?
Check your understanding
3 questionsHow does the container get credentials if it never receives the agent key?
What does --local mode give up?
Which provider-key source requires no key at all?