Agents in AgentOS are defined by a TOML configuration file that specifies their model, system prompt, capabilities, resource limits, and persona. AgentOS includes 45 pre-built agent templates across 9 divisions.
Agent = Configuration + ReAct LoopAgents use the ReAct (Reasoning + Acting) pattern to process messages, call tools, and generate responses. Configuration determines which tools they can access and how they behave.
[agent]name = "my-agent"description = "A custom agent for my use case"module = "builtin:chat"[agent.model]provider = "anthropic"model = "claude-sonnet-4-6"max_tokens = 4096[agent.capabilities]tools = ["*"] system_prompt = """You are a helpful assistant."""tags = ["custom"]
[agent]name = "sql-expert"description = "Database specialist for query optimization and schema design"module = "builtin:chat"[agent.model]provider = "anthropic"model = "claude-sonnet-4-6"max_tokens = 4096[agent.capabilities]tools = [ "tool::file_read", "tool::web_search", "db::query", "db::explain", "db::schema"][agent.resources]max_tokens_per_hour = 100000system_prompt = """You are a senior database engineer specializing in PostgreSQL and MySQL.When analyzing queries:1. Use EXPLAIN ANALYZE to understand execution plans2. Identify missing indexes3. Suggest query rewrites for better performance4. Consider database-specific optimizationsWhen designing schemas:1. Normalize to 3NF unless performance requires denormalization2. Choose appropriate data types3. Add indexes for foreign keys and frequently queried columns4. Include constraints for data integrityAlways explain your reasoning and provide benchmarks when possible."""tags = ["database", "sql", "performance"][persona]division = "engineering"communication_style = "Technical and data-driven. Uses metrics and execution plans to support recommendations."critical_rules = [ "Always check execution plans before suggesting optimizations", "Never recommend changes without understanding query patterns", "Consider database version and configuration"]
# Register with CLIagentos agent create agents/my-agent/agent.toml# Or use APIcurl -X POST http://localhost:3111/agents \ -H "Content-Type: application/json" \ -d @agents/my-agent/agent.toml
# Chat with agentagentos chat sql-expert# Send single messageagentos message sql-expert "Optimize this query: SELECT * FROM users WHERE email LIKE '%@example.com'"
[agent]name = "code-reviewer"description = "Thorough code reviewer using Claude Opus"module = "builtin:chat"[agent.model]provider = "anthropic"model = "claude-opus-4" # More powerful modelmax_tokens = 8192[agent.capabilities]tools = ["tool::file_*", "tool::code_*", "git::*"][agent.resources]max_tokens_per_hour = 200000 # Higher limit for detailed reviewssystem_prompt = """You are a meticulous code reviewer.Review criteria:1. **Correctness**: Does the code work as intended?2. **Security**: Are there any vulnerabilities?3. **Performance**: Are there inefficiencies?4. **Maintainability**: Is the code readable and well-structured?5. **Testing**: Are there adequate tests?For each file:- Provide line-by-line feedback- Suggest specific improvements- Rate severity: CRITICAL, HIGH, MEDIUM, LOW- Include code snippets showing the fixBe constructive and educational."""tags = ["code-review", "quality", "senior"]
system_prompt = """You are a [specific role] with [expertise level].Output format: [detailed specification]Use tools:- tool::file_read when [condition]- tool::web_search when [condition]Error handling:- If [error], then [action]"""
2
Principle of Least Privilege
Only grant necessary tool access:
# Bad: Grants too much accesstools = ["*"]# Good: Explicit permissionstools = ["tool::file_read", "tool::web_search", "memory::store"]