> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sense-lab.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Runs

> Hand Sensei a piece of work. It does the work on its own computer and reports what it checked.

A run is a piece of work you hand to Sensei. The work happens in a sandbox on Sensei's side, so nothing runs on your machine. When the run ends you get a result that says what was done, what was checked and what Sensei could not confirm.

## Kinds of run

| Kind | What you give it | What comes back |
| - | - | - |
| An agent | A saved definition and its input | An output in the shape the definition names, with evidence |
| Steps | A definition that runs other agents in order | The output of the last step that ran |
| A one-off task | A task in your words, with no repository | A written result |
| A task on a repository | A repository and a task in your words | A change verified against the repository's tests and opened as a pull request, or an answer when the task was a question |
| Several tasks on a repository | A repository and a list of tasks | A verified change for each task, tested together, with pull requests that say how the changes fit. See [Several changes at once](https://docs.sense-lab.ai/sensei/runs/batches.md). |

A definition is a short YAML file your team keeps in a repository. See [Agents](https://docs.sense-lab.ai/sensei/runs/agents.md).

[Examples](https://docs.sense-lab.ai/sensei/runs/examples.md) has a worked case for each kind, with the command or the definition to start from.

## Start a run

> [tab] Dashboard
>
> Open **Runs** and click **New run**. Pick **An agent** to run a saved definition, or **A task** to describe the work. Under **More** you can choose a repository, a branch, a pull request, tools and a browser.
>
> ![The New run dialog for a task, with More opened: the task, the repository, the tools and the browser switch](https://mintcdn.com/senselab/7GJRxwA5n_G2FDq5/images/sensei/runs-new-task.png?fit=max\&auto=format\&n=7GJRxwA5n_G2FDq5\&q=85\&s=9a659a9283c803b1824d61e02322932d)
>
> A developer, admin or owner can start runs.

> [tab] Terminal
>
> ```bash theme={null}
> uv tool install senselab-sensei              # already installed? sensei update
> sensei login
>
> sensei run refund-requests -i ticket=48213   # a saved agent, by name
> sensei run "List the largest tables and why" --no-repo
> sensei run "Fix the failing test"            # in a checkout: a change to this repository
> ```
>
> The [CLI reference](https://docs.sense-lab.ai/sensei/reference/cli.md) lists every command.

> [tab] Python
>
> ```python theme={null}
> from sensei import Sensei
>
> sensei = Sensei()  # reads SENSEI_API_KEY
> r = sensei.run("refund-requests", ticket=48213)
> print(r.status, r.output, r.evidence, r.not_sure)
> ```
>
> See the [Python SDK](https://docs.sense-lab.ai/sensei/reference/python-sdk.md).

> [tab] JavaScript
>
> ```bash theme={null}
> npm install @senselab-ai/sensei
> ```
>
> ```ts theme={null}
> import { Sensei } from "@senselab-ai/sensei";
>
> const sensei = new Sensei();  // reads SENSEI_API_KEY
> const r = await sensei.run("refund-requests", { input: { ticket: 48213 } });
> console.log(r.status, r.output, r.evidence, r.notSure);
> ```
>
> See the [JavaScript SDK](https://docs.sense-lab.ai/sensei/reference/javascript-sdk.md).

> [tab] API
>
> ```bash theme={null}
> curl -X POST https://runs.sense-lab.ai/v1/runs \
>   -H "Authorization: Bearer $SENSEI_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{"agent": "refund-requests", "input": {"ticket": 48213}}'
> ```
>
> See the [Runs API](https://docs.sense-lab.ai/sensei/reference/runs-api.md).

You can also start runs from Claude, Cursor or Codex by chat. See [Run from a chat tool](https://docs.sense-lab.ai/sensei/runs/chat-tools.md).

## Statuses

| Status | Meaning |
| - | - |
| Queued | Accepted and waiting for a worker |
| Running | Sensei is working. Reads **Stopping** after you click **Stop**. |
| Waiting for you | The run has a question or a change to approve. Nothing is charged for the computer while it waits. |
| Verified | A check passed: the repository's tests, or the check command in the definition |
| Done | The run finished and no check applied |
| Not verified | There is a change and the tests do not prove it. Reads **Stopped at budget** when a limit ended the run. |
| Failed | A test that passed before now fails, a check failed, or the run could not continue |
| Stopped | Someone stopped it |

In the API and the CLI the same statuses are `queued`, `running`, `waiting`, `verified`, `done`, `unverified`, `failed` and `cancelled`.

## The Runs page

The strip at the top covers the last 30 days.

| Figure | Definition |
| - | - |
| Success rate | Correct runs over checked runs. A run is checked when a check ran or your team marked it. |
| Waiting for you | Runs that need a person. Click it to filter the table. |
| Delivered | Runs that produced a change, and how many were pull requests |
| Spent | What runs drew from the balance, with the median time to a verified result |

The table has a tab for each status, a search box and a repository filter. The **Result** column shows the test suite before and after the change for a repository with tests, and what Sensei said it did otherwise.

**Connections** opens the repositories and tools runs can use, and the settings and secrets the project gives them. A stored token or tool secret shows only its last four characters. A run's secret is never shown.

![The Runs page: four figures for the last 30 days, runs by week, and the table of runs with their standing, result, cost and time](https://mintcdn.com/senselab/7GJRxwA5n_G2FDq5/images/sensei/runs.png?fit=max\&auto=format\&n=7GJRxwA5n_G2FDq5\&q=85\&s=44e3b67146b236287774bd308c794fb1)

## A run's page

The header has the status, the repository and branch, the start time, duration, cost and attempts. Below it is a timeline of what Sensei did. The rail on the right holds the evidence: tests before and after, the change, and the budget used.

![A finished run's page: the header, the timeline of what Sensei did, and the rail with the verification, the change and the budget](https://mintcdn.com/senselab/7GJRxwA5n_G2FDq5/images/sensei/run-page.png?fit=max\&auto=format\&n=7GJRxwA5n_G2FDq5\&q=85\&s=244e60d69a454b8614b5653f7f945c5e)

Click the result to read it in full. Long results open with their sections collapsed, and **Expand all** opens them.

While a run is live you can **Stop** it. A stop ends the run within seconds, including a command that is in flight. The computer is destroyed with the run.

What you can do with a finished or waiting run is covered in [Review a run](https://docs.sense-lab.ai/sensei/runs/review.md).

## The model

A run's model calls go through your [routing rules](https://docs.sense-lab.ai/sensei/routing/overview.md), like any other call. With no rules, Sensei does the work. A rule that matches the key a run was started with, or its project, can send the run to a model on your own provider key or to a split. See [Choose the model](https://docs.sense-lab.ai/sensei/runs/models.md).

## Cost

A run draws from the same balance as your other calls: the tokens of its model calls, plus $0.005 for each minute its computer is up and $0.0025 for each minute a service beside it is up. See [Limits and cost](https://docs.sense-lab.ai/sensei/runs/limits.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.