🦞
Resources

openclaw_agent

Manages an individual OpenClaw agent entry.

Manages an individual agent entry in agents.list[]. Use this to define multiple agents with different models, identities, tools, and sandbox settings. Pair with openclaw_binding to route channels to specific agents.

Example Usage

resource "openclaw_agent" "research" {
  agent_id      = "research"
  name          = "Research Agent"
  default_agent = false
  model         = "openai/gpt-4.1"
  workspace     = "~/.openclaw/workspace-research"

  identity_name  = "Researcher"
  identity_emoji = "\ud83d\udd2c"

  mention_patterns = ["@research", "@researcher"]

  sandbox_mode = "all"
  sandbox_scope = "agent"
}

resource "openclaw_agent" "coding" {
  agent_id      = "coding"
  name          = "Coding Agent"
  default_agent = true
  model         = "anthropic/claude-sonnet-4-20250514"

  tools_profile = "coding"
  tools_allow   = ["bash", "read", "write", "glob", "grep"]
}

Argument Reference

ArgumentTypeRequiredDescription
agent_idStringYesStable identifier for the agent. Maps to id in config.
default_agentBoolNoWhether this is the default agent.
nameStringNoDisplay name.
workspaceStringNoWorkspace path override.
modelStringNoModel override (e.g. anthropic/claude-opus-4-6).
identity_nameStringNoIdentity display name.
identity_emojiStringNoIdentity emoji.
identity_themeStringNoIdentity theme color.
mention_patternsList(String)NoPatterns that mention this agent in group chats.
sandbox_modeStringNoSandbox mode: off, non-main, all.
sandbox_scopeStringNoSandbox scope: session, agent, shared.
tools_profileStringNoTools profile name.
tools_allowList(String)NoAllowed tool names.
tools_denyList(String)NoDenied tool names.

Attribute Reference

AttributeTypeDescription
idStringSame as agent_id.

Import

terraform import openclaw_agent.research research

On this page