Agents
Every session runs an agent and an approval policy, which you choose independently:
- The agent defines what the session is: its instructions, model, tools, and system prompt.
- The approval policy defines which tool calls run without asking. See Approval policies.
The CLI ships with built-in agents, and you can define your own.
Built-in agents
Agent | Behavior |
|---|---|
| default | Default agent. Vibe's own instructions, model, and tools. |
| lean | Specialized agent for the Lean 4 proof assistant. Install with /leanstall from inside the CLI, and remove it with /unleanstall. |
Note
Vibe has no built-in plan agent. If your config sets default_agent = "plan" and you don't have a custom agent named plan, Vibe shows a warning and starts sessions with the default agent and the ask approval policy, unless you set default_approval_policy. To keep a planning workflow, create your own plan agent.
The agent can also delegate work to subagents, for example to explore a large codebase without filling its own context. You can't select subagents with --agent. See Custom subagents.
Select an agent
Pick an agent at launch, for example a custom agent:
vibe --agent redteam
In an interactive session, run /agent to list your agents, and /agent <name> to switch to one. Switching keeps the conversation and the approval policy: the next turn runs the new agent's model, tools, and instructions.
Set the default agent in config.toml:
default_agent = "redteam"
default_agent applies to both interactive and programmatic (--prompt) sessions. When unset, Vibe uses default. --agent and default_agent still accept an approval policy name, such as ask, and then select that approval policy.
When the agent isn't default, the input box's top border shows its name next to the approval policy.
Custom agents
Create custom agents in ~/.vibe/agents/ (user-level) or ./.vibe/agents/ (project-level) by adding a .toml file. Set the agent's kind with agent_type:
- agent_type = "agent" (default): user-facing. Selectable via vibe --agent <name> or /agent <name>.
- agent_type = "subagent": delegation-only. Spawned by the agent when it delegates work. Not selectable by the user.
Run a custom agent with its filename:
vibe --agent redteam
The CLI looks for redteam.toml in the agents directory and applies its configuration. The name main is reserved, so don't name an agent file main.toml. A file named after an approval policy, such as ask.toml, overrides that policy instead of defining an agent. Only ~/.vibe/agents/ can override a policy: Vibe ignores such a file in a project's .vibe/agents/ and reports it as a config issue.
Example: a read-only red-team review agent.
# ~/.vibe/agents/redteam.toml
agent_type = "agent"
display_name = "Red team"
description = "Read-only audit agent for security review."
active_model = "mistral-medium-3.5"
system_prompt_id = "redteam"
disabled_tools = ["edit", "write_file"]
[tools.bash]
permission = "ask"
The system_prompt_id value names a Markdown file in ./.vibe/prompts/ (trusted folders only) or ~/.vibe/prompts/. The example above expects redteam.md.
An agent defines what the session is, never what runs without asking: that belongs to the approval policy. In an agent file, a tool's permission can only make the tool stricter, with ask or never. Under auto-approve, which skips every prompt, a tool the agent sets to never is turned off. Vibe ignores the other approval settings, such as safety, bypass_tool_permissions, permission = "always", or a tool allowlist, and reports each one as a config issue. See Agent definition files for the keys an agent can set.
To run a custom agent without approval prompts, set default_approval_policy = "auto-approve" or pass --approval-policy auto-approve.
Create a plan agent
To explore a codebase and agree on a plan before any change, define a planning agent named plan:
# ~/.vibe/agents/plan.toml
display_name = "Plan"
description = "Explores the codebase and proposes a plan before any change."
disabled_tools = ["edit", "write_file"]
instructions = """
Explore the codebase and propose a step-by-step implementation plan.
Don't modify any file until the user approves the plan.
"""
[tools.bash]
permission = "ask"
Start it with the ask approval policy, so every action waits for your approval:
vibe --agent plan --approval-policy ask
You can also set default_agent = "plan". Turning off edit and write_file isn't a read-only boundary: a shell command can still write files, so keep the approval policy strict while you plan.
Once you approve the plan, run /agent default to switch back to Vibe's default agent, and ask it to implement the plan. Switching agents leaves the approval policy unchanged: press Shift+Tab to change it, for example to accept-edits. The conversation, plan included, stays in the session.
Custom subagents
Subagents run independently and return text-only results to the parent agent. The agent spawns them when it wants to delegate exploration or background work. Without a custom subagent, it can spawn a generic subagent that uses the same tools as itself and follows the instructions the agent writes for its task.
Create a custom subagent by setting agent_type = "subagent". The description tells the agent when to use it:
# ~/.vibe/agents/research.toml
agent_type = "subagent"
display_name = "Research"
description = "Read-only subagent for research tasks."
enabled_tools = ["read_file", "skill"]
Subagents can't ask the user questions. A subagent can use only the built-in tools its file allows, not MCP, connector, or plugin tools, and never with broader permissions than the parent agent. A custom subagent runs on its active_model, or on the session's model when unset. If Vibe can't load a subagent file, for example because its description is empty, it reports the issue instead of skipping the file silently.
A custom subagent's [tools.<tool>] rules, such as permission and allowlist, apply on top of the session's rules: they can make the subagent more restricted than the session, never less. To limit the skills it can load, set enabled_skills or disabled_skills in its file, as in config.toml.
By default, the agent can run up to 32 subagents at once. Past that limit, Vibe closes the subagent that has waited longest to make room. Change this limit with max_subagents and max_concurrent_subagents in config.toml.
To stop the agent from spawning subagents, set enable_subagents = false in config.toml.
AGENTS.md support
The CLI loads AGENTS.md files into context to follow user and project-specific agent instructions:
1.
User-level: ~/.vibe/AGENTS.md (or in $VIBE_HOME if you set it).2.
Project-level: every AGENTS.md from the current working directory up to the root of the trusted folder. When instructions conflict, the file closest to the working directory wins.
For example:
/
dir_1/
AGENTS.md <- never loaded: location is not trusted
dir_2/ <- trusted
AGENTS.md <- loaded
dir_3/
AGENTS.md <- loaded, takes priority over dir_2/AGENTS.md
project/ <- cwd (no AGENTS.md here)
Additionally, the CLI will auto-discover new AGENTS.md files when reading files in sub-directories.