Skip to main content
An agent is a reusable definition of how a model works: the model, the system prompt, the tools, the skills, and the credentials it can use. You create an agent once and start any number of sessions from it. Every change to an agent’s definition creates a new agent version. A version is immutable, and a session keeps the version it started with, so an edit never changes a session that is already running. The TypeScript samples assume the 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.
The API sets 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.
  1. In the sidebar, click Agents.
  2. Click Create agent.
  3. 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.
  4. Under General, fill in Name, Model, and System prompt.
  5. Click Create agent.
Some fields, such as metadata, have no control in the console form. Set them with the API.
A 200 response is the agent, resolved to its first version. Some fields are left out here.
Keep 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 an Idempotency-Key with 1 to 256 visible ASCII characters.
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

  1. In the sidebar, click Agents.
  2. Click the agent. The Configuration tab shows the current version.
The response has the same shape as the create response and always shows the latest version. A deleted agent, or one from another organization, returns 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, pass tag_ids as a comma-separated string of at most 32 tag ids. An agent must carry every tag you name.
  1. In the sidebar, click Agents.
  2. To narrow the list, type a name, id, model, or tag in the search box, or pick tags in the Tags filter.
Each entry is a full agent. The sample shows a few fields. When your organization has no agents, 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 with createAgentVersion. New sessions use the new version. Running sessions keep the version they started with.
  1. Open the agent and stay on the Configuration tab.
  2. Change the fields.
  3. Click Save new version.
  4. If someone else saved first, the console shows a conflict notice. Click Load the newer version, then make your change again.
A 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_providers again. On createAgent, leaving the field out means ["github"]. On createAgentVersion, leaving it out means an empty list.
  • Set base_agent_version_id to the version you read. It must equal the agent’s current latest_agent_version_id. If another writer created a version first, the API returns 409 revision_conflict and saves nothing, so you cannot overwrite a change you have not seen.
After a 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.
  1. Open the agent and stay on the Configuration tab.
  2. Click the Version picker. The latest version is marked current.
  3. Pick a version to view it. Earlier versions are read-only.
  4. To make an earlier version the latest, click Restore this version. The console saves its definition as a new version.
Each entry holds the full definition at that version. The sample shows part of each entry. created_by is the user who saved the version and is empty when an automated caller saved it.

Get a version

Every session records its agent_version_id. To see the exact prompt and tools a past session ran with, get that version.
Open the agent and pick the version in the Version picker, as in List versions.
The response is one entry from the versions list. The version must belong to the agent in the path. A version id from another agent returns 404 not_found.

Set a default rubric

An agent can carry a rubric that grades its sessions. A session that starts without an outcome 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.
  1. Open the agent and stay on the Configuration tab.
  2. Scroll to the Outcome section.
  3. Write the rubric in Default rubric. Write each criterion as a list item.
  4. Click Save new version.
The rubric must have at least one list item and at most 200 criteria. Otherwise the API returns 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’s updated_at, and is not recorded on sessions.

Create a tag

A tag has a label 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.
  1. In the sidebar, click Agents.
  2. Click Manage tags, then Create tag.
  3. Fill in Label, Color, and an optional Description.
  4. Click Create tag.
A label that another live tag already uses returns 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.
  1. In Agents, click Manage tags.
  2. Open the tag’s row menu and click Edit, change the fields, and click Save tag.
  3. To delete, open the row menu, click Delete, and confirm in the Delete tag? dialog.
A delete returns { "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.
  1. Open the agent and stay on the Configuration tab.
  2. In Tags, use Add tag, or remove a tag from the list.
  3. 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, returns 404 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.
  1. Open the agent, or open its row menu in Agents.
  2. Click Delete.
  3. In the Delete agent dialog, click Delete.

What can go wrong

Every error uses the envelope shown in Update rules, and details.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.