Dev Container and 1Password References
This guide covers what you need to know to work with the assistant. The full design (two users, release on the host, the infrastructure code guard) is in the Secure Infrastructure Workspace application.
The dev container
| Property | What it means for the assistant | Implemented by |
|---|---|---|
| One container per environment | A container clones only the repositories named in its start command, so it never holds another environment’s code | .devcontainer/<name>/devcontainer.json, sync-projects.sh |
Runs as vscode, no sudo |
The assistant cannot install system software or change root-owned files after creation | harden-user.sh |
| Managed assistant policy | The deny list and guard hooks are root-owned and cannot be switched off by the assistant | install-claude-policy.sh |
| No production container | Production is applied only by the pipeline, so no container, and no assistant, ever holds production access | tofu-guard.sh refuses prod |
| graphify installed, pinned | The knowledge-graph CLI the hooks call is root-owned and matches the skill’s version | install-graphify.sh |
| Separate engine user for infrastructure | OpenTofu runs as another user behind a code guard, so the assistant cannot read its environment | tofu-guard.sh, tofu-in-container.sh |
To add or change an infrastructure container, use the /dev-container-tofu skill. It holds the template, the checklist and an audit script.
Secrets as references
Every sensitive value lives in 1Password and is written as a reference, never as the value:
op://<vault>/<item>/<field>
A reference is not a secret, so it is committed and shown freely. A committed template maps variable names to references, for example deploy/infra/infra.opref:
<PROVIDER_API_TOKEN_VAR>=op://<vault>/<item>/<field>
<STATE_PASSPHRASE_VAR>=op://<vault>/<item>/<field>
The file holds no value, and its name avoids secret, token, credential and key, so the env-guard lets the assistant read it.
How a command gets a value
op run --env-file=deploy/infra/infra.opref -- tofu plan
op run resolves the references, starts one child command with the values in its environment only, and masks them in output. Nothing is exported to the shell and nothing is written to disk.
| The assistant may | The assistant may not |
|---|---|
Run op run [--env-file=<refs>] -- tofu init/plan/apply/validate/import or -- wrangler deploy/pages deploy/whoami |
Run op read, op item, op inject, op vault, op whoami or any other op subcommand |
Read and write *.opref files with references |
Read a resolved value, an item or a vault |
Presence-check the service identity with ${VAR:+x} |
Print, slice or pass on that identity |
| Write code that reads config from environment variables | Write code that calls op, a keychain or a cloud secret SDK |
The one secret in the workspace shell is the 1Password service identity. It is read-only, limited to one vault and expires. Application secrets never exist in the shell at all.
Writing config for a new service
- Put each sensitive value in 1Password, in the vault for that environment and role.
- Add a reference line to the project’s committed template, or to
.env.exampleas a reference, never a realistic-looking placeholder. - Service code reads the variable from its typed config, fails fast at boot if it is missing, and never logs it.
- Run the tool through
op run.
The full rule is .claude/rules/12-config-pointer-resolution.md.