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.

Custom provider in Docker
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.

01

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.

02

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."

03

Prompt as flag

Use prompt_mode: flag when the CLI expects a named prompt flag.

Flag prompt mode
harnesses:
  review_agent:
    binary: review-agent
    prefix_args:
      - run
    prompt_mode: flag
    prompt_flag: --prompt
04

Container 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.