rl client from Client setup.
Before you begin
- You need the organization developer or admin role to create, change, or delete agents. The organization user role can view agents. See Organizations and roles.
- For the API, create a key on API keys and export it as
RECURSION_API_KEY. - Pick a model id from
listModels. Your organization can use only the models that list returns.
Agent fields
You send these fields when you create an agent and when you create a new version.More fields
More fields
agent_id, latest_agent_version_id, organization_id, tags, created_at, and updated_at. Tags live outside versions, so a tag change never creates a version.
Create an agent
One request saves the agent and its first version. Start with a short prompt and only the tools the task needs. You can add more in a later version.- Console
- TypeScript
- cURL
- In the sidebar, click Agents.
- Click Create agent.
- Under Choose a starting point, click Blank, or pick a template to start from its definition. Templates are ready-made evaluators, such as Core quality.
- Under General, fill in Name, Model, and System prompt.
- Click Create agent.
metadata, have no control in the console form. Set them with the API.200 response is the agent, resolved to its first version. Some fields are left out here.
agent_id to start sessions and latest_agent_version_id to update the agent. On a new agent, disabled_integration_mcp_providers defaults to ["github"], which withholds GitHub’s MCP tools while git and gh stay available.
Retry a create safely
If a create request times out, you cannot tell whether the agent exists. To make the retry safe, send anIdempotency-Key with 1 to 256 visible ASCII characters.
- Console
- TypeScript
- cURL
The console adds a key to every Create agent click, so a double click or a retried save creates one agent.
The API compares the method, path, query, and raw body bytes, so send the retry byte for byte. A completed response is kept for about 24 hours. Your organization shares one key namespace across all keyed requests, so put the resource name in the key.
Get an agent
- Console
- TypeScript
- cURL
- In the sidebar, click Agents.
- Click the agent. The Configuration tab shows the current version.
404 not_found.
List agents
The list returns every agent in your organization in one response, newest first, without pages. Deleted agents are left out. To filter, passtag_ids as a comma-separated string of at most 32 tag ids. An agent must carry every tag you name.
- Console
- TypeScript
- cURL
- In the sidebar, click Agents.
- To narrow the list, type a name, id, model, or tag in the search box, or pick tags in the Tags filter.
agents can be null; treat it as an empty list. A tag_ids entry that does not exist in your organization returns 404 not_found.
Update an agent
You cannot edit an agent’s definition in place. To change it, create a new version withcreateAgentVersion. New sessions use the new version. Running sessions keep the version they started with.
- Console
- TypeScript
- cURL
- Open the agent and stay on the Configuration tab.
- Change the fields.
- Click Save new version.
- If someone else saved first, the console shows a conflict notice. Click Load the newer version, then make your change again.
201 response is the agent with a new latest_agent_version_id. Use that id as base_agent_version_id in your next update. Only latest_agent_version_id is guaranteed to point at the version you just wrote, so read that version back with Get a version when you need its exact content.
Update rules
- Send the full definition. A version is complete in itself. A field you leave out is cleared, not copied from the earlier version. This covers
default_rubric,skills,mcp_servers,built_in_integrations,default_vault_ids, and every other field. The console sends the full definition for you. - Send
disabled_integration_mcp_providersagain. OncreateAgent, leaving the field out means["github"]. OncreateAgentVersion, leaving it out means an empty list. - Set
base_agent_version_idto the version you read. It must equal the agent’s currentlatest_agent_version_id. If another writer created a version first, the API returns409 revision_conflictand saves nothing, so you cannot overwrite a change you have not seen.
revision_conflict, get the agent again, apply your change to the new definition, and send the request with the new latest_agent_version_id. Branch on code, because the message text can change.
List versions
Versions are numbered from 1. The list returns every version, newest first, without pages.- Console
- TypeScript
- cURL
- Open the agent and stay on the Configuration tab.
- Click the Version picker. The latest version is marked current.
- Pick a version to view it. Earlier versions are read-only.
- To make an earlier version the latest, click Restore this version. The console saves its definition as a new version.
created_by is the user who saved the version and is empty when an automated caller saved it.
Get a version
Every session records itsagent_version_id. To see the exact prompt and tools a past session ran with, get that version.
- Console
- TypeScript
- cURL
Open the agent and pick the version in the Version picker, as in List versions.
404 not_found.
Set a default rubric
An agent can carry a rubric that grades its sessions. A session that starts without anoutcome is graded against the agent’s default_rubric, with the session’s opening message as the objective. A session that sends its own outcome ignores the default rubric. To start one ungraded session from such an agent, send skip_default_outcome: true in the start request.
Store the rubric on the agent when you want to compare criteria across sessions. Criterion ids come from the rubric text, so ids match between sessions only when the rubric is identical in every character.
default_rubric is one more field of the definition. Send it in createAgent or createAgentVersion together with every other field, as in Update an agent.
- Console
- TypeScript
- cURL
- Open the agent and stay on the Configuration tab.
- Scroll to the Outcome section.
- Write the rubric in Default rubric. Write each criterion as a list item.
- Click Save new version.
400 invalid_request on default_rubric. Files the agent saves under /workspace/.managed-agents/outputs are kept as deliverables and checked by the grader, which is why the rubric names that path. To remove the default rubric, create a version without the field. Outcomes describes the rubric format and what a grading pass returns.
Tag agents
Tags are colored labels that you define once for your organization and apply to agents. Use them to filter the agent list. Tags are mutable and live outside versions: creating, applying, or removing a tag never creates an agent version, never changes the agent’supdated_at, and is not recorded on sessions.
Create a tag
A tag has alabel of 1 to 32 characters, a color in #RRGGBB form, and an optional description of at most 280 characters. Labels are unique within your organization, ignoring case.
- Console
- TypeScript
- cURL
- In the sidebar, click Agents.
- Click Manage tags, then Create tag.
- Fill in Label, Color, and an optional Description.
- Click Create tag.
409 conflict on label. Your organization can have at most 200 live tags.
List, get, update, and delete tags
listTags returns { "tags": [...] } with every live tag in one response. getTag returns one tag, or 404 not_found for a deleted tag or one from another organization.
updateTag is a partial update. Fields you omit keep their value, and an empty description clears it. Sending null for a field returns 400 invalid_request; omit the field instead. Renaming or recoloring a tag changes it on every agent that carries it.
- Console
- TypeScript
- cURL
- In Agents, click Manage tags.
- Open the tag’s row menu and click Edit, change the fields, and click Save tag.
- To delete, open the row menu, click Delete, and confirm in the Delete tag? dialog.
{ "deleted": true }. The tag disappears from every agent at once, but the agents and their versions are not changed, and the label becomes free to reuse. A deleted tag cannot be restored.
Apply tags to an agent
An agent can carry at most 32 tags.applyAgentTag adds one tag and removeAgentTag removes one. Both are safe to repeat. replaceAgentTags sets the whole list in one call: duplicates collapse, and [] removes every tag.
- Console
- TypeScript
- cURL
- Open the agent and stay on the Configuration tab.
- In Tags, use Add tag, or remove a tag from the list.
- Click Save tags. If you also changed the definition, the button reads Save changes and saves both.
applyAgentTag and replaceAgentTags return the agent’s full tag list. removeAgentTag returns 204 with no body, including when the tag was already removed.
Delete an agent
A delete is a soft delete. The agent leaves lists, returns404 on reads, and cannot start new sessions. Its versions stay stored, and the sessions that used it stay readable. A deleted agent cannot be restored.
- Console
- TypeScript
- cURL
- Open the agent, or open its row menu in Agents.
- Click Delete.
- In the Delete agent dialog, click Delete.
What can go wrong
Every error uses the envelope shown in Update rules, anddetails.field names the request field at fault. The full catalog is on Errors.
Limits
See Limits for request sizes and rates.
Next steps
Tools
See which tools an agent gets and turn some of them off.
Skills
Attach procedures that the agent loads when they apply.
Sessions
Run the agent in an environment and follow its work.
Multi-agent
Let one agent delegate to others, or lead a team.