Installation
copilot plugin marketplace add samueltauil/skills-hub
copilot plugin install docker-agent-config@skills-hub
Works with GitHub Copilot CLI and VS Code (enable chat.plugins.enabled).
Plugin docker-agent-config v1.0.0 follows the Agent Plugins spec.
gh skills-hub install docker-agent-config Don't have the extension? Run gh extension install samueltauil/skills-hub first.
Download and extract to your repository:
.github/skills/docker-agent-config/ Extract the ZIP to .github/skills/ in your repo. The folder name must match docker-agent-config for Copilot to auto-discover it.
Skill Files (8)
SKILL.md 9.9 KB
---
name: docker-agent-config
description: Use this skill when creating or editing an agent.yaml (or .yml/.hcl) configuration file for Docker Agent (cagent), including defining agents, models/providers, built-in or MCP toolsets, multi-agent teams with sub_agents. Even if the user just says they want to "build an AI agent with Docker", "make a coding agent config", "add a tool to my agent", or "set up a team of agents", this skill applies. Covers agent properties (model, instruction, toolsets, sub_agents, fallback), the models/providers sections, built-in toolsets (filesystem, shell, think, todo, memory, fetch), MCP toolset references, and named commands.
license: Apache-2.0
compatibility: Requires the docker-agent CLI plugin (Docker Desktop 4.63+, or standalone via Homebrew/GitHub releases). Verified against docker-agent as shipped with Docker CLI 29.7.2. Config directories still use the legacy `cagent` name (`~/.config/cagent`, `~/.cagent`).
---
# Docker Agent Configuration
## Overview
Docker Agent (the CLI is `docker agent`, the open-source project is `cagent`)
runs AI agents declared in a YAML file instead of application code. This
skill owns the `agent.yaml` artifact: the `agents` section (each entry's
`model`, `instruction`, and its own `toolsets`/`sub_agents`), the top-level
`models`/`providers` sections referenced from agents, and a top-level
`commands` group agents can opt into with `use_commands`. It does not cover
invoking the CLI or serving/sharing the config — see Related
skills.
## When to use this skill
Activate this skill when:
- The user is creating, editing, or reviewing an `agent.yaml`/`agent.yml`/`agent.hcl` file.
- The user wants to add a tool/toolset, an MCP server, or a sub-agent to an agent config.
- The user wants to choose or configure a model/provider (OpenAI, Anthropic, Google, Bedrock, Docker Model Runner, custom endpoint) for an agent.
- The user wants a multi-agent "team" with a coordinator delegating to specialists.
## Do not use this skill when
Do not use this skill when:
- The task is about running the CLI (`docker agent run` flags, `--safety`, `--sandbox`, aliases, worktrees) — use `docker-agent-run`.
- The task is about exposing an agent as a server (`serve mcp/api/a2a/acp/chat`), distributing it (`share push/pull`), or evaluating it (evaluation sessions, `--baseline` regression gates) — use `docker-agent-deploy`.
- The task is about a generic Dockerfile or Compose service unrelated to Docker Agent — use `docker-build-strategies` or `docker-compose-patterns`.
## Core guidance
### File structure
- Every config needs at least one agent under top-level `agents:`. The agent
named `root`, or the first agent defined, is the entry point that receives
user messages.
```yaml
agents:
root:
model: anthropic/claude-sonnet-4-5
description: A coding assistant
instruction: |
You are an expert developer. Help users write clean,
efficient code. Explain your reasoning step by step.
toolsets:
- type: filesystem
- type: shell
- type: think
```
- Required agent properties: `model`, `description`, `instruction` (or
`instruction_file`). `description` is not decoration — other agents read it
to decide whether to delegate to this one, so keep it accurate.
- Use `instruction_file` (a relative path, no `..`) instead of an inline
`instruction` for long prompts; this keeps diffs focused on behavior, not
YAML escaping. `instruction` and `instruction_file` are mutually exclusive.
`instruction_file` is not supported for agents loaded from an OCI reference
or URL — inline `instruction` there.
### Models and providers
- Two ways to set a model: inline `provider/model` shorthand, or a named
entry under top-level `models:` referencing a `provider`. Use the named
form whenever you need `temperature`, `max_tokens`, `thinking_budget`, or
reuse across agents.
```yaml
models:
claude:
provider: anthropic
model: claude-sonnet-4-5
max_tokens: 64000
agents:
root:
model: claude
```
- Built-in provider keys: `openai`, `anthropic`, `google`, `amazon-bedrock`,
`dmr` (Docker Model Runner, local, no API key), `ollama` (local). Dozens of
additional built-in aliases exist (`mistral`, `groq`, `xai`, `together`,
`azure`, `github-copilot`, `openrouter`, ...) — each needs its own
`<PROVIDER>_API_KEY`-style env var; run `docker agent models --all` to see
what's resolvable, and `docker agent setup` to register credentials
interactively instead of hand-editing env vars.
- Never hardcode an API key in `agent.yaml`. Provider credentials come from
environment variables (`token_key` for custom providers) or from
`~/.config/cagent/.env` written by `docker agent setup`.
- Prefer `dmr/<model>` for agents that must run offline or must not send data
to a third party; it costs nothing and needs no credential. The model must
be pulled locally first with `docker model pull <model>` — run
`docker agent doctor` to diagnose missing or unavailable models. Use a paid
cloud provider only when the task needs it.
- Give resilience-critical agents a `fallback` so a provider outage or rate
limit does not stop the run:
```yaml
agents:
root:
model: anthropic/claude-sonnet-4-5
fallback:
models: [openai/gpt-5, google/gemini-3.5-flash]
retries: 2 # per model, for 5xx errors
cooldown: 1m # stick with fallback after a 429
```
- For a self-hosted/OpenAI-compatible endpoint (vLLM, LiteLLM, a corporate
gateway), define a `providers:` entry with `base_url` and `token_key`
rather than putting the URL inline on every model:
```yaml
providers:
my_gateway:
base_url: https://api.example.com/v1
token_key: MY_API_KEY
models:
my_model:
provider: my_gateway
model: gpt-4o
```
### Toolsets
- Built-in toolsets need no external dependency: `filesystem`, `shell`,
`think`, `todo`, `tasks`, `memory`, `fetch`, `background-jobs`, `script`,
`lsp`, `api`. Add one per list entry:
```yaml
toolsets:
- type: filesystem
- type: shell
```
- If an agent only describes a plan but never executes it, add `type: todo`
(or `shell`) — a common symptom of an agent missing the tool it needs to
act, not a model problem.
- For external tools, prefer an MCP server from Docker's MCP catalog over a
bespoke integration — it runs containerized and is reusable across agents:
```yaml
toolsets:
- type: mcp
ref: docker:duckduckgo
```
Local stdio and remote HTTP/SSE MCP servers are also supported; see
`references/toolsets-and-providers.md`.
- Use `defer: true` on a toolset (MCP or otherwise) to load its tools
on-demand instead of at startup, when the agent has many toolsets and
startup latency matters.
- Set `readonly: true` on an agent to restrict every toolset it uses to
read-only tools — use this for reviewer/analysis agents that must not
mutate anything.
### Multi-agent teams
- A coordinator delegates via `sub_agents: [name, ...]`; listing sub-agents
automatically enables the `transfer_task` tool on the parent.
```yaml
# Fragment: coder and reviewer are defined separately in the full asset.
agents:
root:
sub_agents: [coder, reviewer]
```
Use `assets/team-agent.yaml` for the complete runnable team, including
the reviewer's `readonly: true` restriction. Keep that restriction when
adapting the template; a filesystem toolset alone also exposes writes.
- `sub_agents` also accepts external OCI references (`myorg/agent:tag`).
Pin external references to a digest (`name@sha256:...`) in production
configs to skip the per-run registry lookup that a tag incurs.
- Use `transfer_task` (via `sub_agents`) for delegation with a clean,
isolated result; use a `commands:` entry with an `agent:` field only when
you want the user to *become* that agent for the rest of the session.
### Safety and hygiene
- Set `redact_secrets: true` on any agent that runs shell/fetch tools against
untrusted input. It scrubs recognized secret patterns from tool arguments,
outgoing messages, and tool output. This is defense in depth, not a
guarantee: arbitrary passwords, tokens, or customer data may go undetected.
- Set `max_iterations` on any agent that loops autonomously (default is
unlimited) to bound cost and prevent runaway loops; `max_consecutive_tool_calls`
(default 5) already guards against identical-call loops.
- Keep credentials, tokens, and sensitive customer data out of `instruction`,
`instruction_file`, and command prompts, whether literal or interpolated.
`${env.VAR}` expands values into prompt text sent to the model; storing a
value in an env file does not prevent this disclosure. Use interpolation
only for non-sensitive context.
- Supply provider credentials through `docker agent setup` or the provider's
supported environment variables. For custom providers, `token_key: MY_API_KEY`
names the environment variable, not its value; do not interpolate it.
Configure tool/MCP credentials through that integration's authentication
mechanism, not through prompts or model-supplied tool arguments. Prompts
should describe the authenticated capability without containing its secret.
Do not ask the agent to read or print credential files or environment values
to check authentication.
## Related skills
- For running the agent (`docker agent run`, safety modes, sandbox, aliases), use `docker-agent-run`.
- For serving, sharing, or evaluating the agent, use `docker-agent-deploy`.
## References
- `references/toolsets-and-providers.md` — full built-in toolset list, MCP connection modes, and the provider/env-var table.
- `references/sources.md` — provenance of every rule in this skill.
## Assets
- `assets/team-agent.yaml` — a runnable multi-agent team template (coordinator + coder + reviewer).
## Checks
- Before running an agent, follow `checks/verification.md` to confirm its
resolved config, exposed tools, and provider connectivity, then smoke-test it.
skill.yaml 1.0 KB
schema: v1
id: docker-agent-config
version: 0.1.3
title: Docker Agent Configuration
description: Reference and rules for authoring agent.yaml configs for Docker Agent (cagent) — agents, models, providers, toolsets, and multi-agent teams.
owns:
- agent.yaml
- agent.yml
- agent.hcl
- docker-agent-model-config
- docker-agent-toolsets
- docker-agent-multi-agent-teams
use_when:
- The main artifact being created, edited, or reviewed is an agent.yaml/agent.yml/agent.hcl file for Docker Agent.
- The task is adding, removing, or configuring a model, provider, or toolset (built-in or MCP) on an agent.
- The task is designing a multi-agent team with a coordinator and sub_agents.
do_not_use_when:
- The main task is invoking docker agent run and choosing CLI flags such as --safety or --sandbox.
- The main task is serving an agent over MCP/API/A2A/chat, sharing it via a registry, or evaluating it.
- The main task is a generic Dockerfile or Compose file unrelated to Docker Agent.
delegates_to:
- docker-agent-run
- docker-agent-deploy
openai.yaml 0.4 KB
interface:
display_name: Docker Agent Configuration
short_description: Reference and rules for authoring agent.yaml configs for Docker Agent (cagent) — agents, models, providers, toolsets, and multi-agent teams.
default_prompt: Use this skill when creating or editing an agent.yaml configuration file for Docker Agent.
policy:
allow_implicit_invocation: true
team-agent.yaml 0.9 KB
# A runnable multi-agent team: coordinator delegates to a coder and a reviewer.
# Run with: docker agent run ./team-agent.yaml
agents:
root:
model: openai/gpt-5
description: Team coordinator that routes tasks to the best specialist.
instruction: |
You are a project coordinator. Delegate coding tasks to `coder` and
code-quality checks to `reviewer`. Summarize their results for the user.
sub_agents: [coder, reviewer]
coder:
model: anthropic/claude-sonnet-4-5
description: Writes and modifies code.
instruction: Write clean, tested code. Explain non-obvious decisions briefly.
toolsets:
- type: filesystem
- type: shell
reviewer:
model: anthropic/claude-sonnet-4-5
description: Reviews code for bugs, style, and best practices.
instruction: Review code for correctness, security, and maintainability.
readonly: true
toolsets:
- type: filesystem
verification.md 2.2 KB
# Verification Runbook for agent.yaml
Before resolving a config or contacting a model:
- Inspect `instruction`, `instruction_file`, and command prompts for literal
secrets or interpolated sensitive values. An env-file reference does not
keep a value out of the resolved prompt.
- Confirm provider and tool/MCP credentials use their authentication mechanisms;
a custom provider's `token_key` must name an environment variable, not expand
its value into the config.
- Use throwaway values when testing interpolation. Do not print real credentials
in resolved config output or send them to a model as a test. Secret redaction
is pattern-based defense in depth, not proof that prompts contain no secrets.
## 1. The config resolves without errors
```bash
docker agent debug config ./agent.yaml
```
Pass: prints the fully-resolved YAML (defaults applied, provider/model
references resolved, `instruction_file` inlined). Fail: an error naming the
missing/invalid key — fix that key and rerun.
## 2. Every declared toolset actually exposes tools
```bash
docker agent debug toolsets ./agent.yaml
```
Pass: each agent lists at least the tools you expect (e.g. `filesystem` shows
`read_file`, `write_file`, `list_directory`; an MCP `ref:` shows the remote
server's tools). Fail (empty list for one agent, or an MCP ref shows none):
the `ref:` is wrong, the MCP server needs credentials, or the toolset type is
misspelled — check `references/toolsets-and-providers.md`.
## 3. The model/provider is reachable
```bash
docker agent doctor ./agent.yaml
```
Pass: reports the resolved model and provider as reachable, with credentials
found. Fail: "No model is currently available" — use `docker-agent-run` for
credential/DMR-model troubleshooting, then rerun this check. For a named-provider
configuration error, recheck `models:`/`providers:` spelling against
`docker agent debug config`.
## 4. A minimal smoke run behaves as instructed
```bash
docker agent run --exec ./agent.yaml "Say hello and list your tools"
```
Pass: the agent responds without a tool-call error and, if `toolsets` are
set, the tools it names match what `docker agent debug toolsets` reported.
Fail: a tool-call error naming a toolset — the toolset's `command`/`ref` is
misconfigured.
docker-agent-config.md 5.2 KB
# Eval: docker-agent-config
Skill under test: `skills/docker-agent-config/`
---
## Prompt 1: New coding agent from scratch
**Prompt to agent:**
> I want to build an AI agent with Docker that can read/write files and run shell commands, using Claude. Write me the agent.yaml.
>
> (AUTOMATED EVAL: You MUST NOT ask questions or request clarification. Proceed immediately with best-practice defaults. Create all necessary files even if the workspace appears empty.)
### Expected behaviors
- [ ] Produces a valid `agent.yaml` with a top-level `agents:` key and at least a `root` agent.
- [ ] Sets a valid model (e.g., `model: anthropic/claude-sonnet-4-5`, `model: claude`, or a named model), `description`, and `instruction`.
- [ ] Adds `toolsets: [{type: filesystem}, {type: shell}]`.
- [ ] Does not hardcode an `ANTHROPIC_API_KEY` value in the YAML.
### Must not
- [ ] Must NOT put a literal API key string inside `agent.yaml`.
- [ ] Must NOT recommend `docker agent run --safety autonomous`/`--yolo` as the way to "make it work" without mentioning the tradeoff.
### Verification commands
```bash
docker agent debug config ./agent.yaml
docker agent debug toolsets ./agent.yaml
```
---
## Prompt 2: Multi-agent team with a coordinator
**Prompt to agent:**
> Add a reviewer sub-agent to my coding agent that can only read files, not write them, and have the main agent delegate review tasks to it.
>
> (AUTOMATED EVAL: You MUST NOT ask questions or request clarification. Proceed immediately with best-practice defaults. Create all necessary files even if the workspace appears empty.)
### Expected behaviors
- [ ] Adds a `reviewer` agent with read-only capabilities (e.g., `readonly: true` or
limited toolset without write tools).
- [ ] Adds `sub_agents: [reviewer]` on the coordinator/root agent or explains
how to delegate tasks to the sub-agent.
### Must not
- [ ] Must NOT give the reviewer a `shell` toolset (contradicts "can only read").
### Verification commands
```bash
docker agent debug config ./agent.yaml
docker agent debug toolsets ./agent.yaml
```
---
## Prompt 3: Local/offline model requirement
**Prompt to agent:**
> I'm configuring my Docker Agent and this agent must never send data to a third party. What model provider should I use in my agent.yaml?
>
> (AUTOMATED EVAL: You MUST NOT ask questions or request clarification. Proceed immediately with best-practice defaults. Create all necessary files even if the workspace appears empty.)
### Expected behaviors
- [ ] Recommends `dmr` (Docker Model Runner) as the local, no-credential provider.
- [ ] Shows an example `model: dmr/<model>` or a named model with `provider: dmr`.
### Must not
- [ ] Must NOT recommend a cloud provider (OpenAI/Anthropic/Google) as satisfying the "never send data to a third party" constraint.
### Verification commands
```bash
docker agent debug config ./agent.yaml
docker agent doctor ./agent.yaml
```
---
## Prompt 4: Keep authentication secrets out of prompts
**Prompt to agent:**
> My agent uses a custom model gateway and an authenticated MCP service. Can I put their API keys and sensitive customer records in instruction or command prompts using ${env.VAR} so they stay out of Git? Is redact_secrets enough to make that safe?
>
> (AUTOMATED EVAL: You MUST NOT ask questions or request clarification. Proceed immediately with best-practice defaults. Create all necessary files even if the workspace appears empty.)
### Expected behaviors
- [ ] Explains that environment interpolation expands values into prompt text sent to the model; keeping values out of Git does not keep them out of prompts.
- [ ] Keeps credentials and sensitive customer data out of `instruction`, `instruction_file`, and command prompts, both literal and interpolated.
- [ ] Uses provider authentication configuration, with `token_key: MY_API_KEY` naming the environment variable rather than expanding its value.
- [ ] Routes MCP credentials through the integration's authentication mechanism, not prompts or model-supplied tool arguments.
- [ ] Treats `redact_secrets` as pattern-based defense in depth; arbitrary passwords, tokens, or customer data may not be recognized.
- [ ] Allows interpolation for non-sensitive context; does not prohibit environment-backed authentication.
### Must not
- [ ] Must NOT present an env file or `${env.VAR}` as protection against prompt disclosure.
- [ ] Must NOT ask the agent to read, echo, or print real credentials to verify authentication.
- [ ] Must NOT claim `redact_secrets` guarantees removal of all secrets or customer data.
### Verification
Review the generated guidance and config without invoking a model or authenticating
against a live service. Use throwaway values only if checking interpolation; never
send real credentials to a provider or include them in diagnostic output. Follow
[the preflight checks](../checks/verification.md)
before running the config. Static checks in `eval-checks.yaml` guard the checked-in
skill wording; they do not evaluate live model behavior or redaction completeness.
---
## Should not trigger
- "How do I run this agent in a sandbox?" → `docker-agent-run`
- "How do I expose this agent as an MCP server for Claude Desktop?" → `docker-agent-deploy`
- "How do I push this agent to Docker Hub?" → `docker-agent-deploy`
sources.md 1.8 KB
# Sources
- `docker agent --help`, `docker agent new --help`, `docker agent setup --help`, `docker agent debug --help`, `docker agent debug config --help`, `docker agent debug toolsets --help`, `docker agent models --help` — verified locally against docker-agent as shipped with Docker CLI 29.7.2.
- https://docs.docker.com/ai/docker-agent/concepts/agents/ — agent properties table, root agent, model fallbacks, named commands.
- https://docs.docker.com/ai/docker-agent/configuration/agents/ — full agent config schema (skills, hooks, compaction, redact_secrets, prompt files).
- https://docs.docker.com/ai/docker-agent/configuration/overview/ — variable expansion in prompt/text fields, including `${env.VAR}`; `token_key` takes an environment variable name rather than an expanded value.
- https://docs.docker.com/ai/docker-agent/guides/secrets/ — authentication credential handling and pattern-based redaction as defense in depth, not a guarantee against all secret leaks.
- https://docs.docker.com/ai/docker-agent/providers/overview/ — supported providers, quick comparison table, additional built-in provider aliases and their env vars.
- https://docs.docker.com/ai/docker-agent/providers/custom/ — `providers:` section, provider properties, shorthand syntax, global providers in `~/.config/cagent/config.yaml`.
- https://github.com/docker/docker-agent/blob/main/docs/index.md — top-level concepts, "why Docker Agent", MCP catalog and Docker Model Runner composition, glossary (Agent, Tool, MCP, A2A, TUI, OCI).
- https://docs.docker.com/ai/docker-agent/ — product overview, install paths (Docker Desktop 4.63+, Homebrew, winget, GitHub releases), example agent.yaml.
- https://docs.docker.com/ai/docker-agent/community/troubleshooting/ — "No model is currently available" / "model ... is not pulled" pitfalls and `docker agent doctor` usage.
toolsets-and-providers.md 3.3 KB
# Toolsets and providers reference
## Built-in toolsets
Add by `type:` under an agent's `toolsets:` list — no external dependency required.
| type | Gives the agent |
| --- | --- |
| `filesystem` | Read, write, list, search, navigate files and directories |
| `shell` | Execute shell commands synchronously |
| `background-jobs` | Run and manage long-running shell commands |
| `think` | Step-by-step reasoning scratchpad for planning/decision-making |
| `todo` | Task list management for multi-step workflows |
| `tasks` | Persistent task database shared across sessions |
| `memory` | Persistent key-value storage backed by SQLite (`save_memory`, `search_memories`) |
| `fetch` | Read content from HTTP/HTTPS URLs (GET only) |
| `script` | Define custom shell scripts as named tools |
| `lsp` | Connect to Language Server Protocol servers for code intelligence |
| `api` | Create custom tools that call HTTP APIs without writing code |
Source: https://docs.docker.com/ai/docker-agent/configuration/tools/ (linked from https://docs.docker.com/ai/docker-agent/concepts/tools/).
## MCP toolsets — three connection modes
1. **Docker MCP (recommended)** — runs the MCP server in a container via the
MCP Gateway; browse servers at https://hub.docker.com/search?q=&type=mcp.
```yaml
toolsets:
- type: mcp
ref: docker:duckduckgo
```
2. **Local MCP (stdio)** — runs an MCP server as a local process over
stdin/stdout.
3. **Remote MCP (Streamable HTTP / SSE)** — connects to an MCP server over
the network; see Remote MCP Servers docs for OAuth details.
Add `defer: true` to any MCP toolset entry to load its tools lazily instead
of at agent startup.
Source: https://docs.docker.com/ai/docker-agent/concepts/tools/ (MCP Tools section).
## Providers and required credentials
| Provider key | Local? | Credential |
| --- | --- | --- |
| `openai` | No | `OPENAI_API_KEY` |
| `anthropic` | No | `ANTHROPIC_API_KEY` |
| `google` | No | `GOOGLE_API_KEY` |
| `amazon-bedrock` | No | AWS credentials |
| `dmr` (Docker Model Runner) | Yes | None — model must be pulled with `docker model pull` |
| `ollama` | Yes | None (optional `base_url`) |
| `mistral` | No | `MISTRAL_API_KEY` |
| `groq` | No | `GROQ_API_KEY` |
| `xai` | No | `XAI_API_KEY` |
| `together` | No | `TOGETHER_API_KEY` |
| `deepseek` | No | `DEEPSEEK_API_KEY` |
| `azure` | No | `AZURE_API_KEY` + `base_url` |
| `github-copilot` | No | `GITHUB_TOKEN` (PAT with `copilot` scope) |
| `chatgpt` | No | None — sign in via `docker agent setup` |
| custom OpenAI-compatible | depends | `token_key` env var + `base_url` you define under `providers:` |
This is not exhaustive — credential requirements can vary by alias and by
version; run `docker agent models --all` for the authoritative,
installed-version list. Source: https://docs.docker.com/ai/docker-agent/providers/overview/.
## Named models vs inline models
- Inline: `model: openai/gpt-5` directly on the agent — quick, no reuse.
- Named: define under top-level `models:`, referencing a `provider:` and
`model:`, then set `temperature`, `max_tokens`, `thinking_budget`, etc.
Reference it by name from any agent. Prefer named models once more than
one parameter needs tuning or more than one agent shares the model.
Source: https://docs.docker.com/ai/docker-agent/concepts/models/ (linked from
https://docs.docker.com/ai/docker-agent/concepts/agents/).
License (Apache-2.0)
View full license text
Licensed under the Apache License, Version 2.0. See https://github.com/docker/skills/blob/main/LICENSE