> For the complete documentation index, see [llms.txt](https://docs.runway.team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.runway.team/using-runway/triage/assigning-issues-to-agents.md). Agents can also search and read this documentation through its [MCP server](https://docs.runway.team/~gitbook/mcp).

# Assigning issues to agents

Within Triage, users can assign issues to a coding agent. Once an issue is assigned to an agent, Runway can trigger the agent to start working and provide all the necessary context to help the agent resolve the issue. The agent pushes a fix to a dedicated branch, and Runway opens a pull request for your team to review.&#x20;

\
Agents can run in your own GitHub Actions workflows, in a Claude Code routine, or in any service that can receive a webhook.

{% hint style="info" %}
Assigning issues to agents is available on Enterprise plans only.&#x20;
{% endhint %}

### Creating an agent

To create an agent, navigate to the AI section of your [Organization settings](https://docs.runway.team/using-runway/organization-settings) and click **Create agent** in the Agents section. You'll need permission to manage API keys. \
The setup walks you through four steps:

1. **Agent**: give the agent a name and choose how it runs.
2. **Apps:** choose the apps whose issues the agent can be assigned to.
3. **Set up:** connect the agent to where it runs. This step depends on the type of agent.
4. **API key**: Runway creates an API key for the agent. The agent's API key can only read Triage issues, and only for the agent's apps. If you need a new one, you can regenerate it from the agent's menu, which also revokes the old key.

<figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FQ8KluPu30k74FSUizju8%2Fimage.png?alt=media&amp;token=e6af09db-03f7-4e85-98d9-50b2dc2ed8d0" alt="" width="563"><figcaption></figcaption></figure>

Runway supports the following types of agents:

| Agent                                   | What you'll need                          |
| --------------------------------------- | ----------------------------------------- |
| CI workflow: Claude Code (subscription) | GitHub Actions and a Claude subscription  |
| CI workflow: Claude Code (API key)      | GitHub Actions and an Anthropic API key   |
| CI workflow: Codex (API key)            | GitHub Actions and an OpenAI API key      |
| CI workflow: My own workflow            | GitHub Actions and a workflow of your own |
| Agent service: Claude Code routine      | A routine in Claude Code on the web       |
| Agent service: Standard webhook         | Any service that can receive a webhook    |

Note that an agent's type can't be changed once it's created.

#### CI workflow agents

CI workflow agents run in a GitHub Actions workflow in the app's code repository, so the app needs a [GitHub version control integration](https://docs.runway.team/integrations/version-control/github.md). Runway provides a sample workflow: copy it and commit it to your repository's default branch.

<figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FaqUOnbil8M2WLO87EE58%2Fimage.png?alt=media&amp;token=624b7dab-cb3e-469a-9ea6-4239278d7361" alt="" width="563"><figcaption></figcaption></figure>

The workflow also needs two [repository secrets](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions):

* `RUNWAY_API_KEY` : the agent's API key, generated during creation.
* The key for the agent itself, depending on its type:
  * Claude Code (subscription): `CLAUDE_CODE_OAUTH_TOKEN`, generated with `claude setup-token`.
  * Claude Code (API key): `ANTHROPIC_API_KEY`, an [Anthropic API key](https://console.anthropic.com/settings/keys).
  * Codex (API key): `OPENAI_API_KEY`, an [OpenAI API key](https://platform.openai.com/api-keys).

If you'd rather use a workflow of your own, choose **My own workflow** and pick the workflow for each app. It needs to run on `workflow_dispatch` with the inputs `RUNWAY_TRIAGE_ISSUE_ID`, `RUNWAY_APP_ID`, `RUNWAY_TARGET_BRANCH` and `RUNWAY_FIX_BRANCH`, read the issue with the agent's API key, and push its fix to `RUNWAY_FIX_BRANCH`.

#### Claude Code routine agents

Claude Code routine agents run in [Claude Code on the web](https://claude.ai/code/routines). Create a routine on the app's repository, removing any connectors it doesn't need, and use the prompt Runway provides as its instructions. Then add an API trigger to the routine, save it, and paste its token and Fire URL into Runway. Runway stores the token encrypted and never shows it again.

To let the routine read issues, add the agent's API key as a [network secret](https://code.claude.com/docs/en/cloud-environments) of the routine's cloud environment. Keep in mind that routines are subject to Anthropic's own limits.

<figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FKb9GApnVArxxSUw7k41Q%2Fimage.png?alt=media&amp;token=0867e3e8-bf3c-47fb-899a-a7157ef67441" alt="" width="563"><figcaption></figcaption></figure>

#### Standard webhook agents

Standard webhook agents work with any service that can receive a webhook. Runway sends a `triageIssue.agentAssigned` event to the agent's URL when it's assigned to an issue, and a `triageIssue.agentUnassigned` event when it's unassigned. Check out [outgoing webhooks](https://docs.runway.team/webhooks/outgoing-webhooks) for more info.&#x20;

The `agentAssigned` payload includes a `targetBranch` and a `fixBranch`: your service reads the issue from `links.api` using the agent's API key, and pushes its fix to `fixBranch`. \
If your service opens its own pull request instead, include `runway-triage:<issue id>` in its description so Runway can link it to the issue. \
For the full payload, see our [API reference documentation](https://api-docs.runway.team).

Standard webhook agents can't be used with apps that have webhooks turned off.

<figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FTXKiquqwRLQCzSNEpNhe%2Fimage.png?alt=media&amp;token=5ddf7f8f-3ce0-4d15-a5fb-68161d496cee" alt="" width="563"><figcaption></figcaption></figure>

### Assigning issues to an agent

Agents show up alongside your teammates in an issue's assignee field, for the apps they're set up for. An issue can be assigned to one agent, and Runway starts the agent as soon as it's assigned. The agent works from the app's working branch. Agents assigned to closed issues aren't started.

<figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FJHQkWmLOUTiIgqWU4ih3%2Fimage.png?alt=media&amp;token=96e46332-2bb1-44b4-8ebf-435ebab95469" alt="" width="563"><figcaption></figcaption></figure>

To run an agent again on the same issue, unassign it and assign it again. If the agent already started work on the issue in the last 24 hours, Runway asks you to confirm before starting a new run.

The issue's timeline shows when an agent was assigned and how it was started (via webhook, GitHub Actions, or Claude routine, with a link to the GitHub Actions run), or why it couldn't be.

<figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FgO5d7kKzuQ5YMBdIgDMU%2Fimage.png?alt=media&amp;token=638b441a-2beb-4cbf-91e1-097b2299a0ed" alt="" width="563"><figcaption></figcaption></figure>

#### Agent issue limit

You can limit how many issues each agent can work on at the same time by navigating to [App settings](https://docs.runway.team/using-runway/app-settings) > Triage and setting the **Agent issue limit**. An issue stops counting towards the limit once the agent's pull request is linked, the agent is unassigned, the issue is closed, or 24 hours pass. \
Once an agent reaches the limit, it's greyed out in the assignee field. There's no limit by default.

<figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FaX3bY42Zj1QRWf8EcxXz%2Fimage.png?alt=media&amp;token=75e57a74-6ba1-447a-ae6d-e4e6807b9dfc" alt="" width="375"><figcaption></figcaption></figure>

### Pull requests from agents

Each time an agent is assigned, it gets its own fix branch (`runway-triage/<issue id>-<run id>`). Once the agent pushes to it, Runway opens a pull request against the working branch, titled after the issue, and adds it to the issue's timeline. Runway keeps watching the fix branch for 24 hours after the agent is assigned.

If the agent opens its own pull request on GitHub instead, Runway links it to the issue as long as its branch, title, or description mentions the issue, with `runway-triage:<issue id>`.

By default, a pull request from an agent is only linked to the issue, and someone on your team submits the fix request. If you'd rather have Runway do it, set **Agent pull requests** to "Runway submits a fix request automatically" in the Triage section of your [App settings](https://docs.runway.team/using-runway/app-settings). Runway then submits the fix request on the release the issue was reported on, or on the next release if the issue has none or the current release no longer takes fixes.&#x20;

\
The fix request shows the agent as its requester, and your [fix approval settings](https://docs.runway.team/using-runway/app-settings/fixes.md#fixes-settings) still apply.

<figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FQeEC6SDVTCXISrOSGN7B%2Fimage.png?alt=media&amp;token=c51fe53b-ca67-48b6-95c3-a526e5cdf135" alt="" width="563"><figcaption></figcaption></figure>

### Security recommendations

Issue text comes from your users, app store reviews, and tickets, so agents should always treat it as data rather than instructions. The sample workflows and the routine prompt already do this; if you write your own, we recommend doing the same.

We also recommend that your team:

* Protect the working branch, so a person reviews every pull request from an agent.
* Guard `.github/workflows/**` with CODEOWNERS or a required check.
* Give agents only the tools, connectors, and network access they need.
* Store the agent's API key as a secret, and regenerate it if it's ever exposed.
