Repository navigation
Adapter Dev Container
The Dev Container adapter (harness devcontainer) discovers Dev
Container configuration statically. It never builds an image, pulls or
installs a Feature, starts a container, runs a lifecycle command, expands
${localEnv:...} or ${containerEnv:...} variables, or invokes git or
docker. Every repository file is treated as attacker-controlled.
Dev Container configuration is not tied to one agent: Codespaces,
Copilot cloud agents, VS Code, Cursor, and the devcontainer CLI all run
it when they open the repository in a container. It is therefore its own
harness rather than part of a product adapter, and it runs whenever it is
detected or --harness devcontainer is given.
Repository scope only (--scope repo, the default). There is no user or
managed Dev Container configuration.
| Location | Normalized kinds |
|---|---|
.devcontainer/devcontainer.json |
env-setup |
.devcontainer/<name>/devcontainer.json (one level deep) |
env-setup |
.devcontainer.json (repository root) |
env-setup |
These are the locations the tooling offers, all at the repository root;
a .devcontainer/ in a subdirectory, or a configuration nested deeper
than one level, is not read. Path matching is case-insensitive.
Every key below also carries a trailing content digest of the full
sanitized entry, and, when sanitizing removed anything, a
secret discriminator (sig:k1: with a
fingerprint key, sig:s1: without one); see
fingerprint.md.
- Lifecycle commands.
initializeCommandruns on the host, before the container exists, so it executes with the developer's privileges and outside any container isolation; future rules are intended to treat it at high severity.onCreateCommand,updateContentCommand,postCreateCommand,postStartCommand, andpostAttachCommandrun in the container. One item per command:{"setting", "form", "name", "command", "runs_on"}, key["lifecycle", setting, name].- A string (
"form": "string") runs through a shell;commandis the sanitized string. - An array (
"form": "array") is an argv run without a shell;commandis sanitized element by element, with tool-specific credential flags redacted using the shared tool-flag table. - An object (
"form": "object") runs each named entry in parallel; one item per entry, withnameset,commandbeing that entry's string or array. - Any other value is emitted as
{"form": "other", "value"}and reported.
- A string (
- Features (
features): one item per Feature,{"setting": "features", "feature", "options"}, key["feature", reference]. A Feature is an install script fetched from an OCI registry, a tarball URL, or a local directory and run as root during the image build. - Environment (
containerEnv,remoteEnv): one item per map,{"setting", "value", "env_keys"}, with values redacted like MCP serverenvvalues. -
runArgs(arguments todocker run): sanitized as an argv with the shared tool-flag and credential rules. The value of any credential-namedNAME=VALUEelement (SECRET_KEY,DB_PASS,API_KEY, ...) is redacted, whether it follows-e,--env,--env=, or another flag such as--name, and also in docker's glued-eNAME=VALUEform. - Settings: one
{"setting", "value"}item per present key ofimage,build,dockerFile,context,dockerComposeFile,service,runServices,mounts,workspaceMount,workspaceFolder,privileged,capAdd,securityOpt,init,customizations,overrideFeatureInstallOrder,remoteUser,containerUser,updateRemoteUserUID,userEnvProbe,overrideCommand,shutdownAction, andwaitFor, the value sanitized and secret-looking members (build.args.NPM_TOKEN) redacted. Other keys (name,forwardPorts,hostRequirements, ...) are not emitted.
devcontainer.json is parsed as JSONC (comments and trailing commas).
Duplicate keys use the last value and are reported. Keys that differ only
by case are reported, except in containerEnv, remoteEnv, and
build.args: those names are case-sensitive, so http_proxy and
HTTP_PROXY are distinct keys and are both kept. An exact duplicate in
those objects is still reported. Nesting deeper than 64 levels, and files larger
than 1 MiB, fail closed with a diagnostic.
Reads, symlink handling, limits, and diagnostics are those of the
Claude adapter. An escaping symlink under
.devcontainer/ or at .devcontainer.json is reported once, by this
adapter.
- The
Dockerfileand Docker Compose files a configuration references. - Feature sources (
devcontainer-feature.jsonandinstall.shof a local Feature, or the contents of a remote one). -
.devcontainer/devcontainer-lock.json. - Templates (
devcontainer-template.json). -
.github/dependabot.ymlentries for Dev Container Features.
This wiki is generated from docs/ on main by cmd/wikigen. Do not edit it here: change docs/ and open a pull request. Apache-2.0.
Start
Commands
CI and hooks
Configuration
Adapters
- Claude Code
- Codex
- Cursor
- GitHub Copilot
- Gemini CLI
- OpenCode
- Windsurf
- Devin
- Dev Container
- Shared Files
Project