Custom CLI Docker sandbox
Run any agent CLI from a Dagu Docker sandbox.
A custom harness provider maps a CLI binary, fixed arguments, and prompt placement into Dagu's harness.run step. Use this for internal agents, wrapper scripts, or providers that are not built into Dagu.
type: graph
harnesses:
review_agent:
binary: review-agent
prefix_args:
- run
prompt_mode: arg
steps:
- id: review
action: harness.run
container:
image: dagu-review-agent:local
pull_policy: never
working_dir: /workspace
volumes:
- .:/workspace:ro
env:
- REVIEW_AGENT_TOKEN=${REVIEW_AGENT_TOKEN}
with:
provider: review_agent
prompt: |
Review this repository.Defines provider binaries under top-level harnesses.
Supports prompt_mode: arg for CLIs that take the prompt as an argument.
Supports prompt_mode: flag for CLIs that require a prompt flag.
Containerized harness.run does not use stdin prompt mode.
Provider definition
The provider name in with.provider must match an entry under top-level harnesses. The image must contain the configured binary in PATH.
Prompt as argument
Use prompt_mode: arg when the CLI accepts the prompt as the final command-line argument. Dagu builds a command shaped like review-agent run "Review this repository."
Prompt as flag
Use prompt_mode: flag when the CLI expects a named prompt flag.
harnesses:
review_agent:
binary: review-agent
prefix_args:
- run
prompt_mode: flag
prompt_flag: --promptContainer requirements
The runner image needs the provider binary, its runtime, expected helper tools, and any writable home or cache directory. Pass credentials with container.env or mount the files the provider reads.
More sandbox pages
Custom CLI Docker sandbox
Verify the Docker sandbox with a shell provider first.
Codex in DockerUse a built-in provider when the runner image contains Codex.
Claude Code in DockerUse a built-in provider when the runner image contains Claude Code.
OpenCode in DockerUse a built-in provider when the runner image contains OpenCode.