Providers
Built-in provider IDs, launch commands, config overrides, and custom provider setup for AGH agents.
- Audience
- Operators running durable agent work
- Focus
- Agents guidance shaped for scanability, day-two clarity, and operator context.
A provider is the ACP-compatible command AGH launches for an agent. The provider owns the actual LLM integration. AGH owns definition resolution, process lifecycle, workspace boundaries, permissions, MCP server wiring, and event persistence.
Provider IDs appear in AGENT.md:
---
name: implementation
provider: codex
---
You implement scoped changes and verify them before handoff.Or they can be selected globally:
[defaults]
agent = "general"
provider = "claude"Built-in providers
The built-in registry lives in internal/config/provider.go.
| Provider ID | Harness | Runtime provider | Command | Default model | Credential target |
|---|---|---|---|---|---|
claude | acp | claude | npx -y @agentclientprotocol/claude-agent-acp@latest | claude-sonnet-4-6 | ANTHROPIC_API_KEY |
codex | acp | codex | npx -y @zed-industries/codex-acp@latest | gpt-5.4 | OPENAI_API_KEY |
gemini | acp | gemini | gemini --acp | gemini-3.1-pro-preview | GEMINI_API_KEY |
opencode | acp | opencode | npx -y opencode-ai@latest acp | none | none |
copilot | acp | copilot | copilot --acp --stdio | none | none |
cursor | acp | cursor | cursor-agent acp | none | none |
kiro | acp | kiro | kiro-cli-chat acp | none | none |
blackbox | acp | blackbox | blackbox --experimental-acp | none | BLACKBOX_API_KEY |
cline | acp | cline | npx -y cline@latest --acp | none | none |
goose | acp | goose | goose acp | none | none |
hermes | acp | hermes | hermes acp | none | none |
junie | acp | junie | junie --acp true | none | none |
kimi-cli | acp | kimi-cli | kimi acp | none | KIMI_API_KEY |
openclaw | acp | openclaw | openclaw acp | none | none |
openhands | acp | openhands | openhands acp | none | none |
qoder | acp | qoder | npx -y @qoder-ai/qodercli@latest --acp | none | QODER_PERSONAL_ACCESS_TOKEN |
qwen-code | acp | qwen-code | npx -y @qwen-code/qwen-code@latest --acp --experimental-skills | qwen3.6-plus | none |
pi | pi_acp | anthropic | npx -y pi-acp@latest | claude-opus-4-7 | ANTHROPIC_API_KEY |
openrouter | pi_acp | openrouter | npx -y pi-acp@latest | openai/gpt-5.4 | OPENROUTER_API_KEY |
zai | pi_acp | zai | npx -y pi-acp@latest | glm-4.6 | ZAI_API_KEY |
moonshot | pi_acp | kimi-coding | npx -y pi-acp@latest | kimi-k2-thinking | KIMI_API_KEY |
vercel-ai-gateway | pi_acp | vercel-ai-gateway | npx -y pi-acp@latest | anthropic/claude-opus-4-7 | AI_GATEWAY_API_KEY |
xai | pi_acp | xai | npx -y pi-acp@latest | grok-4-fast-non-reasoning | XAI_API_KEY |
minimax | pi_acp | minimax | npx -y pi-acp@latest | MiniMax-M2.1 | MINIMAX_API_KEY |
mistral | pi_acp | mistral | npx -y pi-acp@latest | devstral-medium-latest | MISTRAL_API_KEY |
groq | pi_acp | groq | npx -y pi-acp@latest | openai/gpt-oss-120b | GROQ_API_KEY |
Provider config fields
Provider overrides and custom providers are configured in config.toml.
| Field | Type | Required | Runtime behavior |
|---|---|---|---|
command | string | yes for custom providers | Launch command for the ACP subprocess. Overrides a built-in command when set. |
display_name | string | no | Operator-facing label shown in settings and provider pickers. |
default_model | string | no | Used when an AGENT.md omits model. Pi-backed providers receive it in their runtime config. |
harness | string | no | acp for direct ACP launch or pi_acp for Pi-backed API-key providers. Defaults to acp. |
runtime_provider | string | no | Downstream provider id used by harnesses such as Pi. Defaults to the AGH provider id. |
transport | string | no | Optional Pi model-provider API family hint for custom providers. |
base_url | string | no | Optional Pi model-provider base URL for custom gateways. |
credential_slots | array | no | Bound launch-time secrets. Each slot maps a secret_ref into a target environment variable. |
mcp_servers | array | no | Provider-level MCP servers merged before agent-level MCP servers. |
AGH overlays provider config on top of a built-in provider when the name matches. Unknown provider
names are accepted only when they have a [providers.<name>] entry.
Direct ACP built-ins such as claude, codex, and gemini expose their API-key env name as an
optional slot because those CLIs can authenticate through their own login flows. Pi-backed API-key
providers mark the built-in API-key slot required so missing credentials fail before the subprocess
starts. Custom providers should set required to match the runtime's real authentication contract.
Override a built-in provider
Use this when you need to pin a different adapter command or change the default model used by
agents that omit model.
[providers.claude]
default_model = "claude-sonnet-4-6"
[[providers.claude.credential_slots]]
name = "api_key"
target_env = "ANTHROPIC_API_KEY"
secret_ref = "env:ANTHROPIC_API_KEY"
kind = "api_key"
required = false
[[providers.claude.mcp_servers]]
name = "github"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]
secret_env = { GITHUB_TOKEN = "env:GITHUB_TOKEN" }Only non-empty scalar fields replace the built-in values. MCP servers merge by name.
Configure an API-key provider
Most secondary providers use the Pi harness. The provider is still selected as an AGH provider in agents, CLI flags, the web session dialog, and settings APIs.
[providers.openrouter]
display_name = "OpenRouter"
harness = "pi_acp"
runtime_provider = "openrouter"
command = "npx -y pi-acp@latest"
default_model = "openai/gpt-5.4"
[[providers.openrouter.credential_slots]]
name = "api_key"
target_env = "OPENROUTER_API_KEY"
secret_ref = "env:OPENROUTER_API_KEY"
kind = "api_key"
required = trueFor AGH-managed encrypted storage, use a vault:providers/<provider>/<slot> ref and save the value
through the settings API or web provider editor. The <provider> and <slot> segments are lowercase
provider/slot identifiers using letters, numbers, hyphens, underscores, or dots; path traversal,
whitespace, and arbitrary vault paths are rejected.
[[providers.openrouter.credential_slots]]
name = "api_key"
target_env = "OPENROUTER_API_KEY"
secret_ref = "vault:providers/openrouter/api-key"
kind = "api_key"
required = trueAGH never exposes provider secret values through settings reads. Status surfaces report only whether the bound credential is present.
Add a custom provider
A custom provider needs an ACP-compatible command. AGH will launch it the same way it launches the built-ins.
[providers.local-agent]
command = "local-agent --acp --stdio"
default_model = "local-default"
[[providers.local-agent.credential_slots]]
name = "api_key"
target_env = "LOCAL_AGENT_API_KEY"
secret_ref = "env:LOCAL_AGENT_API_KEY"
kind = "api_key"
required = false
[[providers.local-agent.mcp_servers]]
name = "filesystem-index"
command = "local-index-mcp"
args = ["serve"]Then point an agent at the custom provider:
---
name: local-operator
provider: local-agent
permissions: approve-reads
---
You inspect this repository with the local agent runtime.
Report risks and cite exact files.Command parsing
Provider commands are parsed with shell-style quoting, then launched without a shell. That means:
- quoted arguments are preserved
- shell expansion is not performed
- the executable must be available on the daemon process
PATH npx-based built-ins can download and run their adapter package through the local Node toolchain
For example, this is valid:
[providers.reviewer]
command = "reviewer-acp --profile \"team default\""But shell-only behavior is not applied:
[providers.bad-example]
command = "MY_FLAG=1 reviewer-acp"Set environment variables before starting the daemon instead.
Models and API keys
model and default_model are resolved and exposed as runtime metadata. Direct acp providers
receive the normal ACP startup flow; Pi-backed providers also receive a session-local Pi
settings.json and models.json with the resolved runtime_provider and model.
The practical rule is:
- use
modelinAGENT.mdwhen you want AGH metadata and provider-specific wrappers to agree on the intended model - use
credential_slotswhen AGH should inject a specific API key into the subprocess - use
env:refs for operator-managed process environment andvault:providers/<provider>/<slot>refs for AGH-managed encrypted provider credentials
MCP server merge order
MCP servers can be declared at several levels. Startup uses this order:
- Top-level
mcp_serversfrom resolved config - Provider
mcp_servers - Agent
mcp_servers - Active skill MCP servers
Config/provider/agent merges are field overlays by server name. Agent-local mcp.json sidecars
replace same-name inline servers as whole objects before that cross-scope merge happens.
Configured MCP env values are passed through as literal strings. Pi-backed providers are launched
through pi-acp; current Pi ACP support does not wire AGH MCP server declarations into Pi's own MCP
configuration.
Choosing a provider
Use the provider that already owns your credentials and preferred workflow:
| If you use | Start with |
|---|---|
| Claude Code | claude |
| Codex | codex |
| Gemini CLI | gemini |
| OpenCode | opencode |
| GitHub Copilot CLI | copilot |
| Cursor Agent | cursor |
| Kiro CLI | kiro |
| BLACKBOX AI | blackbox |
| Cline | cline |
| Goose | goose |
| Hermes | hermes |
| Junie | junie |
| Kimi CLI | kimi-cli |
| OpenClaw | openclaw |
| OpenHands | openhands |
| Qoder CLI | qoder |
| Qwen Code | qwen-code |
| Pi with an Anthropic key | pi |
| OpenRouter | openrouter |
| z.ai / GLM | zai |
| Moonshot / Kimi API | moonshot |
| Vercel AI Gateway | vercel-ai-gateway |
| xAI | xai |
| MiniMax | minimax |
| Mistral | mistral |
| Groq | groq |
| A local or team ACP wrapper | a custom provider |
Then keep provider-specific behavior in the provider command or provider config, and keep the
agent's role, permissions, MCP servers, and startup prompt in AGENT.md.
Related pages
- Agent Definitions explains the
AGENT.mdfields that reference providers. - Spawning shows exactly how the resolved provider command becomes a running ACP process.
- CLI agent reference lists the current
agh agentinspection commands.