Creating Agents
This guide walks you through creating an Action Llama agent from scratch.Prerequisites
- An Action Llama project (created with
al new <name>) - Credentials configured in
~/.action-llama/credentials/(see Credentials)
Steps
1. Create the agent directory
Inside your project directory, create a folder for your agent under theagents/ directory:
2. Write agent-config.toml
Create agents/my-agent/agent-config.toml:
anthropic, openai, groq, google, xai, mistral, openrouter, custom. See agent-config.toml Reference for all available fields and provider examples.
3. Write ACTIONS.md
Create agents/my-agent/ACTIONS.md — this is the system prompt that defines your agent’s behavior:
4. (Optional) Add preflight steps
If your agent needs external context (repo contents, API data, issue lists), add[[preflight]] steps to agent-config.toml. Preflight runs after credentials are loaded but before the LLM session starts, so the agent begins with everything it needs:
5. Verify with al stat
6. Run with al start
7. (Optional) Customize the project Dockerfile
Every project has aDockerfile at the root (created by al new) that defines the shared base image for all agents. If your agents need extra system packages, edit it:
Dockerfile to that agent’s directory instead:
8. (Cloud only) Re-run al doctor -c
If you’re running agents on cloud infrastructure, re-run al doctor -c after adding a new agent. This creates the per-agent IAM resources (service account for Cloud Run, task role for ECS) and grants the new agent access to its declared secrets.
Tips
- Agent name is derived from the directory name — no need to put it in the config
- Use
al-rerunin your ACTIONS.md to tell the agent to runal-rerunwhen it did work and there may be more in the backlog - Params in the config are injected into the agent prompt as an
<agent-config>XML block - See Examples for complete working agents