Agent Configuration Guide
This guide explains how to configure AI agents in Radium using TOML configuration files.
Introductionβ
Radium uses a declarative TOML-based configuration system for defining AI agents. Each agent is defined in a .toml file that specifies the agent's identity, capabilities, and behavior. Agents are automatically discovered from configured directories and can be managed through the CLI.
Agent Configuration Formatβ
Basic Structureβ
An agent configuration file follows this structure:
[agent]
id = "my-agent"
name = "My Agent"
description = "A description of what this agent does"
prompt_path = "prompts/agents/my-category/my-agent.md"
Required Fieldsβ
id(string): Unique identifier for the agent (e.g., "arch-agent", "code-agent")name(string): Human-readable name for the agentdescription(string): Brief description of the agent's purposeprompt_path(PathBuf): Path to the markdown file containing the agent's prompt template
Optional Fieldsβ
engine(string): Default AI engine to use (e.g., "gemini", "openai", "claude", "universal" for self-hosted)model(string): Default model to use (e.g., "gemini-2.0-flash-exp", "gpt-4", "llama3.2" for self-hosted)reasoning_effort(string): Default reasoning effort level -"low","medium", or"high"(default:"medium"). Controls the depth of reasoning for thinking models. See Thinking Mode for details.mirror_path(PathBuf): Optional mirror path for RAD-agentscapabilities(object): Agent capabilities for dynamic model selection (see Capabilities section)sandbox(object): Sandbox configuration for safe command execution (see Sandbox Configuration section)
Note: For self-hosted models (Ollama, vLLM, LocalAI), use engine = "universal" and configure the base URL via environment variables. See the Self-Hosted Models Guide for complete setup instructions.
Example: Minimal Configurationβ
[agent]
id = "simple-agent"
name = "Simple Agent"
description = "A basic agent with minimal configuration"
prompt_path = "prompts/agents/core/simple-agent.md"
Example: Full Configurationβ
[agent]
id = "arch-agent"
name = "Architecture Agent"
description = "Defines system architecture and technical design decisions"
prompt_path = "prompts/agents/core/arch-agent.md"
engine = "gemini"
model = "gemini-2.0-flash-exp"
reasoning_effort = "medium"
Reasoning Effort and Thinking Modeβ
The reasoning_effort field controls how much internal reasoning thinking models perform before providing answers. This is particularly useful for complex problems requiring deep analysis.
Reasoning Effort Levelsβ
low: Minimal reasoning effort for simple tasksmedium: Moderate reasoning for balanced performance (default)high: Maximum reasoning effort for complex problems
Thinking Modelsβ
Some models support thinking mode, which shows the model's reasoning process:
- Gemini:
gemini-2.0-flash-thinkingsupports thinking mode - Claude:
claude-3-opusandclaude-3-sonnetsupport extended thinking
Example: Thinking Agent Configurationβ
[agent]
id = "math-solver"
name = "Math Problem Solver"
reasoning_effort = "high"
engine = "gemini"
model = "gemini-2.0-flash-thinking"
Viewing Thinking Processβ
To see the model's thinking process, use the --show-metadata flag:
rad step math-solver "Complex problem" --show-metadata
For more details, see the Thinking Mode and Reasoning Configuration guides.
Agent Behaviorsβ
Agents can be configured with special behaviors that affect how they interact with workflows.
Loop Behaviorβ
Loop behavior allows an agent to request looping back to previous steps during workflow execution.
[agent]
id = "review-agent"
name = "Review Agent"
description = "Reviews code and can request revisions"
prompt_path = "prompts/agents/core/review-agent.md"
[agent.loop_behavior]
steps = 2 # Number of steps to go back
max_iterations = 5 # Maximum number of iterations (optional)
skip = ["step-1"] # Step IDs to skip during loop (optional)
Fields:
steps(usize, required): Number of steps to go back when loopingmax_iterations(usize, optional): Maximum number of iterations before stoppingskip(array of strings, optional): List of step IDs to skip during loop
Trigger Behaviorβ
Trigger behavior allows an agent to dynamically trigger other agents during workflow execution.
[agent]
id = "coordinator-agent"
name = "Coordinator Agent"
description = "Coordinates work and can trigger other agents"
prompt_path = "prompts/agents/core/coordinator-agent.md"
[agent.trigger_behavior]
trigger_agent_id = "fallback-agent" # Default agent to trigger (optional)
Fields:
trigger_agent_id(string, optional): Default agent ID to trigger (can be overridden in behavior.json)
Capabilitiesβ
Agent capabilities define the agent's model class, cost tier, and concurrency limits for dynamic model selection.
[agent]
id = "fast-agent"
name = "Fast Agent"
description = "Optimized for speed"
prompt_path = "prompts/agents/core/fast-agent.md"
[agent.capabilities]
model_class = "fast" # Options: "fast", "balanced", "reasoning"
cost_tier = "low" # Options: "low", "medium", "high"
max_concurrent_tasks = 10 # Maximum concurrent tasks (default: 5)
Fields:
model_class(string, required): Model category -"fast"(speed-optimized),"balanced"(balanced speed/quality), or"reasoning"(deep reasoning)cost_tier(string, required): Cost tier -"low","medium", or"high"max_concurrent_tasks(integer, optional): Maximum number of concurrent tasks (default: 5)
Model Class Examples:
"fast": Use with Flash, Mini, or other speed-optimized models"balanced": Use with Pro, 4o, or other balanced models"reasoning": Use with o1, Thinking, or other reasoning-focused models
If capabilities is not specified, defaults to balanced/medium/5.
Sandbox Configurationβ
Sandbox configuration enables safe command execution in isolated environments. This is useful for agents that need to run potentially unsafe commands.
[agent]
id = "code-exec-agent"
name = "Code Execution Agent"
description = "Executes code in a sandbox"
prompt_path = "prompts/agents/core/code-exec-agent.md"
[agent.sandbox]
sandbox_type = "docker" # Options: "docker", "podman", "seatbelt", "none"
network = "closed" # Network mode: "open", "closed", or "proxied"
profile = "restrictive" # Sandbox profile: "permissive", "restrictive", or "custom(path)"
image = "rust:latest" # Docker/Podman image (required for docker/podman)
working_dir = "/app" # Working directory inside sandbox (optional)
volumes = ["/host:/container"] # Volume mounts in host:container format (optional)
env = { "KEY" = "value" } # Environment variables (optional)
custom_flags = ["--cap-add=SYS_ADMIN"] # Custom flags for container execution (optional)
Fields:
sandbox_type(string, required): Sandbox type -"docker","podman","seatbelt"(macOS only), or"none"network(string, optional): Network mode -"open","closed", or"proxied"(default:"open")profile(string, optional): Sandbox profile -"permissive","restrictive", or"custom(path)"(default:"permissive")image(string, optional): Container image for Docker/Podman sandboxesworking_dir(string, optional): Working directory inside sandboxvolumes(array of strings, optional): Volume mounts inhost:containerformatenv(table, optional): Environment variables as key-value pairscustom_flags(array of strings, optional): Additional flags for container execution
Sandbox Types:
docker: Uses Docker containers for isolation (requires Docker)podman: Uses Podman containers for isolation (requires Podman)seatbelt: Uses macOS Seatbelt sandboxing (macOS only)none: No sandboxing (commands execute directly)
If sandbox is not specified, commands execute directly without sandboxing.
Prompt Templatesβ
Agent prompts are stored in markdown files and support placeholder replacement using {{KEY}} syntax.
Placeholder Syntaxβ
Placeholders in the format {{KEY}} are replaced with values from the execution context:
# Architecture Agent
Hello {{user_name}}!
Your task is to {{task_description}}.
Please complete this by {{deadline}}.
Template Loadingβ
Prompt templates are automatically loaded from the path specified in prompt_path. The path can be:
- Absolute:
/absolute/path/to/prompt.md - Relative:
prompts/agents/core/arch-agent.md(relative to workspace root)
Creating Custom Agentsβ
Step 1: Create Agent Configurationβ
Create a new TOML file in the appropriate directory:
# Project-local agents
./agents/my-category/my-agent.toml
# User-level agents
~/.radium/agents/my-category/my-agent.toml
Step 2: Define Agent Configurationβ
[agent]
id = "my-agent"
name = "My Custom Agent"
description = "Does something useful"
prompt_path = "prompts/agents/my-category/my-agent.md"
engine = "gemini"
model = "gemini-2.0-flash-exp"
Step 3: Create Prompt Templateβ
Create the prompt file at the specified path:
# My Custom Agent
## Role
Define the agent's role and primary responsibilities here.
## Capabilities
- List the agent's core capabilities
- Include what tasks it can perform
- Specify any constraints or limitations
## Instructions
Provide step-by-step instructions for the agent:
1. First step - explain what to do
2. Second step - detail the process
3. Continue as needed...
Step 4: Validate Configurationβ
Use the CLI to validate your agent:
rad agents validate
Or validate a specific agent:
rad agents info my-agent
Step 5: Test the Agentβ
List all agents to verify discovery:
rad agents list
Using the CLIβ
List All Agentsβ
rad agents list
Show detailed information:
rad agents list --verbose
Search Agentsβ
rad agents search "architecture"
Get Agent Informationβ
rad agents info arch-agent
Validate Agentsβ
rad agents validate
Create New Agentβ
rad agents create my-agent "My Agent" \
--description "Agent description" \
--category custom \
--engine gemini \
--model gemini-2.0-flash-exp \
--reasoning medium
This command will:
- Create the agent configuration file
- Create a prompt template file
- Set up the directory structure
Agent Discoveryβ
Agents are automatically discovered from multiple directories in this order (precedence from highest to lowest):
- Project-local agents:
./agents/ - User agents:
~/.radium/agents/ - Workspace agents: (if applicable)
- Project-level extension agents:
./.radium/extensions/*/agents/ - User-level extension agents:
~/.radium/extensions/*/agents/
Category Derivationβ
The agent's category is automatically derived from the directory structure:
agents/core/arch-agent.tomlβ category:"core"agents/custom/my-agent.tomlβ category:"custom"agents/rad-agents/design/design-agent.tomlβ category:"rad-agents/design"
Duplicate Agent IDsβ
If multiple agents have the same ID, the agent from the directory with higher precedence will be used. Later entries override earlier ones.
Common Patternsβ
Pattern 1: Simple Task Agentβ
[agent]
id = "task-agent"
name = "Task Agent"
description = "Performs a specific task"
prompt_path = "prompts/agents/core/task-agent.md"
Pattern 2: Agent with Default Modelβ
[agent]
id = "model-agent"
name = "Model Agent"
description = "Uses a specific model"
prompt_path = "prompts/agents/core/model-agent.md"
engine = "gemini"
model = "gemini-2.0-flash-exp"
reasoning_effort = "high"
Pattern 3: Agent with Loop Behaviorβ
[agent]
id = "iterative-agent"
name = "Iterative Agent"
description = "Can loop back to previous steps"
prompt_path = "prompts/agents/core/iterative-agent.md"
[agent.loop_behavior]
steps = 2
max_iterations = 3
Pattern 4: Agent with Trigger Behaviorβ
[agent]
id = "coordinator"
name = "Coordinator Agent"
description = "Can trigger other agents"
prompt_path = "prompts/agents/core/coordinator.md"
[agent.trigger_behavior]
trigger_agent_id = "worker-agent"
Pattern 5: Agent with Capabilitiesβ
[agent]
id = "fast-code-gen"
name = "Fast Code Generator"
description = "Generates code quickly"
prompt_path = "prompts/agents/core/fast-code-gen.md"
[agent.capabilities]
model_class = "fast"
cost_tier = "low"
max_concurrent_tasks = 20
Pattern 6: Agent with Sandboxβ
[agent]
id = "safe-exec"
name = "Safe Execution Agent"
description = "Executes commands in sandbox"
prompt_path = "prompts/agents/core/safe-exec.md"
[agent.sandbox]
type = "docker"
image = "ubuntu:latest"
profile = "restricted"
Best Practicesβ
-
Use descriptive IDs: Choose IDs that clearly indicate the agent's purpose (e.g.,
arch-agentnotagent1) -
Organize by category: Group related agents in the same category directory
-
Write clear descriptions: Help users understand when to use each agent
-
Specify default models: Set
engineandmodelif the agent requires a specific AI provider -
Use placeholder templates: Make prompts reusable with
{{KEY}}placeholders -
Validate regularly: Run
rad agents validateto catch configuration errors early -
Version control: Commit agent configurations and prompts to version control
Troubleshootingβ
Agent Not Foundβ
Problem: Agent doesn't appear in rad agents list
Solutions:
- Check that the agent file is in a discovery directory (
./agents/or~/.radium/agents/) - Verify the file has a
.tomlextension - Check that the
idfield is unique - Run
rad agents validateto check for errors
Prompt File Not Foundβ
Problem: Validation error: "Prompt file not found"
Solutions:
- Verify the
prompt_pathin the agent config is correct - Check if the path is relative (relative to workspace root) or absolute
- Ensure the prompt file exists at the specified path
- Check file permissions
Invalid TOML Syntaxβ
Problem: Error parsing TOML file
Solutions:
- Validate TOML syntax using a TOML validator
- Check for missing quotes around string values
- Ensure all required fields are present
- Verify array syntax for
skipfield in loop behavior
Duplicate Agent IDsβ
Problem: Agent from one directory is overriding another
Solutions:
- Use unique IDs for each agent
- Check discovery order (project-local has highest precedence)
- Use different categories to organize agents
- Consider using namespaced IDs (e.g.,
my-extension:agent-id)
Placeholder Not Replacedβ
Problem: {{KEY}} placeholders remain in rendered prompt
Solutions:
- Verify placeholder syntax uses double braces:
{{KEY}} - Check that the context provides values for all placeholders
- Use non-strict mode if placeholders are optional
- Verify placeholder names match exactly (case-sensitive)
Invalid Capabilities Configurationβ
Problem: Validation error with capabilities section
Solutions:
- Verify
model_classis one of: "fast", "balanced", "reasoning" - Verify
cost_tieris one of: "low", "medium", "high" - Ensure
max_concurrent_tasksis a positive integer - Check TOML syntax for the
[agent.capabilities]section
Sandbox Configuration Issuesβ
Problem: Sandbox not working or validation errors
Solutions:
- Verify sandbox type is supported on your platform (seatbelt is macOS-only)
- For Docker/Podman: Ensure the container runtime is installed and running
- Check that the specified image exists and is accessible
- Verify network_mode is valid: "isolated", "bridged", or "host"
- Test sandbox configuration with a simple command first
Examplesβ
See the examples/agents/ directory for complete example configurations:
simple-agent.toml- Minimal configurationfull-agent.toml- All optional fieldsloop-behavior-agent.toml- Agent with loop behaviortrigger-behavior-agent.toml- Agent with trigger behavior
Further Readingβ
- Self-Hosted Models Guide - Setup and configuration for Ollama, vLLM, and LocalAI
- Developer Guide: Agent System Architecture - Technical details for developers
- CLI Reference - Command-line interface documentation