# Custom agents (/agents-and-skills/custom-agents)
A custom agent is a saved Inspect configuration: instructions, skills, an allowed set of repositories, a model, and a Slack handle. Every session started with the agent gets that configuration, whoever starts it and wherever it starts. Use one when a team repeats the same kind of work, such as release reviews or production triage, and you want each run to follow the same playbook.
Create and edit agents in [Customize → Agents](https://app.inspect.com/customize/agents). You can also ask Inspect in a session to create or update an agent for you.
## Who can create and edit agents [#who-can-create-and-edit-agents]
Any member can create an agent. After that, only these people can edit it, add it to Slack, or delete it:
- The agent's creator.
- The people listed under **Collaborators**.
- Anyone with the **Manage all content** role.
Everyone else sees the agent's settings as read-only. Built-in agents can't be edited.
## Settings [#settings]
- **Name**, **Description**: Identify the agent when people pick one, and when Inspect searches for an agent by name to start a child session.
- **Instructions**: Added after Inspect's base instructions for every session the agent runs. Up to 100,000 characters. **Upload instructions** loads a text file of up to 1 MB.
- **Skills**: Catalog [skills](/agents-and-skills/skills) staged in every session the agent runs, on top of the skills the person starting it has turned on.
- **Repositories**: Limits which repositories the agent can work in. Leave it empty to allow every repository in your organization.
- **Repository hint**: Guidance, up to 500 characters, that Inspect uses to pick a repository when a request doesn't name one, for example `Use core for backend requests and web for UI work`.
- **Model**: The model for new sessions. **Each person's default** uses the default model of whoever starts the session. Either way, a person can still pick another model for their session.
- **Slack handle**: The `@handle` teammates mention in Slack. Lowercase letters, numbers, hyphens, and underscores, up to 80 characters.
- **Auto-reply channels**: Slack channels where the agent replies to every new top-level message. See [Slack](#slack).
- **Custom status reactions**: Replaces the emoji the agent reacts with in Slack while it works, finishes, and when its pull request merges or closes.
- **Collaborators**: People who can edit and archive the agent.
- **Session visibility**: **Public** sessions can be opened by anyone in your organization. **Private** sessions only by people with access, and a private agent can't reply in Slack. This setting isn't available to every organization yet.
The **Access** tab controls **Who can use this**: **Everyone in your organization**, or **Only people you choose**. When limited, only the listed people, the creator, collaborators, and people with **Manage all content** can start or prompt the agent's sessions.
### How repository limits apply [#how-repository-limits-apply]
- With one allowed repository, every session the agent starts works in that repository.
- With several, Inspect picks among them using the request and the **Repository hint**. If it can't pick one, the session fails with `Couldn't pick a repository automatically. Choose a repository and try again.`
- Requesting a repository outside the list fails with `Custom agent "" can only work in .`
### Instruction versions [#instruction-versions]
Each time an agent's instructions change, Inspect saves a numbered version with who made the change. Open the version history next to **Instructions** to compare any version with the current text and restore it. Restoring fills in the old text; save the agent to keep it. Each session records which instruction version it started with.
## Start a session with an agent [#start-a-session-with-an-agent]
- In the web app, choose the agent when you start a session.
- From another session, ask Inspect to start a child session with the agent by name, for example: "Start a child session in the analytics repository with the Data Investigator agent to compare activation rates for the latest onboarding experiment." Inspect looks the agent up, starts the child with its configuration, and the child reports back to the parent. See [Subagents and child sessions](/sessions/subagents).
- From an [automation](/automations), choose the agent in the automation editor. Each run uses the agent's instructions, skills, repositories, and model.
- From the [Inspect API](/api), pass the agent's ID when you create a session.
## Slack [#slack]
Each agent with a Slack handle appears in Slack as a user group with that handle, created through the Inspect Slack app. The Inspect Slack app has to be installed in your workspace first; see [Slack](/integrations/slack).
To make an agent reachable from Slack, choose **Add to Slack** from the agent's actions. If Slack setup breaks, the same action reads **Repair in Slack**. Renaming the handle later keeps the agent reachable because mentions route through the user group.
How the agent responds in Slack:
- Mention `@handle` with the request in the same message. The agent starts a session and replies in a thread.
- Messages posted by Slack workflows and other apps can mention the handle to start the agent.
- In an **Auto-reply channel**, the agent replies in a thread to every new top-level message posted by a person. It skips thread replies, edits, bot posts, and messages that already mention `@Inspect` or another agent. Invite `@Inspect` to the channel first; Inspect warns you when the bot isn't in a selected channel.
- People with the **Manage integrations** role can create a new public channel while choosing auto-reply channels.
A custom agent and `@Inspect` never share a session. Mentioning `@Inspect` in a custom agent's thread starts a separate Inspect session.
## Clone and archive [#clone-and-archive]
**Clone** copies an agent's name, description, instructions, model, repositories, repository hint, skills, visibility, and status reactions into a new agent you own, with a new Slack handle ending in `-clone`. Auto-reply channels aren't copied. You can only clone an agent you're allowed to use.
**Delete** archives the agent. Archived agents can't start new sessions and no longer appear in search, and Inspect disables the agent's Slack user group.
## Troubleshooting [#troubleshooting]
The agent is limited to specific people. Ask its creator or a collaborator to add you on the
**Access** tab.
Your Slack workspace restricts who can manage user groups. A Slack admin has to allow the Inspect app
to manage them.
A Slack user group with that handle already exists. Pick another handle or remove the existing group.
User groups need a paid Slack plan.
The Inspect Slack app is missing or its token expired. Reinstall it from
[Slack](/integrations/slack).
Check that the agent shows **Ready in Slack**. A message that mentions two agent handles starts
neither.
Invite `@Inspect` to the channel, and post a new top-level message. Thread replies don't trigger
auto-replies.
# Skills (/agents-and-skills/skills)
A skill is a folder with a `SKILL.md` file and optional supporting files, such as references and scripts, that teaches Inspect how your team does one kind of task. Inspect sees each available skill's name and description at the start of a session and reads the full `SKILL.md` only when the task calls for it, so a large library doesn't fill the context.
Skills come from three places:
- Catalog skills live in [Customize → Skills](https://app.inspect.com/customize/skills), shared across your organization. Everyone in the organization sees them.
- Repository skills are `SKILL.md` files committed under `.agents/skills/`, `.claude/skills/`, or `agents/skills/`. Every session working in that repository sees them.
- Built-in skills ship with Inspect. Everyone sees them; some appear only when the related feature is on for your organization.
MCP connectors can also serve skills. Those are off until whoever manages the connector turns them on; see [Connectors](/connectors).
## Catalog skills [#catalog-skills]
### Create a skill [#create-a-skill]
Choose **New skill** in [Customize → Skills](https://app.inspect.com/customize/skills), or **Import** to pick a `SKILL.md` or the files of a skill folder. You can also drop a folder onto the editor, or ask Inspect in a session to write the skill for you.
- The ID uses lowercase letters, numbers, and hyphens, up to 100 characters. It's also the slash command, as in `/release-notes`.
- A `SKILL.md` is required.
- The description can be up to 1,024 characters. If you leave it empty, Inspect uses the `description` from the `SKILL.md` frontmatter.
- Up to 20 files and 20 MB in total. File names must be relative paths inside the skill folder.
An ID can't reuse the ID of a built-in skill or of another skill in your organization.
### Who can change a skill [#who-can-change-a-skill]
The creator, the skill's **Collaborators**, and anyone with the **Manage all content** role can edit a skill. Deleting a skill can't be undone, and only the original creator or someone with **Manage all content** can create a new skill with a deleted skill's ID. Read-only users can't create skills. Built-in skills can't be changed.
### Invocation method [#invocation-method]
Each person chooses, per skill, how it reaches their sessions. The setting is personal and doesn't change anyone else's sessions.
- **Explicit invocation**: the skill loads only when a prompt uses its slash command, for example `/release-notes`.
- **Implicit invocation**: the skill is staged in every session you start, and Inspect loads it when its description matches the task.
A slash command works anywhere Inspect reads your prompt, including Slack and email, as long as the command is a separate word: `/release-notes` at the start of a line or after a space.
[Custom agents](/agents-and-skills/custom-agents) can list skills of their own. Those are staged in every session the agent runs, in addition to the skills the person starting the session has set to implicit.
## Repository skills [#repository-skills]
Commit skills to the repository when they describe how to work in that codebase. Inspect looks for `SKILL.md` files under these folders, at any depth:
```text
.agents/skills//SKILL.md
.claude/skills//SKILL.md
agents/skills//SKILL.md
```
Each `SKILL.md` needs YAML frontmatter with a `description`:
```markdown
---
name: db-migrations
description: Use when adding or changing a database table, column, or index. Covers generating the migration, naming, and the checks CI runs.
---
1. Edit the schema in `db/schema.ts`.
2. Run `pnpm db:generate` and commit the generated SQL.
...
```
- `name` defaults to the skill's folder name. Keep the two the same.
- A skill without a `description` is skipped. Descriptions are capped at 4,096 characters.
- Set `disable-model-invocation: true` to keep the skill out of the list Inspect sees. It can still be read when someone points Inspect at it.
- Scripts and references stay at their paths in the checkout, next to `SKILL.md`.
Inspect records the repository's skills when it builds the repository image and checks the checkout again when the session sandbox starts. If the inventory is incomplete, Inspect is told to look under the skill folders on demand.
When a repository skill and a catalog skill share a name, the repository skill wins.
## How Inspect loads skills [#how-inspect-loads-skills]
1. When a session starts, Inspect collects your implicit catalog skills, built-in skills, the agent's skills, any skills named by slash command in the prompt, and the repository's skills.
2. Catalog skills are copied into the sandbox. Repository skills are read in place.
3. Inspect receives a list of each skill's name, description, and path. When a repository has more skills than the list's size budget allows, the rest are listed by name and path only.
4. When a task matches a description, or the prompt names the skill, Inspect reads that `SKILL.md` and follows it.
Inspect refreshes the list when the session switches repositories or the sandbox is replaced.
## Write a description Inspect can match [#write-a-description-inspect-can-match]
The description is the only part Inspect sees before it decides to load a skill. Say when to use the skill in terms of the task, for example "Use when writing release notes for a mobile release", rather than what the skill contains.
## Troubleshooting [#troubleshooting]
Check the path matches one of the three folders and that the frontmatter is valid YAML with a
`description`.
Its invocation method is **Explicit invocation**. Switch it to **Implicit invocation**, or name it
with `/skill-id` in the prompt.
The ID must match exactly and stand alone: `/release-notes,` works, `see/release-notes` doesn't.
Another skill in your organization uses that ID. Edit that skill or choose another ID.
A deleted skill used that ID. Choose another ID, or ask its creator or someone with **Manage all
content** to create it.
Built-in IDs are reserved. Choose another ID.
Combine references or move large files into the repository.
Remove absolute paths and `..` segments from file names.
# API keys (/api/api-keys)
API keys authenticate calls to the [Inspect API](/api) and [Inspect MCP](/api/mcp). Inspect has two kinds.
Personal keys start with `riu_`.
- Act as you, with your roles and repository access.
- Open pull requests under your GitHub account.
- Any member can create them.
- Each person can have any number of named keys.
- The only option is a name.
- Revoked automatically when unused for 21 days.
System keys start with `ris_`.
- Act as a system user with its own name and avatar.
- Open pull requests as Inspect.
- Creating one requires **Manage API keys** or **Admin**.
- Each system user has exactly one key.
- Options are name, **Read-only**, **Allowed repositories**, and **Tags**.
- Kept when unused for 21 days.
Manage keys at [Settings → API keys](https://app.inspect.com/settings/api-keys). People with **Manage API keys** also see everyone's personal keys under **User keys** and the organization's system keys under **System keys**.
## Create a personal key [#create-a-personal-key]
1. Open [Settings → API keys](https://app.inspect.com/settings/api-keys) and choose **Create API key**.
2. Enter a **Key name** that says where the key is used, then choose **Generate key**.
3. Copy the key. Inspect shows it once and stores only a hash.
Send it as a bearer token:
```http
Authorization: Bearer riu_...
```
A personal key can do what you can. If you haven't linked a GitHub account, your keys are read-only too. Keep keys in a secret manager, and never put them in browser code, logs, or source control.
## Create a system key [#create-a-system-key]
Use a system key for an integration that shouldn't depend on one person's account. Under **System keys**, create a key and set:
- **Read-only**: sessions can read data but not make changes. Write requests fail with `403 read_only_api_key`.
- **Allowed repositories**: the key can only work in these repositories. Requests for others fail with `403 repository_not_allowed`. Leave it empty to allow every repository.
- **Tags**: labels you can filter system keys by.
## Scopes [#scopes]
When API key scopes are available for your organization, you can limit what a personal or system key can call. Under **Permissions**, choose **Selected resources**, then add a row for each resource the key needs with **Read** or **Write** access. **Write** also grants **Read**. Each endpoint in the [API reference](/api) lists the scope it requires, such as `sessions:read` or `previews:write`. Keys set to **All endpoints** can call every endpoint.
## Rotate and revoke [#rotate-and-revoke]
**Rotate** replaces a key's secret and keeps its name and settings. The old value stops working immediately, so update the integration right after rotating. Rotating a personal key also resets its last-used time.
**Revoke** deletes a key permanently. People with **Manage API keys** can revoke anyone's personal key and delete system keys.
Deactivating a person stops all of their keys, because Inspect only authenticates keys whose owner is active.
Every create, rotate, and revoke is recorded in the [audit log](/security/audit-logs) with the key's prefix.
### Automatic revocation [#automatic-revocation]
Once a day, Inspect revokes personal keys that haven't been used for 21 days, or were never used and are older than 21 days. Inspect updates a key's last-used time at most every 5 minutes. System keys are never revoked this way. People with **Manage API keys** can run the same cleanup on demand.
## IP allowlist [#ip-allowlist]
When the API key IP allowlist is available for your organization, people with **Manage security** can restrict where keys work from under **API key IP allowlist** at [Settings → Security](https://app.inspect.com/settings/security). Each entry has a **Name**, the IP addresses or CIDR ranges it allows, and **Applies to**: **All API keys**, **Personal keys**, or **System keys**.
- A key type that no entry applies to works from any address.
- A key type that one or more entries apply to works only from addresses in those entries.
- Changes reach every request within about 30 seconds and are recorded as `api_key_ip_allowlist.updated`.
Requests from other addresses fail with `403 api_key_ip_not_allowed`. Add the address to the allowlist, or call from an allowed network.
## Troubleshooting [#troubleshooting]
The header doesn't contain a complete key. Check for truncation or a missing `Bearer ` prefix.
The key was revoked, rotated, or automatically revoked after 21 days unused. Create or rotate a key.
The key's owner is deactivated.
See [IP allowlist](#ip-allowlist).
# API (/api)
The Inspect API lets your code start and prompt sessions, read their messages, diffs, and cost, and manage agents, skills, automations, memories, artifacts, and repositories. The endpoint reference is generated from the [OpenAPI schema](/api/openapi.json) and listed in the navigation. To use the same API from an AI tool, connect [Inspect MCP](/api/mcp).
## Base URL [#base-url]
Every endpoint is under:
```text
https://app.inspect.com/api/v2
```
## Authentication [#authentication]
Send an [API key](/api/api-keys) as a bearer token:
```sh
curl 'https://app.inspect.com/api/v2/sessions' \
--header "Authorization: Bearer $INSPECT_API_KEY"
```
A request acts as the key's owner, with that person's permissions and repository access. Sessions created with a personal key open pull requests under the owner's GitHub account. System keys act as a system user and open pull requests as Inspect. See [API keys](/api/api-keys) for both types.
## Requests [#requests]
Request bodies are validated strictly. A body with a field the endpoint doesn't define, including inside a nested object, fails with `400` and a message that names the field, such as `Unrecognized key: "promt"`. Map fields such as `variables` accept any keys, and free-form JSON fields such as `output_schema` accept any content. Unknown query parameters are ignored.
## Rate limits [#rate-limits]
Limits are counted per caller and per organization over one-minute windows.
| Requests | Per caller | Per organization |
| ------------------------------------------- | ---------------------------- | ----------------- |
| Any `/api/v2` endpoint | 1,200 per minute per API key | 12,000 per minute |
| `POST /api/v2/sessions` | 120 per minute | 1,200 per minute |
| `POST /api/v2/sessions/{session_id}/prompt` | 120 per minute | 1,200 per minute |
A request over a limit can be rejected with `429`, a `Retry-After: 60` header, and this body:
```json
{ "message": "Too many requests. Try again shortly.", "code": "rate_limited" }
```
Back off for the `Retry-After` interval before retrying.
## Errors [#errors]
Errors return JSON with a human-readable `message` and a machine-readable `code`. Each endpoint's reference lists the codes it can return. Common ones:
| Status | Code | Meaning |
| -------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
| 400 | `invalid_request_body` | The body failed validation. |
| 400 | `malformed_json` | The body isn't valid JSON. |
| 400 | `invalid_cursor` | The pagination cursor is invalid. |
| 401 | `unauthenticated` | The API key is missing, malformed, revoked, or belongs to a deactivated user. |
| 403 | `read_only_api_key` | The key is read-only and the request makes a change. |
| 403 | `repository_not_allowed` | The key is limited to other repositories. |
| 403 | `api_key_ip_not_allowed` | The request came from an address outside your organization's [API key IP allowlist](/api/api-keys#ip-allowlist). |
| 403 | `api_key_scope_not_allowed` | The key's scopes don't cover this endpoint. |
| 404 | `session_not_found`, `not_found` | The resource doesn't exist or the key's owner can't see it. |
| 409 | `session_cost_limit_reached` | The session reached a [spend limit](/security/spend-limits). A soft limit can be continued from the session page. |
| 429 | `rate_limited` | See [Rate limits](#rate-limits). |
| 502, 504 | `upstream_error`, `upstream_timeout` | A service Inspect depends on failed or timed out. Retry. |
# Inspect MCP (/api/mcp)
Inspect MCP lets AI tools that speak the Model Context Protocol hand work to Inspect. From an editor, terminal, or chat app, you can start a session, check on it, send follow-ups, and use anything else in the [Inspect API](/api).
The server URL is . Tools that support MCP OAuth connect by signing in to Inspect in the browser. Other tools send an [API key](/api/api-keys) in the `Authorization` header.
## What the server exposes [#what-the-server-exposes]
The server offers two tools over the public API:
- `search` runs JavaScript against the OpenAPI schema so the client can find endpoints and their parameters.
- `execute` runs JavaScript that calls `/api/v2` endpoints through `codemode.request`, so one tool call can chain several requests and return only what's needed.
Each tool call has 60 seconds to finish. Calls can only reach paths under `/api/v2/`. Requests run as you, with the same permissions, [rate limits](/api#rate-limits), and [spend limits](/security/spend-limits) as direct API calls. With an API key, the key's restrictions, such as read-only and the [IP allowlist](/api/api-keys#ip-allowlist), apply too.
## Connect with OAuth [#connect-with-oauth]
Clients that support MCP OAuth connect to the same URL without an API key. The client opens Inspect in your browser, where you sign in and approve it. Approval grants the `codemode` scope: the client can use the two tools above as you, with your current permissions. OAuth tokens work only through the MCP server, not against the REST API directly.
## Connect your tool [#connect-your-tool]
### Create an API key [#create-an-api-key]
Open [Settings → API keys](https://app.inspect.com/settings/api-keys), choose **Create API key**, and copy the key. Inspect shows it only once. Personal keys unused for 21 days are revoked automatically. Claude chat and ChatGPT on the web sign in with OAuth instead, so you can skip to step 3 for them.
### Save the key on your computer [#save-the-key-on-your-computer]
Set `INSPECT_API_KEY` for Claude Code, Codex, Cursor, Copilot CLI, and OpenCode; the macOS and Linux commands below save the key in your shell configuration. Replace `paste-your-api-key-here` with your key and run the command for your system.
```sh
echo 'export INSPECT_API_KEY="paste-your-api-key-here"' >> ~/.zshrc
source ~/.zshrc
```
If your terminal uses Bash, replace `~/.zshrc` with `~/.bashrc`.
```powershell
setx INSPECT_API_KEY "paste-your-api-key-here"
```
Windows applies the variable only to programs started after you run the command.
Quit and reopen any app or terminal that was already open so it picks up the key. Skip this step for Glass, VS Code, and Antigravity: you paste the key into them directly.
### Add Inspect to your tool [#add-inspect-to-your-tool]
Pick your tool and follow its tab.
**Claude Code**
This covers Claude Code in the terminal, in your editor, and in the **Code** tab of the Claude desktop app. Run this in your terminal once:
Run `claude mcp list` to confirm that `inspect` shows as connected.
**Claude chat**
To use Inspect in regular Claude chats on claude.ai, the desktop app, or Cowork, add it as a custom connector. You don't need an API key for this.
1. Open [Customize → Connectors](https://claude.ai/customize/connectors), choose **+ Add**, then **Add custom connector**.
2. Name it `Inspect`, paste the server URL above, and choose **Continue**.
3. Choose **Add**, then **Connect**, and approve Claude in the Inspect window that opens.
On Team and Enterprise plans, an owner adds the connector in **Organization settings → Connectors**, and each member then connects with their own Inspect account.
The ChatGPT desktop app, the Codex CLI, and the Codex IDE extension share one config file, so you set this up once for all three.
Add this to `~/.codex/config.toml`, creating the file if it doesn't exist:
Restart the app, or start a new Codex session in the terminal and run `/mcp` to confirm that `inspect` is listed.
ChatGPT on the web connects to custom MCP servers through **Plugins** on Business and Enterprise plans. Add Inspect's server URL there and sign in to Inspect when asked.
To add it by hand, add this to `~/.cursor/mcp.json`, creating the file if it doesn't exist:
Restart Cursor and check that `inspect` shows as enabled in the MCP section of Cursor Settings.
**Copilot CLI**
Run this in your terminal:
**Copilot in VS Code**
Open the Command Palette (`Cmd+Shift+P` on macOS, `Ctrl+Shift+P` on Windows and Linux), run **MCP: Open User Configuration**, and add this. If the file already lists servers, add the `inspect` entry and the `inputs` entry to what's there.
Save the file and choose **Start** above the `inspect` entry. VS Code asks for your API key once and stores it securely. Inspect tools then appear in Copilot Chat's agent mode.
Glass has Inspect built in, so there's nothing to install.
1. In Glass, open **Settings → Plugins** and choose **Inspect**.
2. Paste your API key and choose **Connect Inspect**.
3. Start a new chat to use it.
If Inspect isn't in the list, a Glass admin needs to turn it on in **Organization settings → Plugins**.
In Antigravity, open the MCP servers settings and choose **Copy Config File Path**. Open that `mcp_config.json` file and add this, replacing `paste-your-api-key-here` with your API key:
The same file format works in the Antigravity app, IDE, and CLI.
Add this to `~/.config/opencode/opencode.json` for every project, or to `opencode.json` in one project. If the file already has an `mcp` section, add only the `inspect` entry.
Run `opencode mcp list` to confirm that `inspect` is connected.
Any tool that supports remote MCP servers over Streamable HTTP with custom headers, such as Gemini CLI, Devin Desktop, or Zed, can connect with these values:
A tool that only offers a sign-in button for MCP servers can connect too: give it the server URL and approve it in the Inspect window that opens.
### Try it [#try-it]
Ask your tool something like:
> Use Inspect to list my five most recent sessions.
If it answers with your sessions, you're connected. Next, try:
> Start an Inspect session in our web repository to fix the flaky checkout test.
## Use your organization's skills [#use-your-organizations-skills]
The server also shares the Inspect skills you can see through the [MCP Skills extension](https://modelcontextprotocol.io/extensions/skills/overview). Each skill is a `skill:///` directory whose `SKILL.md` and supporting files are MCP resources. Clients that support the extension discover skills with `skills/list` and `skills/get`; other clients can browse and read the same files as resources. A skill whose `SKILL.md` does not follow the [Agent Skills](https://agentskills.io/specification) naming rules stays readable but is not listed.
## Troubleshooting [#troubleshooting]
The sign-in expired or was revoked. Disconnect Inspect in the tool, connect again, and approve it in
the Inspect window that opens.
The tool isn't sending a valid key. Check that the key is saved as `INSPECT_API_KEY`, then quit and
reopen the tool. Apps opened from the Dock or Start menu don't always see variables set in a
terminal; restart the computer or paste the key into the config instead. If the key was revoked,
unused for 21 days, or copied incompletely, create a new one in [Settings → API
keys](https://app.inspect.com/settings/api-keys).
Your organization's API key IP allowlist doesn't include your address. See [IP
allowlist](/api/api-keys#ip-allowlist).
Most tools read MCP settings only at startup. Restart the tool, and check the config file for a
missing comma or bracket.
# Send messages to Operate (/api/operate-messages)
Operate is your private Inspect agent. A local coding agent can hand it a follow-up, such as "once this PR merges, watch the checkout error rate for an hour", with a [user API key](/api/api-keys). The message only ever reaches the Operate of the API key's owner.
Operate reads the message as a request from another of your agents, not as a message from you. It can read systems, check back later, and message you, but it asks you before it changes anything.
## Send a message [#send-a-message]
`POST /api/v2/operate/messages` takes a `message` of up to 4,000 characters and an optional self-reported `label` of up to 200 characters:
```sh
curl 'https://app.inspect.com/api/v2/operate/messages' \
--request POST \
--header "Authorization: Bearer $INSPECT_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"message": "Once https://github.com/acme/web/pull/4182 merges, watch the checkout error rate for an hour and tell me if it rises.", "label": "Claude Code in acme/web"}'
```
A `202` response returns `{"data": {"delivered": true}}`. `delivered` is `false` when the same key already sent the same message in the last 7 days.
| Status | Code | Meaning |
| ------ | -------------------- | --------------------------------------------------------------- |
| `403` | `read_only_api_key` | Read-only keys cannot send messages. |
| `403` | `forbidden` | Keys limited to repositories cannot reach Operate. |
| `404` | `not_found` | Operate is not available to you. |
| `409` | `no_operate_session` | You have no Operate yet. Send the Operate bot a Slack DM first. |
## Install the skill [#install-the-skill]
The `tell-operate` skill tells a local agent when and how to call this endpoint. Install it where your agent loads skills, for example for Claude Code:
```sh
mkdir -p ~/.claude/skills/tell-operate
curl --fail 'https://docs.inspect.com/skills/tell-operate/SKILL.md' \
--output ~/.claude/skills/tell-operate/SKILL.md
```
For Codex, use `~/.codex/skills/tell-operate`. Then set `INSPECT_API_KEY` to your API key and `INSPECT_BASE_URL` to `https://app.inspect.com` in the agent's environment.
# Datadog (/automations/datadog)
A Datadog trigger starts a run when a specific monitor transitions to alert or warning. Use it to begin an investigation the moment a monitor fires, and to post the findings in the same Slack thread as the alert.
## Requirements [#requirements]
- Connect Datadog in [Customize → Connectors](https://app.inspect.com/customize/connectors) with an API key and an application key. Until Datadog is connected, the trigger shows **Connect Datadog to use this trigger**.
- The keys must be able to read and update the monitors you choose and to manage webhooks, because Inspect edits the monitor to notify it.
## Add the trigger [#add-the-trigger]
1. Select **Datadog** under **Add trigger**.
2. Under **Datadog monitor**, search for a monitor by name, or paste its URL and select **Use this monitor URL**. **Datadog site** follows your connection or the pasted URL; change it before searching if the monitor lives on another site.
3. Under **Run for**, choose which transitions start a run:
- **Alert**: Triggered, Re-Triggered, Renotify.
- **Warning**: Warn, Re-Warn.
- **Alert and warning**: all of the above.
Recoveries and other transitions never start runs.
## How Inspect connects to the monitor [#how-inspect-connects-to-the-monitor]
When you save, Inspect checks that the monitor exists and that your keys can access it. It then creates an Inspect webhook in Datadog and adds its `@webhook-inspect_…` mention to the monitor's message. The trigger shows **Setup pending** until the monitor is ready, then **Active**. If setup fails, the trigger shows the error; fix it, then select **Retry setup**.
Leave the `@webhook-inspect_…` mention in the monitor message. Removing it stops the monitor from starting the automation. Inspect removes the mention when you delete the trigger.
## Reply in the Datadog Slack thread [#reply-in-the-datadog-slack-thread]
When the monitor also notifies a Slack channel, keep **Reply in the matching Datadog Slack message thread** selected and set the automation's **Slack channel** to that same channel. Inspect finds the monitor's Datadog notification in the channel and replies in its thread. Clear the option to post a new message instead.
## Payload [#payload]
| Field | Type | Description |
| ------------------------------------- | ---------- | ------------------------------------- |
| `monitor_id`, `monitor_name` | `string` | The monitor. |
| `transition`, `status` | `string` | What happened, such as Triggered. |
| `message` | `string` | The monitor's notification message. |
| `tags` | `string[]` | Monitor tags as a list. |
| `occurred_at`, `cycle_id`, `event_id` | `string` | When it happened and its identifiers. |
| `link` | `string` | The event in Datadog. |
Each notification starts one run. Redeliveries of the same notification don't start another.
## Limits [#limits]
Datadog triggers are tied to the owner's Datadog connection, so an automation with one:
- Can't be made public or forked.
- Can't be transferred. Remove the trigger first.
- Can be archived only by its owner or someone with the **Admin** or **Manage all content** role.
## Example [#example]
Pair a Datadog trigger with a Production Triage [custom agent](/agents-and-skills/custom-agents). On each alert, the agent reviews the relevant logs, traces, and recent deploys, then replies in the monitor's Slack thread with its assessment and a suggested next step.
# GitHub (/automations/github)
GitHub triggers start a run when something happens in a repository connected to Inspect. Four trigger types are available under **Add trigger** > **GitHub**:
- **Push**: a push to a branch that changes a file matching your patterns.
- **Pull request**: pull requests opened, made ready, reopened, updated, labeled, merged, or closed.
- **Status check**: a completed check run or commit status with a matching result.
- **PR comment**: a new pull request comment, inline review comment, or review summary.
## Requirements [#requirements]
- The repository must be added to Inspect through the Inspect GitHub app. See [Repositories](/sessions/repositories) and [GitHub](/integrations/github).
- To have the session start on the branch that triggered it, select the same repository under the automation's **Repositories**. Otherwise sessions start on the repository's default branch.
## Push [#push]
Choose a repository, then enter **Files**: comma-separated paths or glob patterns such as `packages/api/**, backend/**/*.ts`. Patterns match dotfiles.
- **Branch** takes an exact name or a glob such as `release/*`. Start it with `!` to exclude branches, as in `!gh-readonly-queue/**`. Leave it blank for every branch.
- Conditions narrow the push further:
- **Pushed by** is any of, or none of, the listed GitHub logins.
- **Pusher type** is **Person** or **App or bot**.
- **PR author** is any of, or none of, the listed logins, for the author of the pull request that introduced the pushed commit (a merged one when there are several). If Inspect can't look the pull request up, this condition doesn't match.
A push starts a run only when at least one added, modified, or removed file matches a pattern. Branch deletions and tag pushes never fire.
| Field | Type | Description |
| ---------------------- | ---------- | -------------------------------------------------- |
| `repository`, `branch` | `string` | Where the push landed. |
| `pusher` | `string` | GitHub login of the pusher. |
| `pull_request_author` | `string` | Present when a PR author condition looked it up. |
| `commits` | `array` | Each commit's SHA, message, author email, and URL. |
| `matching_files` | `string[]` | Changed files that matched your patterns. |
| `all_changed_files` | `string[]` | Every changed file in the push. |
Each trigger starts at most one run per pushed head commit, so redeliveries don't start another. Two push triggers on one automation that both match start two runs.
## Pull request [#pull-request]
Choose a repository, or keep **All repositories** to watch every repository in Inspect, including ones added later. Under **Events**, choose what fires it:
- **Opened**: a pull request is opened, including as a draft.
- **Marked ready for review**: a draft becomes ready.
- **Reopened**: a closed pull request is reopened.
- **New commits pushed**: the pull request's branch gets new commits.
- **Label added**: a label is added.
- **Merged**: the pull request merges.
- **Closed without merging**: the pull request closes unmerged.
New triggers start with **Opened** and **Marked ready for review** plus a **Draft** is **No** condition, so each pull request fires once when it's ready for review. Remove the draft condition to include drafts.
Conditions (all must match):
- **Author** is any of, or none of, the listed GitHub logins, such as `dependabot[bot]`.
- **Author type** is **Person** or **App or bot**.
- **Source branch** or **Target branch** matches any of, or none of, glob patterns such as `dependabot/**`.
- **Files** matches any of, or none of, glob patterns against the changed files, including the old path of renamed files. GitHub lists at most 3,000 files per pull request.
- **Draft** is yes or no.
- **Labels** include any of, or none of, the listed labels.
- **Title** contains, does not contain, starts with, ends with, is exactly, or is not exactly a value. Text matching ignores case.
- **Number** is any of, or none of, specific pull request numbers.
| Field | Type | Description |
| ----------------------------------------------------------------------- | -------- | ------------------------------------------------------ |
| `event` | `string` | Which event fired. |
| `pr_number`, `pr_title`, `pr_body`, `pr_url` | `string` | The pull request. |
| `pr_head_branch`, `pr_head_repository`, `pr_head_sha`, `pr_base_branch` | `string` | Branches and head commit. |
| `pr_draft`, `pr_labels`, `added_label` | `text` | Draft state, current labels, and the label just added. |
| `pr_author`, `pr_author_type`, `sender` | `string` | Who opened it and who caused the event. |
| `repository`, `repository_url` | `string` | The repository. |
The session starts on the pull request's head branch, or on its target branch for **Merged** and **Closed without merging**. With **All repositories**, select **(Auto)** under **Repositories** so each run starts in the pull request's repository.
Each trigger starts at most one run per pull request, event, and head commit (and per label for **Label added**).
For example, to triage every Dependabot pull request across your organization: keep **All repositories** and the default events, add **Author** is any of `dependabot[bot]`, select **(Auto)** under **Repositories**, and write the triage steps as the prompt.
To add checks to each pull request's review instead, see [Review agent repository rules](/code-review/review-agent#repository-rules). To approve pull requests from particular authors, see [Approval agent](/code-review/approval-agent).
## Status check [#status-check]
Choose a repository and one or more **Results**. New triggers select the failure results: failure, error, timed out, startup failure, and action required. The other results are success, cancelled, neutral, and skipped.
- **Branch** is an exact branch name for the commit being checked, not a pull request's target branch. Events whose branch GitHub doesn't report are skipped when **Branch** is set.
- **Check names** takes comma-separated names or glob patterns such as `buildkite/**`. Leave it blank for every check.
The trigger fires on completed check runs and on commit statuses that aren't pending, including on branches without an open pull request. Check suite summaries never fire, because their check runs already do.
| Field | Type | Description |
| ----------------------------------------- | -------- | -------------------------------------- |
| `check_name`, `result` | `string` | The check and its outcome. |
| `commit_sha`, `commit_url` | `string` | The checked commit. |
| `branch`, `branches` | `text` | The checked branch or branches. |
| `source`, `provider` | `string` | check_run or status, and the provider. |
| `check_url`, `details_url`, `description` | `string` | Links and the check's summary. |
Each trigger starts one run per check, result, and commit. Reruns that report the same result on the same commit don't start another run.
For "whenever a check fails on `main`, triage and fix it", select the repository, set **Branch** to `main`, keep the default results, select the same repository under **Repositories**, and write that instruction as the prompt.
## PR comment [#pr-comment]
Choose a repository and add conditions. All must match:
- **Comment text** contains, does not contain, starts with, ends with, is exactly, or is not exactly a value. Matching ignores case.
- **Comment types**: conversation comments on the pull request timeline, inline review comments on the diff, or submitted review summaries.
- **Author type** is **Person** or **App or bot**.
- **Comment author** is any of, or none of, the listed GitHub logins.
New triggers start with **Author type** is **Person**. Removing every condition matches bot comments too, which loops if the automation comments on the same pull request.
Only new comments fire; edits and deletions don't. A review submitted with only inline comments fires through those inline comments, not through its empty summary.
| Field | Type | Description |
| ----------------------------------------------------------- | -------- | ----------------------------------------- |
| `comment_body`, `comment_kind`, `comment_url`, `comment_id` | `string` | The comment. |
| `comment_author`, `comment_author_type` | `string` | Who wrote it. |
| `path`, `line` | `text` | File and line, for inline comments. |
| `review_state` | `string` | The review's state, for review summaries. |
| `pr_number`, `pr_title`, `pr_url` | `string` | The pull request. |
| `pr_head_branch`, `pr_head_repository`, `pr_base_branch` | `string` | Branches. |
The session starts on the pull request's head branch when the pull request comes from the same repository. Pull requests from forks start on the default branch.
Each comment starts at most one run per trigger. Anyone who can comment on the pull request can fire the trigger, so have the prompt check the commenter's permissions before acting on a request.
For example, **Comment text** starts with `/inspect` and **Author type** is **Person** lets reviewers ask Inspect for help directly from a pull request.
## Troubleshooting [#troubleshooting]
No changed file matched **Files**, the branch didn't match, or the push was a branch deletion or tag.
The default **Draft** is **No** condition. Remove it or add **Marked ready for review**.
The provider doesn't report the branch for that check. Clear **Branch** and filter in the prompt.
The repository isn't selected under **Repositories**, or the pull request comes from a fork.
The trigger has no **Author type** is **Person** condition, so the automation's own comments match.
# Automations (/automations)
An automation is a saved prompt that starts an unattended Inspect session each time one of its triggers fires. Use one for work that should happen without someone asking: a weekday health check, triage of every failing CI check on `main`, a first look at each new Sentry alert. Every run is an ordinary session you can open, read, and continue.
## Triggers [#triggers]
An automation can have any number of triggers, of any mix of types. Each trigger keeps its own configuration and enabled state, so you can pause or remove one without touching the others. Conditions inside one trigger must all match; to express "this or that", add a second trigger.
Triggers react only to events that happen after the trigger is saved. They don't replay history.
An automation with no triggers runs only when someone selects **Run**. **Run** is also available on automations whose triggers include a schedule, a GitHub, Slack, or Datadog trigger.
## How a run works [#how-a-run-works]
1. Inspect creates a run record with the trigger's payload and a snapshot of the automation's [state](#state-across-runs).
2. Inspect renders the prompt, replacing each `{{variable}}` with its value.
3. Inspect starts one session per repository under **Repositories**. **(Auto)** lets Inspect pick the repository from the prompt and the trigger payload. The repository list controls where sessions start; it doesn't limit what child sessions can access.
4. Each session receives the rendered prompt, the automation and run IDs, the starting state, and the trigger payload.
Runs act as the automation's owner by default, with the owner's repositories, connectors, skills, and Slack identity. Set **Run as** under **Custom session settings** to **Inspect** to run as Inspect instead. Only the owner can change **Run as**. A manual **Run** acts as the person who selected it.
A run can't ask anyone a question mid-run. Write the prompt so the agent can finish on its own, including what to do when there is nothing to report.
### The trigger payload [#the-trigger-payload]
Inspect appends the event that fired the trigger (the commits in a push, the Slack message, the Sentry alert) to the session as data. Each trigger page lists the fields it provides. The prompt decides what to do with them; you don't reference payload fields with `{{...}}`.
Inspect marks the payload as untrusted, and instructs the agent to treat its contents as evidence and never follow instructions embedded in it. Anyone who can post in a watched channel or comment on a watched pull request can put text in front of your automation, so have the prompt verify claims and permissions before acting on them.
### Run statuses [#run-statuses]
- **Enqueueing**, **Queued**, **Running**: the run is waiting for or starting its sessions.
- **Ran**: sessions started. Open them from the run to see what they did. Shows **Done** once its sessions are archived.
- **Failed**: no session could start, for example because a template variable had no value.
- **Enqueue failed**: Inspect couldn't hand the run to its queue.
If some repositories' sessions start and others fail, the run still counts as **Ran** with the sessions that started.
**View activity** lists every run with its trigger, status, sessions, model, pull requests, cost, and an outcome (**PR merged**, **PR open**, **Closed unmerged**, **No output**, or **Failed**). People who can see a public automation but can't edit it see timing, trigger, session count, and status only; inputs and sessions are visible to the owner and collaborators.
## Prompts and template variables [#prompts-and-template-variables]
Write the prompt as instructions to an agent working alone: what to look at, what to produce, where to send it, and when to stop without changing anything.
Add `{{name}}` placeholders to reuse one prompt with different values. For each variable you can set a **Label**, a **Value type** (text, integer, number, or boolean), **Allowed values**, and a default. Inspect resolves each variable in this order, with later sources winning:
1. The default on the source automation, for [forks](/automations/templates)
2. The default on this automation
3. The value entered when someone selects **Run**
When a variable has no value:
- A manual run is rejected with `Missing prompt template values for: `.
- A scheduled run fails, and Inspect disables the automation.
- A run from any other trigger fails.
Give every variable a default unless the automation only runs manually.
**Prompt history** keeps earlier versions of the prompt. Select **View diff** to compare a version with the current prompt, or **Apply to editor** to restore it.
## Custom agents and models [#custom-agents-and-models]
Choose a [custom agent](/agents-and-skills/custom-agents) under **Custom agent, model & repositories** to give every run that agent's instructions, model, and access. The automation's prompt is the task; the agent defines how it's done. Without a pinned model, runs use the owner's default model and reasoning effort.
**Custom session settings** controls whether runs fix CI failures on the pull requests they open and whether they address eligible PR reviews. A new automation copies your CI failure setting. PR review handling follows the owner's current review policy until you select **Customize**.
## State across runs [#state-across-runs]
Runs can keep small values for later runs with the `automation_state` tool: an external page ID, a cursor, a counter, or the list of findings already reported. Values are strings, so store structured data as JSON strings.
- Each run starts from a snapshot taken when the run is created. Queued or overlapping runs don't see each other's writes, but every write persists for runs created afterward.
- A run's starting context includes up to 10,000 characters of state values, most recently written first, then up to 200 other key names. The agent reads anything beyond that with `automation_state` (up to 500 keys per page and 50,000 characters per read).
- One call can apply up to 100 updates (set, delete, or increment).
- The owner and collaborators can view, delete, or clear keys from the automation's **State** page.
Don't store credentials, secrets, or generated output in state.
For example, a weekly status automation can create a Notion page on its first run and save the page ID under `notion_status_page_id`. Later runs update the same page instead of creating new ones. Tell the prompt to replace the saved ID only after it creates a new page because the old one is gone.
## Slack delivery [#slack-delivery]
Set a **Slack channel** to give the automation a default place to post. Runs post there with `send_slack_channel_message`, and every post from one run goes into the same thread.
- **Post to channel on automation start** is on by default: each run posts when it starts and continues in that thread. Turn it off to have a run post only when it finds something worth sharing.
- **Tag users/groups** adds Slack mentions to the run's posts.
- **Ping collaborators after merge** mentions collaborators in the run's thread, or in a group DM when there is no thread, when a pull request the automation created merges.
Requirements:
- The owner must have linked their Slack account. Without it, runs don't post.
- The posting bot must be in the channel. For an automation with a custom agent that has its own Slack app, invite that bot. Otherwise invite Inspect. Inviting a custom agent's user-group handle doesn't give the shared Inspect bot access.
- For a private channel, paste the channel's link into **Slack channel**, then invite the bot.
- People with the **Admin** or **Manage integrations** role can create a public channel from the channel field by typing a new name and selecting **Create**.
## Ownership, collaborators, and visibility [#ownership-collaborators-and-visibility]
- The owner can edit, run, enable or disable, archive, publish, transfer, change **Run as**, and add collaborators.
- Collaborators can edit, run, enable or disable, add collaborators, and view run details and state.
- People with the **Admin** or **Manage all content** role can edit, run, archive, publish, or transfer anyone's automation.
- Anyone in the organization can see and run public automations, see their run history without inputs or sessions, and fork them.
New automations are **Private**: only the owner and collaborators can see them. Set one to **Public** to list it in the organization's library so others can run or fork it. See [Automation templates](/automations/templates).
### Transfer ownership [#transfer-ownership]
Select **Transfer ownership** and choose a **New owner** to hand an automation to another active member. The new owner takes over immediately, the previous owner becomes a collaborator, and future runs act as the new owner. You can also share a transfer link that the recipient accepts.
Transfers fail with these messages:
- `Archived automations cannot be transferred`. Restore it first.
- `Remove the Datadog trigger before transferring this automation.` Datadog triggers are tied to the owner's Datadog connection.
- `That person already owns this automation`.
### Archive and restore [#archive-and-restore]
Deleting an automation archives it: it stops running, its triggers stop firing, and pending transfer links are removed. Archived automations keep their triggers and can be restored.
## Troubleshooting [#troubleshooting]
A run hit `Missing prompt template values`. Add defaults for the listed variables, then enable it.
The owner hasn't linked Slack, or the bot isn't in the channel. The form warns `Bot is not in Slack
channel` with the `/invite` command to run.
Turn off **Post to channel on automation start**.
You aren't the owner or a collaborator. Ask the owner to add you, or fork it.
The trigger or automation is disabled, a condition didn't match, or the event happened before the
trigger was saved. See the trigger's page.
# Inspect events (/automations/inspect-events)
An Inspect event trigger starts a run when an administrative change happens in your organization, such as a repository being added, a role being granted, or an API key being created. Use it to notify a team, review a change against policy, or set up something new automatically, like onboarding a repository the moment it's added.
## Requirements [#requirements]
- Saving the trigger requires the **View audit logs and usage** role (or **Admin**), for both the person saving and the automation's owner. Runs see event details from the audit log.
- If the owner later loses that permission, matching events stop starting runs.
- If **Inspect event** isn't listed under **Add trigger**, it isn't enabled for your organization.
## Add the trigger [#add-the-trigger]
Select **Inspect event** under **Add trigger** and choose one **Event**. To react to several events, add one trigger per event.
- Automations and skills: `automation.created`, `automation.updated`, `automation.archived`, `automation.unarchived`, `skill.created`, `skill.updated`, `skill.archived`
- Repositories: `repository.added`, `repository.updated`, `repository.removed`
- Connectors: `connector.created`, `connector.updated`, `connector.deleted`
- Environment: `environment_variable.created`, `environment_variable.updated`, `environment_variable.deleted`, `egress_secret.created`, `egress_secret.updated`, `egress_secret.deleted`, `shared_build_script.created`, `shared_build_script.updated`, `shared_build_script.deleted`
- People: `user_invitation.created`, `user_invitation.revoked`, `user_invitation.accepted`, `user.provisioned`, `user_role.granted`, `user_role.revoked`, `user.deactivated`, `user.reactivated`
- API keys: `api_key.created`, `api_key.updated`, `api_key.rotated`, `api_key.revoked`
- Organization: `organization_review_agent_settings.updated`, `organization_model_defaults.updated`
## Filter events [#filter-events]
Under **Run only when**, add up to 20 conditions on the event's details. Each condition has:
- **Field path**: a dot path into the event details, such as `name` or `repository`. Use numbers for list positions, such as `items.0`.
- **Operator**: contains, does not contain, starts with, ends with, is exactly, is not exactly, **matches regex**, **exists**, or **does not exist**.
- **Value**, for operators that compare one.
Text comparisons and regexes ignore case. A list field matches when any item matches. A run starts only when every condition matches; with none, every occurrence of the event starts a run.
## Payload [#payload]
| Field | Type | Description |
| ------------ | -------- | ---------------------------------------------------------------------------- |
| `event` | `string` | The event name. |
| `actor_id` | `string` | The user who caused it. |
| `session_id` | `string` | The session that caused it, when one did. |
| `payload` | `object` | The event's details, such as the repository added or the automation changed. |
Each event starts at most one run per automation.
## Loop protection [#loop-protection]
An automation that reacts to Inspect events can cause new ones, for example by editing an automation. To keep runs from triggering each other:
- Events caused by an automation run's sessions, or by their child sessions, never start Inspect event runs.
- Each automation starts at most 20 Inspect event runs per hour. Matching events beyond that are skipped.
# LaunchDarkly (/automations/launchdarkly)
A LaunchDarkly trigger starts a run when a flag changes in a project you choose. Use it to review risky targeting changes in production, or to check error rates after a flag turns on.
## Requirements [#requirements]
- LaunchDarkly must be connected as an organization connector in [Customize → Connectors](https://app.inspect.com/customize/connectors). See [Connectors](/connectors). Until it is, the automation form shows **Connect LaunchDarkly**.
- The connection's LaunchDarkly account must be allowed to manage webhooks, because Inspect registers one for the trigger.
## Add the trigger [#add-the-trigger]
1. Select **LaunchDarkly** under **Add trigger**.
2. Choose a project under **Project key**.
3. Optionally choose an environment under **Environment key**. Leave it blank for every environment.
4. Add conditions. All must match:
- **Flag key** is, is not, contains, or starts with a value. With **is** or **is not**, pick a flag from the project; use **contains** or **starts with** to match several.
- **Action** matches a LaunchDarkly audit action such as `updateOn`.
- **Member email** matches the person who made the change.
- **Comment** matches the comment saved with the change.
5. Save the automation.
With no conditions, every flag change in the project and environment starts a run. A change with no member email or no comment never matches a condition on that field, including **is not**.
## How it behaves [#how-it-behaves]
When you save, Inspect creates a signed webhook named `Inspect …` in LaunchDarkly that covers the projects of all enabled LaunchDarkly triggers, and removes it when no enabled trigger uses it. If setup fails, the trigger shows the error. Fix the connection, then save the automation again to retry.
Inspect rejects deliveries whose signature doesn't match the webhook's secret.
Each matching audit log entry starts one run per automation, even when several of its triggers match. A redelivered entry doesn't start another run.
## Payload [#payload]
| Field | Type | Description |
| ----------------------------------- | -------- | -------------------------------------------- |
| `title`, `description` | `string` | LaunchDarkly's summary of the change. |
| `kind`, `accesses` | `text` | The resource kind and the actions taken. |
| `member.email`, `comment` | `string` | Who made the change and their comment. |
| `previousVersion`, `currentVersion` | `object` | The flag before and after. |
| `delta` | `object` | What changed, when LaunchDarkly includes it. |
| `date`, `_id` | `text` | When it happened and the audit entry ID. |
## Example [#example]
To review risky releases, add a trigger for the `production` environment with **Action** is `updateOn`. Prompt the automation to compare the flag's previous and current targeting, check recent errors for the affected service, and post a summary to the owning team's channel.
# Linear (/automations/linear)
Linear triggers start a run when something changes in a Linear workspace connected to Inspect. Four trigger types are available under **Add trigger** > **Linear**:
- **Issue**: an issue is created or updated.
- **Comment**: someone comments on an issue.
- **Release**: a release is created or moves to a new stage.
- **Project**: a project is created, or its status or health changes.
## Requirements [#requirements]
- The Inspect Linear app must be installed in the workspace. Someone with the **Admin** or **Manage integrations** role sets it up; see [Linear](/integrations/linear). Until then, saving fails with `Set up the Linear integration in Settings > Integrations before creating Linear automations.`
- With more than one Linear workspace connected, each trigger has a **Linear workspace** setting. Keep **Any workspace** to accept events from all of them.
## Issue [#issue]
Under **Events**, choose **Issue created**, **Issue updated**, or both. New triggers start with **Issue created** and a **Changed by** is **Person** condition.
Conditions (up to 20, all must match):
- **Title** contains, does not contain, starts with, ends with, is exactly, or is not exactly a value, matched against the issue title.
- **Description** takes the same operators as **Title**, matched against the issue description.
- **Team** is any of, or none of, team keys or names.
- **Project** is any of, or none of, project names.
- **Status** is any of, or none of, current status names.
- **Label** is any of, or none of, labels. It matches any of the issue's current labels.
- **Assignee email** is any of, or none of, the assignee's email.
- **Priority** is any of, or none of, **Urgent**, **High**, **Medium**, **Low**, or **No priority**.
- **Status changed to** is any of the new statuses, only when this update changed the status.
- **Label added** is any of the labels this update added.
- **Changed by** is, or is not, **Person** or **App or integration**.
All text and name matching ignores case. **Status changed to** and **Label added** only match updates, so they require **Issue updated** (`Select "Issue updated" to use "Status changed to" or "Label added" conditions`).
Updates that change only ordering fields, such as sort order, never fire. Archived and trashed issues never fire.
| Field | Type | Description |
| ------------------------------------------------------------------------------- | ---------------------- | --------------------------------------------------------- |
| `action` | `'create' \| 'update'` | create or update. |
| `issue_id`, `issue_identifier`, `issue_title`, `issue_description`, `issue_url` | `string` | The issue. |
| `team`, `project`, `state`, `priority`, `labels`, `assignee` | `text` | Current values. team is the team key, assignee the email. |
| `changed_fields` | `string[]` | Fields this update changed. |
| `added_labels` | `string[]` | Labels this update added. |
| `actor`, `updated_at` | `string` | Who made the change and when. |
Edits to one issue within the same minute collapse into one run per automation, so a burst of quick edits starts a single run.
## Comment [#comment]
Fires on new comments on Linear issues. Edits, deletions, and comments on project updates, documents, or initiatives never fire.
Conditions (up to 20, all must match):
- **Comment** contains, does not contain, starts with, ends with, is exactly, or is not exactly a value, matched against the comment text, ignoring case.
- **Team** is any of, or none of, the issue's team keys or names.
- **Written by** is, or is not, **Person** or **App or integration**.
New triggers start with **Written by** is **Person**. Removing every condition also matches comments from apps and integrations.
| Field | Type | Description |
| ------------------------------------------------------------------ | -------- | --------------------------------------- |
| `comment_id`, `comment_body`, `comment_url`, `author` | `string` | The comment. |
| `parent_comment_body` | `string` | The comment it replies to, for replies. |
| `issue_id`, `issue_identifier`, `issue_title`, `issue_url`, `team` | `string` | The issue. |
The payload doesn't include the rest of the issue or its other comments. Tell the prompt to look them up in Linear when it needs them.
Each comment starts at most one run per automation. Mentioning Inspect in a comment also starts a Linear agent session (see [Linear](/integrations/linear)), so a comment trigger without a **Comment** condition can run alongside it.
For example, **Comment** starts with `/triage` and **Written by** is **Person** lets people ask the automation to triage an issue from Linear.
## Release [#release]
Fires when a release is created or moves to a new stage. Other release edits, such as name, description, or dates, never fire. Archived and trashed releases never fire.
Conditions (up to 20, all must match; none matches every creation and stage change):
- **Pipeline** is any of, or none of, pipeline names, ignoring case.
- **Stage** is any of, or none of, stage names, ignoring case.
- **Stage type** is any of, or none of, **Planned**, **Started**, **Completed**, or **Canceled**.
| Field | Type | Description |
| --------------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------- |
| `action` | `'create' \| 'update'` | create or update. |
| `release_id`, `release_name`, `version`, `release_url`, `description` | `string` | The release. |
| `pipeline`, `stage`, `stage_type` | `string` | Where it is now. |
| `commit_sha` | `string` | The release's commit. |
| `issues`, `issue_count` | `text` | Identifier, title, and URL of up to 50 linked issues, and the full count. |
Each creation or stage change starts one run. A release that returns to an earlier stage fires again.
## Project [#project]
Under **Events**, choose any of **Project created**, **Status changed**, and **Health changed**. New triggers select all three. Other project edits, such as description, dates, or members, never fire. Archived and trashed projects never fire.
Conditions (up to 20, all must match):
- **Status** is any of, or none of, status names, ignoring case.
- **Status type** is any of, or none of, **Backlog**, **Planned**, **Started**, **Paused**, **Completed**, or **Canceled**.
- **Health** is any of, or none of, **On track**, **At risk**, or **Off track**.
- **Lead email** is any of, or none of, the project lead's email, ignoring case.
Conditions check the project's state at the time of the event, so pick the event you mean. For "a project went off track", choose only **Health changed** with **Health** is any of **At risk**, **Off track**. With **Status changed** also selected, an already at-risk project would fire again on every status change.
| Field | Type | Description |
| ---------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------- |
| `action`, `events` | `text` | create or update, and which events happened (one update can change both status and health). |
| `project_id`, `project_name`, `project_url`, `description` | `string` | The project. |
| `status`, `status_type`, `health` | `string` | Current state. |
| `lead`, `lead_email` | `string` | The project lead. |
| `start_date`, `target_date` | `string` | Planned dates. |
Each change starts one run.
## Duplicates and loops [#duplicates-and-loops]
- Changes Inspect itself makes in Linear never fire any Linear trigger, so an automation that comments on or updates issues doesn't trigger itself.
- Redeliveries of the same change collapse into one run.
- When several Linear triggers on one automation match the same event, the automation runs once.
## Troubleshooting [#troubleshooting]
Install the Linear app. See [Linear](/integrations/linear).
The selected workspace was disconnected. Choose a connected one under **Linear workspace**.
The trigger only has **Issue created**, the update changed only ordering, or **Changed by** is
**Person** and an integration made the change.
Remove events you don't mean. Conditions describe the project's current state, not what changed.
# Scheduled (/automations/scheduled)
A schedule trigger starts a run each time its cron expression comes due. Use it for recurring work that doesn't depend on an external event: daily dependency checks, weekly status reports, or periodic cleanups.
Schedules need no connected service. Anyone who can edit the automation can add one.
## Add a schedule [#add-a-schedule]
1. Under **Add trigger**, select **Schedule**.
2. Under **Run schedule**, describe the schedule in plain language, such as `weekdays at 9 AM` or `every Monday at 8:30`, or enter a cron expression such as `0 9 * * 1-5`. Inspect converts plain language to cron and shows the result; select **Use cron syntax** to replace your text with the expression.
3. Choose a **Timezone**. New schedules default to your browser's timezone. Runs follow daylight saving changes in that timezone.
Inspect rejects expressions it can't parse with `Invalid cron expression`.
## Cron syntax [#cron-syntax]
Cron expressions use five fields: minute, hour, day of month, month, and day of week.
| Expression | Runs |
| ------------- | -------------------------------- |
| `0 9 * * 1-5` | Weekdays at 9:00 |
| `30 8 * * 1` | Mondays at 8:30 |
| `0 */4 * * *` | Every four hours, on the hour |
| `0 17 1 * *` | The first of each month at 17:00 |
For times one expression can't describe, such as weekdays at 9:00 and Saturdays at 12:00, add a second schedule to the same automation.
## How it behaves [#how-it-behaves]
- A run starts up to 60 seconds after its scheduled time. The offset is fixed per automation, so automations that share a time don't all start at once.
- The run's context includes the cron expression, the current time, the time of the previous run, and the schedule's timezone. Use the previous run time to look only at what changed since then.
- Pausing a schedule stops only that trigger. Disabling the automation stops all of its triggers.
- If a scheduled run finds a `{{variable}}` with no value, the run fails and Inspect disables the automation. Give every variable a default, then enable the automation again.
To run outside the schedule, select **Run**. Inspect asks for template variable values first when the prompt has any.
## Example [#example]
A weekday schedule at 5:00 scans a repository for stale feature flags and uses [`automation_state`](/automations#state-across-runs) to record which flags it already proposed, so later runs report only new ones.
# Sentry (/automations/sentry)
A Sentry trigger lets a Sentry alert start an automation. Sentry decides when the alert fires; the alert's **Inspect** action chooses which automation runs. Use it to investigate new production errors, or to react when a metric alert crosses its critical or warning threshold.
## Requirements [#requirements]
- Someone with the **Admin** or **Manage integrations** role connects Sentry in [Settings → Integrations](https://app.inspect.com/settings/integrations) by installing the Inspect integration in a Sentry organization. Select **Connect another organization** to add more. Each Sentry organization can connect to only one Inspect organization.
## Set it up [#set-it-up]
1. In Inspect, select **Sentry** under **Add trigger**. With more than one Sentry organization connected, choose one under **Sentry organization**, or keep **Any organization**.
2. Save and enable the automation. Sentry lists only enabled, unarchived automations with an enabled Sentry trigger for that organization.
3. In Sentry, open **Monitors → Alerts** and select **Create Alert**, or edit an existing issue or metric alert.

4. Under **THEN perform these actions**, open **Select an action** and choose **Inspect**.

5. Select **Action Settings**, choose the automation under **Automation**, and select **Save Changes**. Then save the alert.

The trigger has no filters of its own. Only alerts whose Inspect action selects this automation start it. To start several automations from one alert, add the Inspect action once per automation.
## What starts a run [#what-starts-a-run]
- **Issue alert**: starts a run for each triggering event, deduplicated by event ID.
- **Metric alert**: starts a run when the alert reaches critical or warning, deduplicated by the alert plus the status it reached.
Metric alert resolutions never start runs. A redelivered event, or a metric alert reaching the same status again, doesn't start another run.
## Payload [#payload]
Issue alerts (`event` is `issue_alert`):
| Field | Type | Description |
| ---------------------------------- | ---------- | ------------------------------------ |
| `alert_name` | `string` | The rule that fired. |
| `issue_id`, `issue_title` | `string` | The Sentry issue. |
| `event_id`, `level`, `environment` | `string` | The event. |
| `tags` | `string[]` | Event tags as key:value strings. |
| `project_id`, `link` | `string` | The project and a link to the event. |
| `organization` | `string` | The Sentry organization. |
Metric alerts (`event` is `metric_alert_critical` or `metric_alert_warning`):
| Field | Type | Description |
| ----------------------------- | -------- | ------------------------------------- |
| `alert_rule_id`, `alert_name` | `string` | The alert rule. |
| `title`, `description` | `string` | Sentry's description of the incident. |
| `project_slug`, `environment` | `string` | Where it fired. |
| `alert_url`, `link` | `string` | Links to the alert. |
| `organization` | `string` | The Sentry organization. |
## Disconnect Sentry [#disconnect-sentry]
Disconnecting an organization in Inspect stops Inspect from accepting its alerts. Uninstall Inspect in Sentry to remove it there.
## Troubleshooting [#troubleshooting]
Save the automation with an enabled Sentry trigger for that organization, and make sure the
automation is enabled.
The alert's Inspect action selects a different automation, or the trigger limits it to another
**Sentry organization**.
Resolutions never fire.
# Slack (/automations/slack)
A Slack trigger starts a run when someone posts a message or adds a reaction in the channels you choose. Use it to triage requests in a help channel, act on an emoji such as `:eyes:`, or follow up on bot alerts.
## Requirements [#requirements]
- Inspect must be installed in your Slack workspace. See [Slack](/integrations/slack).
- Inspect must be a member of each watched channel. Inspect tries to join every watched channel when you save the automation. Slack doesn't let apps join some channels, such as private ones; invite Inspect to those yourself.
- Events reach automations only through the Inspect Slack app. Events delivered to a custom agent's own Slack app don't start automations.
## Add the trigger [#add-the-trigger]
Select **Slack** under **Add trigger**, then set:
- **When**: **Message posted** or **Reaction added**.
- **In channels**: one or more channels. People with the **Admin** or **Manage integrations** role can create a public channel here by entering a new name and selecting **Create**.
## Conditions [#conditions]
A run starts only when every condition matches. With no conditions, every event of the chosen type in the chosen channels starts a run.
For either event, **Channel type** is, or is not, **Code Channel**: the per-session channels Inspect creates and belongs to. **Channel type** is **Code Channel** can replace the channel list, so the trigger watches every Code Channel, including ones created later.
For **Message posted**:
- **Message text** contains, does not contain, starts with, ends with, is exactly, or is not exactly a value. Case-insensitive, up to 500 characters.
- **Message author** is any of, or none of, Slack user, bot, or app IDs, up to 100.
- **Author type** is, or is not, **Person** or **App or bot**.
- **Mentioned users** includes any of, includes all of, or includes none of the listed Slack user IDs.
- **Message location** is, or is not, **Thread reply** or **Top-level message**.
- **Thread** is any of, or none of, the listed threads. Paste a Slack link to the thread's first message or to any reply. With **is any of**, the first message and every reply in the listed threads match; with **is none of**, those messages are excluded.
For **Reaction added**:
- **Reaction emoji** is any of, or none of, emoji names such as `eyes` or `white_check_mark`.
- **Reacting user** is any of, or none of, Slack user IDs.
- **Message author** is any of, or none of, the authors of the message that got the reaction. It never matches when Slack doesn't report the author.
Use Slack IDs (`U012AB3CD` for members, `A012AB3CD` or `B012AB3CD` for apps and bots), not display names.
## What starts a run [#what-starts-a-run]
- New messages start runs, including file shares and bot messages. Edits, deletions, and other message subtypes don't.
- Messages and reactions from Inspect itself never start runs, so an automation that posts in a channel it watches doesn't trigger itself.
- When several Slack triggers on one automation match the same event, the automation runs once.
- The same message or reaction delivered again doesn't start another run.
## Payload [#payload]
| Field | Type | Description |
| --------------------------------------------- | ---------------- | ------------------------------------------------------------- |
| `workspace_id`, `channel_id`, `message_ts` | `string` | Message and reaction events. Where the event happened. |
| `thread_ts` | `string \| null` | Message events. Parent thread, or null for top-level posts. |
| `sender_id`, `sender_bot_id`, `sender_app_id` | `string` | Message events. Who posted. |
| `text` | `string` | Message events. Message text. |
| `reaction`, `user_id` | `string` | Reaction events. Emoji name and who reacted. |
| `item_user_id` | `string` | Reaction events. Author of the message that got the reaction. |
The payload carries the message text but not the rest of the thread. Tell the prompt to read the thread with Slack tools when it needs more context.
## Example [#example]
To triage requests in `#help-payments`, add a **Message posted** trigger for that channel with **Message location** is **Top-level message** and **Author type** is **Person**. The prompt tells Inspect how to investigate each request and to reply in the request's thread.
## Listen from a session [#listen-from-a-session]
A running session can subscribe to Slack messages or reactions in one or more channels, with the same conditions, without creating an automation. Ask it to watch a channel or a thread, for example "reply in this thread when someone asks you something". Matching events arrive in the session as messages, with the payload above. Each subscription takes at most 25 events and expires after 7 days by default.
- Inspect joins a public channel when you subscribe. For a private or externally shared channel, invite Inspect first; subscribing fails until it's a member.
- Private channels need you to be a member too. Inspect checks again before each event.
- Messages that mention Inspect also reach the session it was mentioned in. To avoid handling those twice, add **Mentioned users** includes none of Inspect.
## Troubleshooting [#troubleshooting]
Invite Inspect to the channel. Slack only sends events for channels the app belongs to.
The bot posts under a different ID. Add its user, bot, and app IDs.
Edits never fire. Only new messages do.
# Automation templates (/automations/templates)
Any user-owned automation can serve as a template. When its owner makes it **Public**, everyone in the organization can find it, run it, and fork it. A fork is a separate automation with its own triggers, repositories, Slack channel, and variable values that keeps using the original's prompt. When the original's owner improves the prompt, every fork picks up the change on its next run.
Use this when several teams need the same job with different inputs: one owner maintains a "triage failing CI" prompt, and each team forks it with its own repository, branch, and channel.
## Publish an automation [#publish-an-automation]
Set the automation's visibility to **Public** ("Anyone can see it"). Only the owner, or someone with the **Admin** or **Manage all content** role, can change visibility. Collaborators can't.
You can't publish:
- A fork (`Forks can't be made public`). Disconnect it first to make it an independent automation.
- An automation with a Datadog trigger (`Datadog triggers cannot be published in this version.`).
A public automation shows its author, fork count, run count, and last run. Others see its run history (timing, trigger, session count, and status) but not run inputs or sessions.
Setting a public automation back to **Private** disconnects every fork. Each fork keeps the prompt it had at that moment and stops receiving updates. This can't be undone.
## Fork an automation [#fork-an-automation]
1. Select **Fork** on a public automation.
2. Enter an **Automation name**.
3. Fill in the template's **Custom inputs**. These become this fork's values for the prompt's `{{variables}}`.
4. Review the triggers. Inspect copies the source's schedule, GitHub, Slack, Sentry, and Linear triggers into the form; change or remove them as needed.
5. Choose **Repositories**, a **Slack channel**, and whether to **Post to channel on automation start**.
6. Select **Create fork**.
### What a fork shares with its source [#what-a-fork-shares-with-its-source]
- **Prompt**: always the source's current prompt. The fork can't edit it.
- **Custom agent**: the source's agent when it has one, otherwise the fork's own.
- **Template variable defaults**: the source's defaults apply first, then the fork's values override them.
- **Triggers, repositories, Slack, model**: the fork's own.
- **Owner, collaborators, run identity**: the fork's own. Runs act as the fork's owner.
A fork can't be the source of another fork, and it can't be made public. The source automation's **Forks** page lists its forks.
Automations with a Datadog trigger can't be forked.
### Disconnect a fork [#disconnect-a-fork]
Select **Disconnect** on a fork to turn it into an independent automation. Inspect copies the source's current prompt, custom agent, and template variables into the fork, and the fork stops receiving updates. This can't be undone. Only someone who can edit the fork can disconnect it.
## Inspect-owned automations [#inspect-owned-automations]
Automations marked **System automation** are owned by Inspect. They never run on their own. Selecting **Fork** on one opens a new automation pre-filled from it, which you then own and edit freely.
## Troubleshooting [#troubleshooting]
Ask the owner to make it **Public**.
Fork the original instead, or disconnect the fork you want to copy and ask its owner to publish it.
Remove the Datadog trigger, or create a separate automation for it.
The source's owner edited the source prompt. Disconnect the fork to freeze its prompt.
# Webhooks (/automations/webhooks)
A webhook gives any service that can send HTTP webhooks a URL that starts Inspect automations: a support tool, a bug bounty platform, Stripe, GitLab, or your own scripts. You create the webhook once in [Customize → Webhooks](https://app.inspect.com/customize/webhooks), give its URL and secret to the sender, then attach it to as many automations as you like with a **Webhook** trigger. Inspect verifies every delivery before anything runs.
If **Webhook** isn't listed under **Add trigger** and **Webhooks** isn't in **Customize**, webhooks aren't enabled for your organization.
## Requirements [#requirements]
- Any member can create a webhook. Only its creator, or someone with the **Admin** or **Manage integrations** role, can change or delete it.
- Any member can attach a webhook to an automation and see its delivery log.
- The sender must sign or authenticate each request in one of the supported ways below.
## Create a webhook [#create-a-webhook]
1. In [Customize → Webhooks](https://app.inspect.com/customize/webhooks), select **New webhook** and enter a **Name**. Names are unique in your organization, ignoring case.
2. Under **Uses**, choose **Allow for automations**, **Allow sessions to listen**, or both.
3. Under **Verification**, choose how the sender proves a request is genuine. Then paste the sender's secret, or let Inspect generate one to give the sender.
4. Under **Duplicate deliveries**, choose when Inspect should **Treat as a repeat**.
5. Select **Create webhook**, then copy the **Webhook URL** into the sender.
The URL has the form `https://app.inspect.com/api/hooks//`. Copy a generated secret when it's shown; you can replace it later but never view it again. If the sender creates its secret only after you give it the URL, leave the secret blank, then paste it in. Deliveries are rejected until you save it.
### Verification methods [#verification-methods]
- **Signature**: for an HMAC of the body in a header, like GitHub's `X-Hub-Signature-256`. Settings: header, **Algorithm** (SHA-256, SHA-1, SHA-512), **Encoding** (hex, base64), **Prefix**, **Signed content**.
- **Timestamped signature**: for an HMAC that includes a timestamp, like Stripe or Slack. Settings: header, **Separator**, **Timestamp key**, **Signature key**, **Timestamp header (optional)**, **Signed content**, **Tolerance (seconds)**.
- **Standard Webhooks**: for Svix, Clerk, Resend, and other senders that follow the spec. Settings: signature header (default `webhook-signature`), tolerance. The secret is the `whsec_` value.
- **Public key signature**: for Ed25519 or ECDSA P-256, like Discord or SendGrid. Settings: header, **Key type**, encoding, prefix, optional timestamp header, signed content. The secret is the sender's public key (PEM, hex, or base64).
- **Token in a header**: for the secret sent as-is, like `Authorization: Bearer …` or `X-Gitlab-Token`. Settings: header, prefix.
- **Token in the URL**: for senders that can only be given a URL. The secret goes in the URL's `token` query parameter.
- Secrets must be 8 to 512 characters with no leading or trailing whitespace.
- **Signed content** is a template built from `{body}` (required, exactly once), `{timestamp}`, and `{url}`. Defaults are `{body}` for signatures and `{timestamp}.{body}` for timestamped signatures.
- **Tolerance (seconds)** defaults to 300 and accepts 30 to 3600. Deliveries with an older timestamp are rejected.
### Handshakes [#handshakes]
Inspect answers Slack's Events API `url_verification` challenge and, for public key webhooks, Discord's interactions PING. These never start runs.
## Add a webhook trigger [#add-a-webhook-trigger]
1. Under **Add trigger**, select **Webhook** and choose the **Webhook**. Select **New webhook** to create one without leaving the form.
2. Optionally add conditions. Each reads a field from the **Body** or a **Header** and compares it. Body paths are dot paths with numbers for list positions, such as `data.object.status` or `items.0.id`. Operators match the [Inspect event filters](/automations/inspect-events#filter-events), and text matching ignores case. You can add up to 20, and all must match.
3. Optionally fill in **Describe which deliveries should start a run (optional)**. Inspect writes a filter rule from your description and the webhook's recent deliveries, and you can test it against a **Recent delivery** or a pasted **Body (JSON)** and **Headers (optional JSON)**.
With no conditions and no rule, every verified delivery starts a run.
The filter rule is a small JavaScript function that receives the delivery's body and headers and returns whether to start a run. It runs after the conditions, in an isolated sandbox with a 200 ms CPU limit and a 5 second timeout. A rule that throws, times out, or returns something other than a decision never starts a run.
## How deliveries are handled [#how-deliveries-are-handled]
1. Inspect looks up the webhook. An unknown URL gets `404`.
2. Inspect verifies the signature or token. A failure gets `401 Invalid signature`.
3. Inspect parses the body. Bodies must be JSON or form-encoded and at most 1 MiB; anything else gets `415`.
4. Inspect removes the verification header, any header whose name looks like a credential (containing `auth`, `token`, `secret`, `signature`, `password`, `api-key`, `session`, or `cookie`), and proxy headers. Conditions, rules, runs, and the delivery log see only what's left.
5. Each enabled automation with an enabled trigger on this webhook evaluates its conditions and rule. Matching automations start one run each, even when several of their triggers match.
6. Inspect responds with the number of runs it started.
Turning off **Allow for automations** pauses every trigger on the webhook without removing them.
### Duplicate deliveries [#duplicate-deliveries]
Senders retry. **Treat as a repeat when** controls how Inspect recognizes a retry:
- **The body is identical**: its raw body is byte-for-byte the same as an earlier one.
- **A body field matches**: a field you name, such as the provider's event ID, matches.
- **A header matches**: a header you name, such as a delivery ID header, matches.
A repeat doesn't start another run of an automation that already ran for it. When the named field is missing, Inspect falls back to comparing the body.
## Payload [#payload]
| Field | Type | Description |
| ---------------------------- | -------- | ------------------------------------------ |
| `webhook_id`, `webhook_name` | `string` | Which webhook received it. |
| `received_at` | `string` | When Inspect received it. |
| `headers` | `object` | The headers left after step 4, lowercased. |
| `body` | `object` | The parsed body. |
The run's context includes up to 60,000 characters each of the headers and the body. Inspect marks the delivery as untrusted data from an external sender: the agent may act on values in it, such as a linked pull request, but nothing in it can change the automation's instructions.
## Delivery log [#delivery-log]
Each webhook's **Deliveries** tab, and each webhook automation's deliveries view, shows recent deliveries with their event, outcome, headers, and body. Inspect keeps deliveries for 7 days, up to the latest 100 verified and 20 rejected per webhook. Bodies over 256 KB aren't stored in the log.
- **Started a run**: the automation's conditions and rule matched.
- **Skipped by a condition**: a condition didn't match. The log names it.
- **Skipped by the rule**: the rule returned no match, with its reason if it gave one.
- **Skipped: the rule failed**: the rule threw, timed out, or returned an invalid value.
- **Skipped as a duplicate**: an earlier delivery with the same key already started a run.
- **Rejected: no signature / no token**: the verification header or query parameter was missing. The delivery row names which field was missing.
- **Rejected: signature didn’t match / token didn’t match**: wrong secret, or the verification settings don't match the sender. The delivery row explains the mismatch (such as a raw token sent to an HMAC webhook, a prefix or trailing-space mismatch, or an unexpected encoding or digest length).
- **Rejected: signature timestamp too old**: the timestamp was outside the tolerance.
- **Rejected: body isn’t JSON or form data**: the body couldn’t be parsed as JSON and wasn’t sent as `application/x-www-form-urlencoded`.
## Sessions that listen [#sessions-that-listen]
With **Allow sessions to listen** on, a running session can subscribe to a webhook and receive matching deliveries as messages instead of starting automation runs, for example to wait for a deploy hook while it works. Each subscription takes at most 25 deliveries and expires after 7 days by default (30 at most), and a session can hold 10 subscriptions. The webhook's **Sessions** tab lists active subscriptions and lets you end them. Deliveries come from other services and may contain malicious content, so allow this only for webhooks you trust.
## Delete a webhook [#delete-a-webhook]
You can't delete a webhook while any automation uses it, including archived ones: `Remove this webhook from N automations before deleting it`. Remove its triggers first.
## Troubleshooting [#troubleshooting]
Check the secret, then the header, algorithm, encoding, prefix, and signed content against the
sender's docs.
Inspect removed the header before filtering because it can carry a secret. Filter on another header
or a body field.
Set **Treat as a repeat when** to the sender's event or delivery ID.
Standard Webhooks secrets must be the sender's `whsec_` value.
Choose another name.
# Data sources (/canvas/data-sources)
A data source is a set of typed SQLite tables that the agent creates and canvas apps query. Use one when an app should show real records instead of data pasted into its code: a triage board over tickets, a dashboard fed by a connector, or a small internal tool that saves notes. One data source can serve several apps and canvases.
`https://app.inspect.com/canvas/data-sources` lists the data sources you can see, filterable by **Type**, **Available to**, and **Owner**, with the canvases each one is attached to. Open one to browse its tables and rows. The page is read-only; you create and change data sources by asking the agent.
## Requirements [#requirements]
- Canvas enabled for your organization.
- A writable session and a user account that isn't read-only, to create or change data sources.
- For syncs and connector actions, the [connector](/connectors) connected. Syncs use the creator's connection; actions in apps use each viewer's own.
## Kinds of data [#kinds-of-data]
- A snapshot holds records the agent writes from an upload, a tool result, or an existing app. It never refreshes on its own.
- A connector sync calls one connector tool on a schedule and maps the result into one table. It refreshes every 5 to 1,440 minutes.
- App state is rows that apps write through a read-write attachment (decisions, notes, assignments). It changes when someone writes.
- Tool actions are buttons in an app that run a declared connector or Inspect tool and can store the result. They run when someone clicks.
A source can combine these, for example a synced `issues` table plus a separate `triage_notes` table that apps write. Keep app-written fields out of a table that a `replace` sync rewrites.
## Ask for one [#ask-for-one]
Describe the records, where they come from, and how fresh they need to be:
```text
Build a canvas triage board over open Linear bugs for the Payments team.
Sync them every 30 minutes, and let me save an owner and a note per bug.
```
The agent creates the source, runs the first sync, checks sample rows, attaches the source to the canvas under an alias, and points the app at it.
## Visibility and access [#visibility-and-access]
A private source, the default, is visible only to its creator. A public source is visible to everyone in your organization.
Only the creator can update, write to, refresh, or delete a source. Anyone who can see it can query it.
Attaching a data source to a canvas lets everyone who can view that canvas read its rows through the canvas, even if the source itself is private. Check who the canvas is shared with before you attach sensitive data.
A canvas attaches a source under an alias with `read` or `read_write` access. Only the source's creator can attach it with `read_write`. Apps write through a `read_write` attachment only for viewers who can edit the canvas. Detaching keeps the source and its rows.
## Syncs [#syncs]
A sync stores one connector tool call: the connector, the tool, fixed arguments, the destination table, a dot path to the array of records, and a column-to-path mapping.
- `replace` swaps the table's rows for each result. `upsert` merges by primary key and never removes rows missing from a later result.
- A sync returns at most 10,000 rows and must finish within 60 seconds.
- It doesn't follow pagination or run code. Fixed timestamps in the arguments keep fetching the same window.
- Inspect runs the first sync when the sync is created or changed. Ask the agent to refresh a source to sync it immediately.
- A sync runs as its creator, with the connector settings of the session that set it up.
Some failures pause a sync until someone fixes them: the connector was removed, the creator disconnected it or left the organization, or the original session is gone. A refresh that succeeds resumes a paused sync.
Private connectors and private connector tools can't be synced into a data source. Slack companion tools can't run in syncs or app actions; they only run inside sessions.
## Apps and viewers [#apps-and-viewers]
Apps query attached sources by alias with read-only SQL. A query returns 100 rows by default and up to 1,000. Queries re-run for every viewer when the data changes.
For sources with a sync or actions, each signed-in viewer gets their own copy of the results, per app. Opening the app syncs with the viewer's own connector account, and action results stay private to that viewer. A viewer who hasn't connected the connector sees `Connect your account in Settings → Connectors, then retry`. There's no option to run as the source's creator. Rows the agent or apps wrote directly stay shared across viewers.
Two app settings control freshness:
- **Refresh now** in the canvas top bar re-fetches data for the open app.
- **Data refresh while open** sets an interval, at least 60 seconds, that refreshes while the frame is visible. Inspect doesn't refresh data for viewers who aren't looking.
A manual sync from inside an app runs at most once a minute per viewer.
### Buttons that call tools [#buttons-that-call-tools]
An action declares a tool, fixed arguments, and named parameters the app can fill in. An app runs it only on a click, and only through a `read_write` attachment. Actions can call connector tools or built-in Inspect tools, for example starting a research session with a fixed prompt. Each action can run at most once every two seconds.
Actions always run as the signed-in viewer, with their own connections and permissions. A built-in Inspect action also requires the viewer to own the session that defined it, except `list_inspect_sessions`, `search_inspect_documentation`, and `read_inspect_documentation`, which any viewer can run.
## Schema rules [#schema-rules]
- Up to 32 tables per source.
- Up to 64 columns per table.
- 1 to 8 primary key columns, not nullable.
- Up to 500 rows per write.
- SQL statements up to 20,000 characters.
- Names up to 100 characters.
- Descriptions up to 1,000 characters.
Column types are `text`, `integer`, `real`, `boolean` (stored as 0 or 1), `timestamp` (ISO 8601 text), and `json` (serialized text). Table and column names use lowercase letters, digits, and underscores and start with a letter.
Schema changes are additive. You can add tables and nullable columns, but you can't remove, retype, or re-key anything. For an incompatible change, ask the agent to create a new source, fill it, and repoint the apps that should use it.
## Deleting [#deleting]
Deleting a source removes its rows and detaches it from every canvas; apps using it stop loading data. A source created for a specific app is deleted automatically when the last app using it is deleted. Standalone sources stay until their creator deletes them.
## Troubleshooting [#troubleshooting]
Canvas isn't enabled for your organization.
Ask from a writable session.
Ask the creator to attach it, or attach it with `read`.
Writes and actions need a `read_write` attachment.
The creator reconnects the connector, then refreshes.
Use a non-private connector or tool, or store a snapshot instead.
Narrow the tool arguments.
Added columns must be nullable.
Connector-backed data needs a signed-in viewer; shared previews can't show it.
# Design systems (/canvas/design-systems)
A design system is a component library that canvas apps can import and render with. With one set up, the agent builds prototypes from your real components and themes, and the canvas editor offers prop controls for them. Without one, apps use plain React and CSS.
Every organization has the built-in `@inspect/ui` design system. You can add your own libraries next to it.
## Requirements [#requirements]
- Canvas enabled for your organization.
- The **Manage design systems** role (or **Admin**) to set up, publish, enable, disable, or choose the default. An admin grants it in [Users and roles](/security/users-and-roles).
- For setup, the repository that contains your component library, added to Inspect. See [Repositories](/sessions/repositories).
## Set up a design system [#set-up-a-design-system]
1. Go to `https://app.inspect.com/settings/canvas-design-systems` and select **Set up design system**.
2. Choose the **Repository** that holds the library, or a representative app that uses it, and select **Start setup**.
3. Inspect starts a session that follows the built-in `setup-canvas-design-system` skill. The agent packages your library: a definition (which imports apps may use, the themes, the guide agents read, and per-component editing metadata), agent-facing metadata about each export, and a single-file runtime bundle with the components' styles, fonts, icons, and providers.
4. The agent verifies rendering and editing against the build, then publishes a version with a description.
Setup also saves an Inspect skill named `canvas-design-system-` (for `@acme/ui`, `canvas-design-system-acme-ui`). It holds the integration's sources, nothing is committed to your repository, and later updates start from it. To update, open the design system's page and ask for the change, for example a new library version or a fix to component notes and props. A routine refresh with unchanged inputs doesn't publish a new version.
Keep authentication, backend calls, and application services out of the design system. Apps on the canvas have no access to your repository or its installed packages, only to what the bundle contains.
## Versions [#versions]
Published versions are named `-canvas.`, for example `4.2.0-canvas.3`. The revision increases when the package changes but the library version doesn't. A published `name@version` can never be replaced; every upload needs a new version.
- Bundles up to 20 MB.
- Metadata files up to 10 MB.
- Descriptions up to 500 characters.
The bundle must be one ES module. React and React DOM are supplied by the canvas and must not be bundled.
## How canvases pick a version [#how-canvases-pick-a-version]
Each canvas renders one version per design system, pinned the first time an app on that canvas uses it.
- New revisions of the library version a canvas already uses apply to it automatically.
- **Make current version** changes which library version newly pinning canvases get. Canvases already pinned keep their library version until someone asks the agent to update the canvas to the current version. That update affects every app on the canvas that uses the design system.
- Built-in design systems always render with the version Inspect currently ships, whatever version a canvas pinned.
## Default and choosing between design systems [#default-and-choosing-between-design-systems]
**Use for new apps** makes a design system the organization default. New apps start with its current version, and agents build with it unless the request or the task calls for another one. Changing the default doesn't touch existing apps. You can also have no default.
Agents choose among design systems by their descriptions. Write the **Description** as one or two sentences: what the library is, which product or brand it's for, and when agents should or shouldn't use it. It applies to every version. Clear it to restore the default.
## Disable a design system [#disable-a-design-system]
**Disable** hides a design system from agents choosing one for new apps or for canvases that don't use it yet. Canvases that already use it keep rendering and can still be edited. You can't disable the default; choose another default first. **Enable** reverses it.
## Edit the guide [#edit-the-guide]
Each version has a guide: the instructions agents read before building with it, such as which components to prefer and how to compose layouts. People with the **Manage design systems** role can edit the guide on the design system's page. Edits are versioned; **Guide history** compares earlier versions with the editor and can restore one. The latest saved edit replaces the guide that shipped in the package. Built-in design systems don't show a guide editor.
## Themes [#themes]
A design system can ship several themes. Each app picks one; when it doesn't, the design system's default theme applies. Light and dark color mode is set per canvas, separate from the theme.
## Troubleshooting [#troubleshooting]
Ask an admin for the role, then start the setup session again.
Publish from a writable session.
Reduce what the bundle includes, then publish a new version.
The definition's default theme isn't in its list of themes. Fix the definition and publish a new
version.
# Canvas (/canvas)
A canvas holds **apps**: live React code that Inspect writes and renders. Each app shows as one or more **frames** on the canvas map. An app with declared states (for example `form`, `review`, `confirmed`) gets one frame per state, all sharing the same code, so you can click through a whole flow. Use a canvas to try a UI before implementing it in a repository, to map how an existing screen behaves, or to build a small data-backed tool on top of [data sources](/canvas/data-sources).
## Requirements [#requirements]
- Canvas must be enabled for your organization. When it isn't, `/canvas` redirects to Home and the agent's canvas tools fail with `Canvas tools are not enabled for this session`.
- Read-only users can open canvases they have access to but can't edit, publish, or comment.
- Apps render with your organization's [design systems](/canvas/design-systems) when one is set up, or with plain React and CSS otherwise.
## Where canvases come from [#where-canvases-come-from]
Every session has at most one active canvas. Inspect creates it the first time the session's canvas is opened or used, titles it after the session, and gives it the session's visibility. Everyone participating in the session at that point becomes an editor.
- `/sessions//canvas` opens the session's canvas map, next to the conversation.
- `/sessions//canvas/` opens one app inside the session.
- `/canvas/` opens the canvas on its own, in edit mode or view only depending on how it is shared with you.
- `/canvas//present` opens present mode: the canvas's prototypes at full width, with no canvas chrome.
- `https://app.inspect.com/canvas` opens the canvas library: every canvas you can see that has at least one app.
The library filters by **Scope** (**All apps**, **My apps**, **Starred**) and **Author**, and sorts by **Newest**, **Oldest**, or **Title (A–Z)**. Search matches canvas titles and app names. Starring is per person.
### Working on one canvas from several sessions [#working-on-one-canvas-from-several-sessions]
A session can attach to an existing canvas instead of its own. Paste a `/canvas/` link and ask the agent to work on it, or ask it to find one by name. Attaching replaces the session's active canvas without deleting either one. Both you and the session's owner need edit access to the target canvas first; attaching never grants access. Another session can't attach a canvas that has never been published (`This canvas is a draft. Someone with access has to publish it before another session can attach it.`).
While an agent edits an app, the frame shows a working indicator for that session. It clears when the agent finishes or 40 seconds after its last canvas call.
## What the agent can do [#what-the-agent-can-do]
The agent builds and edits apps directly: create, edit by exact text replacement, replace, resize, move, archive, delete, and rename. It can:
- Render an app in a headless browser and screenshot it to check its own work.
- Open the canvas in the session's [browser](/sessions/browser) and use the same editing controls you do.
- Read and resolve comments.
- Save a named version before a large change.
- Switch the canvas between light and dark color modes and pick a theme per app.
- Start from a published template, or save the canvas as a new template.
- Attach and query data sources.
Agents can't publish a canvas; a person has to. A read-only session can't attach a canvas or change apps.
## Editing apps yourself [#editing-apps-yourself]
You can change an app without a prompt:
- Double-click text to edit the literal in the source. Dynamic values (`label={row.name}`) stay read-only; editing a literal inside a loop changes it for every item.
- Select an element to change its props and styles in the props panel. Design-system components and HTML elements have controls for supported props; apps can expose extra controls (knobs) for things like animation timing.
- Use **Show code** to edit the source.
- Check an app at **Native**, **Mobile** (390×844), **Tablet** (768×1024), and **Desktop** (1440×900) sizes.
- **Export** a frame as PNG (with a scale), SVG, or a Figma snapshot.
Edits save automatically and go through the same undo history as agent edits.
### Design directions [#design-directions]
When the agent creates or substantially changes an app, it attaches about five suggested directions. Choosing one from **Explore design directions** starts a background agent in the session that builds the direction as a draft next to the source app. Nothing reaches the canvas until you keep the draft. Drafts you neither keep nor discard are dropped after an hour. If the source app changes while a direction is generating, the request fails with `This frame changed. Try generating it again.` Apps over 200,000 characters of code can't generate directions.
## Versions [#versions]
Inspect snapshots an app's previous state each time it changes, including reorders and restores. **Version history** lists those snapshots. You can name a version (up to 80 characters), restore any version, and restore an app you deleted. Restoring writes a new version, so you can undo it. **Archive app** takes an app off the map without deleting it; **Restore to the map** brings it back.
## Comments [#comments]
Comments pin to an app, an element, a region, or a specific app state. Anyone who can edit the canvas can comment, resolve, and reopen. Only a comment's author can delete it. The agent can read every comment, with its anchor, and resolve comments after addressing them, so "address the open comments" is a complete prompt.
Comments left on a [walkthrough](/canvas/walkthroughs) are also tied to a moment in that recording.
## Sharing and access [#sharing-and-access]
Open the canvas's sharing settings to control access.
- **General access** is **Restricted** or **Anyone in the organization**. Restricted limits the canvas to its owner and the people listed.
- **Organization role** is **Can view** or **Can edit**: what everyone gets when general access is **Anyone in the organization**.
- **People** get **Can view** or **Can edit** per person. Add them by email; each person must be a member of your organization.
Only the canvas owner (the person whose session created it) can change access. The owner always has edit access. Changing access disconnects other open tabs so they reconnect with the new permissions.
A canvas created from a private session follows that session instead: only the session's owner and participants can open it, and the sharing settings show `Access follows the private session. Manage collaborators in that session.` Making a session private also makes canvases it created private.
### Modes [#modes]
- **Edit mode:** people who can edit a canvas always see its latest state, with the editing tools, and it updates live as edits land.
- **View only:** people who can only view a canvas open it at its latest state and keep seeing it as it was then. When it changes, **New changes are available** appears with **See latest**.
- **Present mode:** `/canvas//present` shows the canvas's prototypes at full width. It updates live for people who can edit and shows the same **See latest** prompt for everyone else. Open it with **Present**; **Copy present link** copies its address.
A canvas needs at least one app to be shared (`Add an app before publishing the canvas`).
Your sharing role decides between edit mode and view only; there is nothing to switch. On phones, canvases open view only whatever your role; if you can edit, they still update live.
### Links [#links]
Links to apps and frames open for people signed in to Inspect who have access. In Slack, links to a canvas or walkthrough unfurl with a preview only when the canvas is shared with the organization and didn't come from a private session; up to five canvas links unfurl per message. Other links fall back to the regular session unfurl.
## Templates [#templates]
When templates are enabled for your organization, **Templates** at `https://app.inspect.com/canvas/templates` lists canvases that people and agents start from.
1. In a canvas's options menu, choose **Save as template**. This copies the apps into a new, unpublished template canvas you own.
2. Edit the template like any canvas.
3. Publish it with **When to use it** (required, up to 2,000 characters). Agents read this text to choose a template. Turn on **Anyone in the organization can use it** to let everyone view and start from it; only editors can change it.
**Add from a template** copies a template's published apps onto your canvas. Publishing a template again doesn't change canvases already made from it. Read-only users can't publish templates.
Older single-app templates also appear on this page for people with the **Manage design systems** role, who can edit their name and description, set **Available to** to **Personal** (the creator and agents in their sessions) or **Everyone** (any canvas agent in a matching workspace), and delete them.
## Troubleshooting [#troubleshooting]
The canvas doesn't exist or you don't have access. Ask the owner to share it, or ask a participant of
its private session to add you there.
Only the person whose session created the canvas can change sharing.
Change the session's participants or visibility instead.
Sharing works only with people already in your Inspect organization.
Your account is read-only. An admin can change your role in [Users and
roles](/security/users-and-roles).
You can view the canvas but can't publish it.
Start a writable session to work on the canvas.
# Walkthroughs (/canvas/walkthroughs)
A walkthrough is a recording of you presenting a canvas: your camera and microphone, plus a replay of where you moved, which frames you opened, which app states you clicked into, and where you pointed. Use one to explain a prototype to reviewers who weren't in the session, or to give feedback on a flow without writing it all down.
The replay isn't a screen recording. Inspect saves the code of every app on the canvas at the moment you record, so viewers watch live frames as they were then, even after the apps change. They can pause at any point and explore the canvas at that moment.
## Requirements [#requirements]
- Edit access to the canvas. Anyone who can view the canvas can watch its walkthroughs.
- A browser with camera and microphone support that can record MP4 or WebM. Chrome, Edge, and Safari work.
- Camera and microphone permission for Inspect in your browser.
## Record a walkthrough [#record-a-walkthrough]
1. Open the canvas and start recording. Inspect asks for camera access before it begins.
2. Present the canvas. You can pause and resume the recording and mute the microphone. Drag your camera bubble to move it, or focus it and use the arrow keys.
3. Stop, then review the recording.
4. Set a title (up to 160 characters; the default is `App walkthrough`), choose whether to blur your camera background, and pick a thumbnail. You can capture a thumbnail from any moment where a frame is open, or use a generated one.
5. Select **Save walkthrough**. If you close the recorder instead, Inspect asks before discarding it.
If a device disconnects or recording is interrupted, you can still review and save the portion captured so far.
## Limits [#limits]
- Up to 10 minutes long.
- Camera recordings up to 48 MB, MP4 or WebM.
- Replay data up to 8 MB.
- Up to 100 apps captured per walkthrough.
- Thumbnails up to 1 MB, WebP, PNG, or JPEG.
A long walkthrough of a large canvas can hit the replay limit before the time limit. Inspect then shows `The replay exceeds the upload limit. Record a shorter walkthrough.`
## Watch and share [#watch-and-share]
Walkthroughs open at `/canvas//walkthrough/`. Add `?time=` to start at a moment, up to 10 minutes in. **Share** copies the link.
Playback defaults to 1.5× speed and offers 0.75×, 1×, 1.25×, 1.5×, and 2×. While playing, the view follows the presenter. Pause to move around the canvas freely, then select an element to comment on it. Comments land on the timeline at that moment and also appear with the canvas's other [comments](/canvas#comments).
The link works for anyone with access to the canvas. In Slack, it unfurls with a preview only when the canvas is shared with the organization and didn't come from a private session.
## Manage walkthroughs [#manage-walkthroughs]
- Editors of the canvas can **Resolve** a walkthrough once its feedback is handled, and **Reopen** it.
- Only the person who recorded a walkthrough can change its title and background blur, or delete it.
- Deleting a walkthrough removes the camera recording, the replay, the thumbnail, and every comment left on it. It can't be undone.
## Troubleshooting [#troubleshooting]
Switch browsers.
Switch browsers.
The canvas's apps exceed the replay size. Record with fewer or smaller frames.
Playback still works; watch in another browser to see the blur.
Ask the person who recorded it.
Someone else saved a change at the same time. Retry.
# Approval agent (/code-review/approval-agent)
Approval agent evaluates every new commit on a pull request against policy files in the repository. Rules match changed paths and authors, including GitHub teams, and can send the change to LLM classifiers that rate its risk against criteria you write. When every requirement passes, Inspect submits a GitHub approval. Anything else goes to human review. Organization policies can add requirements that every repository must meet.
## Requirements [#requirements]
- The organization switch **Automated approvals** is on in [Settings → Approval agent](https://app.inspect.com/settings/approvals). Changing it, and **Timing**, requires the **Manage code review** role or Admin.
- The repository's default branch has a valid policy bundle under `.inspect/approvals/`. A repository without one is never evaluated.
- The pull request's head branch is in the same repository. Pull requests from forks are not evaluated.
- Organization policies require the **Manage PR approval policies** role or Admin. Organization policies are rolling out and may not be available in your organization yet.
## Set up a repository [#set-up-a-repository]
Once **Automated approvals** is on, run the `/configure-approvals` skill in a session for the repository. Inspect asks what policy you want, writes or updates the files under `.inspect/approvals/` while keeping existing rules, and validates them. Merge the result to the default branch; Approval agent reads policy only from there.
**Timing** chooses between **On every commit** and **On every commit, after review agent**, the default. The second waits for [Review agent](/code-review/review-agent) to finish before evaluating.
## Policy bundle [#policy-bundle]
- `.inspect/approvals/path_rules.yaml` holds `rules` that cover changed files, and an optional `default` for files no rule matches.
- `.inspect/approvals/classifiers/.yaml` holds one named classifier per file. `` is what rules target as `classifier:`.
- `.inspect/approvals/repo_rules.yaml` holds repository-wide settings: the ownership gate, a classifier for every pull request, and shadow mode.
Each file is limited to 128 KiB, and all classifier files together to 128 KiB. Classifier files can end in `.yaml` or `.yml`. Duplicate YAML keys are rejected, and only `true` and `false` parse as booleans (`yes` and `on` are strings).
### Path rules [#path-rules]
Every changed file must be covered by a rule or by `default` before Inspect can approve.
```yaml
# .inspect/approvals/path_rules.yaml
default:
action: classify
targets: [classifier:change-risk]
rationale: Evaluate changes not covered by a specific rule.
rules:
- paths: ['docs/**']
action: allow_bot_approval
rationale: Documentation-only changes are safe to approve.
- paths: ['migrations/**', 'security/**']
action: deny
rationale: These changes always need human review.
- name: Dependency bumps
paths: ['package.json', 'bun.lock']
authors: ['@dependabot[bot]']
action: classify
targets:
- target: classifier:change-risk
threshold: no_risk
rationale: Bot dependency bumps must be rated no risk.
```
| Field | Type | Required | Default | Description |
| ------------------ | ---------------------------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `paths` | `string[]` | Yes | | 1 to 100 case-sensitive, repository-relative globs. `**` crosses directories. No leading '/', '..', or backslashes. |
| `excluded_paths` | `string[]` | No | | Up to 100 globs that stop a file from matching. |
| `paths_match` | `'any' \| 'all'` | No | `any` | any: a file matches when any pattern matches it. all: every pattern must match the same file. |
| `authors` | `string[]` | No | Everyone | '\*', '@user', '@app[bot]', or '@org/team'. Quote each. '\*' cannot be combined with other authors. |
| `excluded_authors` | `string[]` | No | | Authors the rule skips, in the same form. |
| `action` | `'allow_bot_approval' \| 'deny' \| 'classify'` | Yes | | allow_bot_approval also accepts its older name, allow. |
| `targets` | `array` | No | | Required with classify. Classifiers to run, as classifier:\ or \{target: classifier:\, threshold: \\} to override that classifier's threshold. |
| `rationale` | `string` | Yes | | Why the rule exists, shown on the pull request. Up to 2,000 characters. |
| `name` | `string` | No | | Shown on the pull request instead of the rationale. Up to 200 characters. |
`default` takes `action`, `targets`, and `rationale` and applies only to files no rule matches. A file can have at most 200 rules.
Overlapping rules accumulate. An `allow_bot_approval` rule does not cancel a matching `deny` or classifier; it only lets Approval agent approve those files. Required human reviews in GitHub branch protection still apply separately.
### Classifiers [#classifiers]
A classifier describes risk tiers in your own words. Inspect sends the whole pull request diff to it and approves only when the rating is at or below the threshold.
```yaml
# .inspect/approvals/classifiers/change-risk.yaml
threshold: low
risk_tiers:
major: Authentication, authorization, or privileged access changes.
medium: User-visible production behavior changes.
low: Bounded internal changes with limited operational impact.
no_risk: Documentation, comments, and formatting only.
```
`threshold` is `no_risk`, `low`, `medium`, or `major`. `risk_tiers` needs at least one of those four keys, each up to 10,000 characters. Classifier names are lowercase, start with a letter, use letters, digits, `-`, or `_`, and are at most 64 characters.
### Repository rules [#repository-rules]
```yaml
# .inspect/approvals/repo_rules.yaml
gates:
author_ownership: true
classifier:
threshold: medium
risk_tiers:
major: Changes that could cause data loss or a security incident.
medium: Changes to production behavior.
shadow_mode: false
```
| Field | Type | Description |
| ------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `gates.author_ownership` | `boolean` | true requires human review unless the author is a CODEOWNER of every changed file. Inspect reads CODEOWNERS at the base commit. |
| `classifier` | `object` | A classifier that runs on every pull request. Prefer named classifiers, which path rules apply only where needed. |
| `shadow_mode` | `boolean` | true runs evaluations and posts results, marked as shadow evaluations, but never submits a GitHub approval. Use it to trial a policy. |
## How evaluation works [#how-evaluation-works]
1. A new commit starts an evaluation of that revision. A newer commit supersedes it.
2. Gates run first. If the ownership gate fails, no classifiers run.
3. Organization and repository rules are matched against the changed files and author. Any matching `deny`, or any uncovered file, sends the pull request to human review.
4. Each classifier that a matching rule targets rates the diff. Every one must be at or below its threshold.
5. If everything passes, Inspect submits or updates its GitHub approval. A later rejection can dismiss an earlier approval.
Inspect posts a result comment on the pull request: **✅ Approved**, **🧮 Requires human approval** with the reason, or **⚠️ Evaluation failed**. To evaluate again without a push, comment `/inspectapprove` on the pull request. Only people with write or admin access can trigger it.
## Organization policies [#organization-policies]
Organization policies add requirements on top of each repository's policy. A repository policy cannot loosen them, and they never approve on their own: the repository's policy still has to approve the pull request.
Manage them in [Settings → Approval agent](https://app.inspect.com/settings/approvals) under **Organization policies**. **Create policy** offers three starts: describe what to enforce and let Inspect write it, start from a template, or **Write a policy from scratch**. Each policy has:
- A **Name**, up to 64 characters, shown in the list and on pull requests.
- A scope: **All repositories**, **Only these repositories**, or **All repositories except these**, listing up to 500 repositories.
- One YAML document in the [policy format](#policy-format), up to 128 KiB. The editor validates it as you type and shows each problem under its line.
An organization can have up to 50 policies. A saved change applies to evaluations that start afterward. If any organization policy is added, edited, or deleted while an evaluation runs, that evaluation does not approve; push a new commit or comment `/inspectapprove` to evaluate against the current policies. Deleting a policy stops new checks against it; earlier evaluations keep the version they used.
Each saved change to a policy's document creates a new version; renaming does not. **Version history** lists every version with who saved it and when. **Restore this version** loads a version into the editor, and saving it creates a new version.
### Try a policy on pull requests [#try-a-policy-on-pull-requests]
**Try on pull requests** in the editor takes up to 10 pull request links, one per line, and shows what the policy you are editing would require of each. It matches every rule against the changed files and author and checks the ownership gate against the repository's `CODEOWNERS`. It does not run classifiers; it lists the ones that would decide and the threshold each must meet.
## Policy format [#policy-format]
An organization policy document has up to three top-level keys, all optional: `gates`, `rules`, and `classifiers`. Unknown keys are rejected.
```yaml
# Require the author to own every changed file in CODEOWNERS.
gates:
author_ownership: true
rules:
# No paths: applies to every pull request.
- name: General risk
action: classify
targets: [classifier:general]
rationale: Every change gets a general risk check.
# Changes here always need a human.
- name: CI and deploy configuration
paths: ['.github/workflows/**', 'infra/**']
action: deny
rationale: CI and deploy changes always need human review.
# Changes here must pass the security classifier.
- name: Authentication
paths: ['**/auth/**', '**/permissions/**']
action: classify
targets: [classifier:security]
rationale: Authentication changes need a security classification.
classifiers:
general:
threshold: low
risk_tiers:
major: Weakens authentication, authorization, or secret handling.
low: Bounded changes that keep existing security controls.
security:
threshold: low
risk_tiers:
major: Weakens authentication, authorization, or secret handling.
medium: Changes who can reach existing sensitive data or actions.
low: Bounded changes that keep existing security controls.
no_risk: Comments, tests, and formatting only.
```
### gates [#gates]
| Field | Type | Description |
| ------------------ | --------- | ---------------------------------------------------------------------------------- |
| `author_ownership` | `boolean` | true requires human review unless the author is a CODEOWNER of every changed file. |
Gates apply to every pull request in the policy's scope. When one fails, no classifiers run.
### rules [#rules]
Up to 200 rules. Each matches changed files and, optionally, authors.
| Field | Type | Required | Default | Description |
| ------------------ | ---------------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | `string` | No | | Shown on pull requests. Up to 200 characters. |
| `paths` | `string[]` | No | | Up to 100 case-sensitive, repository-relative globs. `**` crosses directories. Leave out to match every pull request. |
| `excluded_paths` | `string[]` | No | | Up to 100 globs that stop a file from matching, even when paths match it. |
| `paths_match` | `'any' \| 'all'` | No | `any` | any: a file matches when at least one pattern matches it. all: every pattern must match the same file. |
| `authors` | `string[]` | No | Everyone | '\*', '@octocat', '@dependabot[bot]', or '@acme/platform'. Quote each. |
| `excluded_authors` | `string[]` | No | | Authors the rule skips, in the same form. |
| `action` | `'deny' \| 'classify'` | Yes | | allow is not accepted, because organization policies cannot approve changes. |
| `targets` | `string[]` | No | | Required with classify. Classifiers to run, like [classifier:security]. Each must be defined under classifiers. Not accepted with deny. |
| `rationale` | `string` | Yes | | Why the rule exists, shown on pull requests. Up to 2,000 characters. |
A rule without `paths` still honors `excluded_paths`, `authors`, and `excluded_authors`, so it can apply to every pull request except some files or authors.
If a `deny` rule matches any changed file, the pull request goes to human review, even when a repository rule would allow it. If a `classify` rule matches, every classifier in `targets` must rate the change at or below its threshold. Organization rules do not have to cover every changed file. A file no organization rule matches gets no organization requirement, and the repository's policy must still cover it.
### classifiers [#classifiers-1]
Up to 200 classifiers, which run only when a `classify` rule names them in `targets`. Each key is the classifier's name: lowercase, starting with a letter, using letters, digits, `-`, or `_`, up to 64 characters.
| Field | Type | Description |
| ------------ | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `threshold` | `'no_risk' \| 'low' \| 'medium' \| 'major'` | The highest risk that can still be approved. |
| `risk_tiers` | `object` | What each level means for this classifier. Set at least one of major, medium, low, and no_risk, each up to 10,000 characters. |
The classifier compares the pull request's diff with these descriptions, so describe the risk you care about rather than specific files.
## Troubleshooting [#troubleshooting]
A file under `.inspect/approvals/` on the default branch failed validation, so the pull request is
not auto-approved. Run `/configure-approvals` to fix it.
A changed file matches no rule. Add a rule or a `default`.
Inspect could not read the files from GitHub. Comment `/inspectapprove` to retry.
"Organization policy name: rationale"
>
}
>
An organization `deny` rule matched. The change needs human review.
The author does not own every changed file in `CODEOWNERS`, or the repository has no `CODEOWNERS`
file.
**Automated approvals** is off, the default branch has no `.inspect/approvals/` bundle, or the pull
request comes from a fork.
Policy is read from the default branch. Merge the fix there, then push a new commit or comment
`/inspectapprove`.
`shadow_mode: true` is set in `repo_rules.yaml`. Remove it to let Approval agent approve.
# Code review (/code-review)
Inspect takes part in a pull request in two roles. As the author, the session that opened the pull request keeps working on it after you push: it can fix review feedback, failing checks, and merge conflicts. As a reviewer, three agents run on pull requests in your repositories, whoever wrote them.
Reviews the diff with a panel of specialist reviewers and posts findings as review comments. Turned
on by a per-repository setting, or your personal setting for your own pull requests.
Runs the app from the pull request's commit, exercises the changed behavior, and posts evidence.
Turned on by `.inspect/verification/config.yml` in the repository. Runs only on pull requests from
sessions.
Checks the pull request against policy files in the repository and submits a GitHub approval. Turned
on by an organization switch plus a policy bundle under `.inspect/approvals/` on the default branch.
Approval agent can wait for Review agent to finish before it evaluates a pull request. [Review providers](/code-review/review-providers) let a third-party reviewer's findings appear and be auto-fixed next to Review agent's.
## Pull requests view [#pull-requests-view]
[Pull requests](https://app.inspect.com/pull-requests) lists pull requests in your organization's connected repositories. It opens filtered to open pull requests that request your review. You can filter by reviewer (**You**, **Anyone**, **None**), author, status (open, closed, draft, ready for review, merged, unmerged), and repository, and Inspect saves your filters. Opening a pull request shows its diff, review threads, checks, and Review agent findings without leaving Inspect. Replies and resolutions you make there are posted to GitHub.
## Address review feedback [#address-review-feedback]
On any review thread, **Address this** attaches the thread to your session's prompt with the request "Fix this finding". The agent reads the thread, changes the branch, and can resolve threads on GitHub with its `resolve_pull_request_threads` tool. That tool accepts only thread IDs you or the prompt selected, so the agent never resolves a thread you did not hand it. Read-only sessions and sessions with git writes turned off cannot resolve threads.
**Resolve with reason** resolves a thread and records why: **Fixed it**, **Incorrect**, **Not relevant**, **Too minor**, **Won't fix**, or **Outdated**.
### Fix review feedback automatically [#fix-review-feedback-automatically]
**Fix Pull Request review findings** in [Settings → Agent](https://app.inspect.com/settings/agent) makes the session that opened a pull request respond to new reviews without a prompt. It is off by default. Choose which reviewers it acts on:
- **Human reviewers** acts on reviews from individual GitHub users.
- **Robot reviewers** acts on reviews from GitHub App and bot accounts. Selecting it includes Review agent.
- **Review agent** acts on Review agent findings. Locked on while Robot reviewers is selected.
- **Customize** sets **Auto-fix** or **Ignore** for a specific GitHub identity. An ignore rule wins over every category.
The policy belongs to the pull request's author, and a session can carry its own override. Inspect skips the review when:
- No Inspect session is linked to the pull request, or its session is archived.
- The pull request author has no Inspect account linked to their GitHub account.
- The pull request was closed without merging.
- The review mentions `@inspect`. Mentions go to the mention flow instead.
When a review arrives on a merged pull request, Inspect starts a new follow-up session from the base branch instead of reusing the original session.
## Fix failing checks and merge conflicts [#fix-failing-checks-and-merge-conflicts]
**Fix CI failures** in [Settings → Agent](https://app.inspect.com/settings/agent) is on by default. When a check fails on a pull request linked to a session, or GitHub reports merge conflicts, Inspect queues a prompt in that session with the check name, status, description, and details link. The agent rechecks the current CI state, since the notice may be stale, then investigates and fixes the failure.
- Inspect skips the failure if the pull request's head has moved past the failing commit.
- Failures from GitHub's merge queue are sent too. The prompt tells the agent to reproduce against the latest base branch and to report, without changing the pull request, when another queued pull request caused it.
- Canceled and skipped Buildkite builds are ignored.
- To ignore specific checks in a repository, list them in **Ignore CI failures from these checks** in the repository's settings. Names are matched case-insensitively.
## Related settings [#related-settings]
These are personal settings in [Settings → Agent](https://app.inspect.com/settings/agent):
- **Create Pull Requests as Ready for Review** (default off): sessions open pull requests as ready instead of draft.
- **Review Pull Request drafts** (default: organization default): overrides the organization's Review agent timing for your own drafts. Locked while the setting above is on.
- **Run Verification agent on Pull Requests** (default on): starts [Verification agent](/code-review/verification-agent) after each push to your sessions' pull requests.
# Review agent (/code-review/review-agent)
Review agent reviews pull requests in your GitHub repositories and posts its findings as inline review comments. Each review runs a general reviewer over the whole change plus separate reviewers for security, logic, API contracts, data integrity, performance, and test design. [Repository rules](#repository-rules) add your own specialist reviewers to that panel. Review agent re-reviews each new commit.
## Requirements [#requirements]
- Any member can turn reviews on for their own pull requests in a repository.
- The **Edit repositories** role or Admin can turn reviews on for every pull request in a repository.
- The **Manage code review** role or Admin can change models, timing, cost limit, and skipped branches for the organization.
- Anyone who can merge to the repository can add rules or orchestration instructions, since the files live in the repo.
## Choose which pull requests get reviewed [#choose-which-pull-requests-get-reviewed]
The **Repositories** table in [Settings → Review agent](https://app.inspect.com/settings/review-agent) has two settings per repository:
- **My PRs**, turned on with **Every PR of mine**, reviews pull requests you author. This is your personal preference.
- **Repository-wide**, turned on with **Every PR**, reviews pull requests from every author.
Either setting can instead be **Every Inspect PR**, which reviews only pull requests linked to an Inspect session.
A pull request is reviewed when either applies. Select several repositories to change them in bulk. **Check rules** looks for a [rules file](#repository-rules) on the default branch.
You can also set the repository-wide value through the [API](/api) as `automatic_reviews` (`on`, `inspect`, or `off`) on a repository.
### Skip reviews on a pull request [#skip-reviews-on-a-pull-request]
Add the `disable-inspect-review` label to opt a pull request out of automatic reviews and push re-reviews. If a review is already running when the label is added, Inspect cancels it, marks its in-progress checks as canceled, and archives the review session. Removing the label resumes automatic reviews on the next push. Explicit requests (`/inspectreview`, `trigger-inspect-review`, or starting a review in Inspect) still run.
## Timing and drafts [#timing-and-drafts]
**Timing** sets when the organization's reviews run. The default, **On every commit, only when Ready for review**, holds drafts until they are marked ready. **On every commit** reviews drafts too.
Each person can override this for their own drafts with **Review Pull Request drafts** in [Settings → Agent](https://app.inspect.com/settings/agent).
## Request a review [#request-a-review]
- Comment `/inspectreview` on a pull request. Text after the command is passed to Review agent as an extra request. `/review` is an alias, unless it has been turned off for your organization because your own tooling uses it. Commands inside code blocks and inline code are ignored.
- Add the `trigger-inspect-review` label, for example from a GitHub Actions workflow. Inspect removes the label once the request is queued, so you can add it again later.
Either one starts Review agent if it is not running, reviews the current head, and resumes a review paused at the cost limit. With the label, if the diff has not changed since the last review, Review agent rechecks its open findings against the current code instead: it resolves the ones that no longer apply and posts a short comment listing what it resolved and what is still open.
To challenge a finding or ask for a fix, reply on its thread and mention `@inspect`.
## Cost limit [#cost-limit]
**Cost limit** pauses automatic re-reviews of a pull request once its review session has cost a set amount. It is on by default at $10 per pull request. When it trips, Review agent posts a comment with the cost so far and a **Resume Inspect reviews for this Pull Request** checkbox. Checking it resumes reviews; only people with write access to the repository can resume. Commits pushed while a review is paused are not reviewed until it resumes.
## Models [#models]
In [Settings → Review agent](https://app.inspect.com/settings/review-agent) you set a model and reasoning effort for three roles:
- **Orchestrator model** plans the review, dispatches the reviewers, and writes the review. System default: `gpt-6.1-sol`, `high`.
- **Generalist reviewer model** reviews the whole change. System default: `gpt-6.1-sol`, `xhigh`.
- **Sub-reviewer model** runs the specialist reviewers, the test reviewer, and repository rules. System default: `gpt-6.1-sol`, `high`.
Supported efforts are `low`, `medium`, `high`, and `xhigh`. A role left on **System default** uses the default above. If you pick a model without an effort, or an effort the model does not support, the role runs at `high`, or at the model's first supported effort when it has no `high`.
Organizations that chose a single model before per-role settings existed keep that choice for all three roles until someone saves the settings again.
The models are fixed when a review session starts. Restart Review agent on a pull request to apply a change to a run already in progress.
## Merge queues [#merge-queues]
Review agent only reviews pull request heads, so a merge queue that waits for required checks on its own branch would never see Review agent's checks complete. List branch patterns in **Skipped branches**, one regular expression per line, such as `^gh-readonly-queue/` for GitHub merge queues. Commits pushed to a matching branch get Review agent checks completed as skipped, which satisfies required checks. Branches with an open pull request are excluded.
When Trunk is connected in [Settings → Integrations](https://app.inspect.com/settings/integrations), branches starting with `trunk-merge/` are always skipped, including the draft pull requests Trunk opens to test queued changes.
## Repository rules [#repository-rules]
`.inspect/reviews/rules.yml` adds specialist reviewers and sets repository model defaults. Inspect reads it from the pull request's head commit, so you can iterate on rules within the pull request that changes them.
```yaml
version: 1
model: gpt-6.1-sol
reasoning_effort: high
rules:
- id: security-sol
skill: security
model: gpt-6.1-sol
reasoning_effort: xhigh
files: ['src/**']
condition: Authentication or authorization behavior changes
- id: security-opus
skill: security
model: claude-opus-5-5
files: ['src/**']
condition: Authentication or authorization behavior changes
```
| Field | Type | Required | Default | Description |
| -------------------------- | ---------------------------------------- | -------- | ------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `version` | `1` | Yes | | Format version. Must be 1. |
| `model` | `string` | No | | Replaces the organization model for all three roles in this repository. |
| `reasoning_effort` | `'low' \| 'medium' \| 'high' \| 'xhigh'` | No | | Replaces the organization effort for all three roles. |
| `rules[].id` | `string` | Yes | | Unique within the file. Lowercase letters, digits, and hyphens, up to 40 characters, starting with a letter or digit. |
| `rules[].skill` | `string` | Yes | | The skill the reviewer runs, by name. Lowercase letters, digits, and hyphens, up to 64 characters. |
| `rules[].files` | `string[]` | No | | Globs. The rule is considered only when the pull request changes a matching file. `**` crosses directories. |
| `rules[].condition` | `string` | No | | Free text. The orchestrator checks it against the diff and runs the rule only when it applies. |
| `rules[].model` | `string` | No | Sub-reviewer model | Model for this rule's reviewer. |
| `rules[].reasoning_effort` | `'low' \| 'medium' \| 'high' \| 'xhigh'` | No | Sub-reviewer effort | Effort for this rule's reviewer. |
A rule with neither `files` nor `condition` runs on every review. Rule reviewers are added to the built-in panel; the `security` rules above run in addition to the built-in security reviewer. Rules that resolve to the same skill, model, and effort share one reviewer, so the example runs two separate security reviews.
The skill can come from your Inspect skill catalog or from the repository, at `.agents/skills//SKILL.md` or `.claude/skills//SKILL.md`. A rule effort that its model does not support runs at `high`, or at the model's first supported effort. Restart an existing review to pick up model changes.
### Personal rules [#personal-rules]
A file at `.inspect/reviews/users//rules.yml` uses the same format and applies only to pull requests that person authored or reviews. Add `applies_to` to a rule to narrow it: `authored`, `reviewing`, or `both` (the default). The author's file always loads; reviewers' files load for at most three reviewers per pull request.
## Orchestration instructions [#orchestration-instructions]
Rules add things to check. To change how the review is written or what it should skip, add `.inspect/reviews/ADDITIONAL_ORCHESTRATION.md` in plain Markdown:
```markdown
- Do not report naming, formatting, or import-order findings; our linters cover them.
- Do not flag missing tests for changes under `scripts/`.
- Keep the summary to three bullets or fewer.
```
Inspect reads it from the pull request's head commit and adds it to the orchestrator's instructions on every review and re-review. Only the first 60,000 characters are used. When an instruction conflicts with Review agent's standard process or severity rubric, the standard process wins. A pull request picks up the file only once its branch contains it, for example after you merge it to the base branch and update the pull request.
## Troubleshooting [#troubleshooting]
Add the queue's branch pattern to **Skipped branches**, or connect Trunk.
The pull request hit the cost limit. Check the resume box in Review agent's comment, comment
`/inspectreview`, or add `trigger-inspect-review`.
Timing is **only when Ready for review**, or the author turned off **Review Pull Request drafts**.
Its `files` globs match no changed file, its `condition` did not apply, or `rules.yml` failed
validation (for example a duplicate `id`).
Model choices are fixed when the review session starts. Restart Review agent on the pull request.
# Review providers (/code-review/review-providers)
Review providers are in alpha and available by request. Behavior, fields, and limits can change without notice. Ask your Inspect contact to turn them on for your organization.
A review provider is an automated code reviewer that is not built into Inspect: a GitHub App that posts inline pull request review comments and check runs. Inspect shows any GitHub App's comments and checks already. Registering the app as a provider, and having it follow the format on this page, adds:
- A row for the provider in a pull request's **Reviews** menu, with its status and open findings counted by severity.
- The provider's summary and open findings, grouped by severity, when you select the row.
- Auto-fix by severity: Inspect fixes critical and warning findings and skips the rest.
- With the [status API](#report-status-with-the-api): a status, message, and summary that come from the provider directly, including when a review fails.
- With a [webhook](#receive-webhooks-from-inspect): **Run review**, **Re-run review**, and **Retry review** in the provider row, and the reason when someone resolves a finding.
Inspect does not decide whether a review blocks a merge. To gate merges, the provider posts its own check run and the organization marks it required in GitHub branch protection.
## Without registration [#without-registration]
A GitHub App that posts inline review comments and check runs already gets this, with no setup:
- Its inline comments appear in Inspect's diff views and comment list, grouped by file, with per-file counts.
- People can reply to, resolve, or **Address this** on its comments from Inspect. Replies and resolutions go to GitHub.
- Its check runs appear with their GitHub status.
- A pull request author can auto-fix comments from robot reviewers, or from this bot specifically, in **Fix Pull Request review findings**. Without registration that covers all of the bot's comments, because Inspect cannot tell a critical finding from a nit.
## Register a provider [#register-a-provider]
Someone with the **Manage code review** role or Admin registers the provider in [Settings → Review agent](https://app.inspect.com/settings/review-agent) under **Review providers**:
| Field | Type | Description |
| --------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Display name | `string` | Shown in the Reviews menu. Up to 80 characters. |
| `Slug` | `string` | 3 to 40 lowercase letters, digits, and hyphens, starting and ending with a letter or digit, such as acme-review. It cannot change. |
| GitHub App ID | `number` | The numeric ID of the app that posts the check runs and comments. |
| GitHub App slug | `string` | The app's URL name, as in github.com/apps/acme-review. Inspect identifies the app's comments by its bot user, acme-review[bot]. |
| Logo URL | `string` | Optional https:// image URL. |
| `Repositories` | `string[]` | Up to 500 owner/name repositories the provider reviews. Leave empty for all repositories. |
| Webhook URL | `string` | Optional HTTPS URL that receives webhooks from Inspect. |
The GitHub App must be installed on those repositories with `checks: write` and `pull_requests: write`.
### Trust rules [#trust-rules]
- Inspect uses only check runs created by the registered GitHub App.
- Inspect reads a finding marker only from a comment the app's bot user wrote.
- If a person edits a finding comment, Inspect ignores its marker until the app edits the comment again.
Markers are visible to anyone who can read the pull request. Do not put secrets or private data in them.
## Report status with a check run [#report-status-with-a-check-run]
Create a check run from your GitHub App for each commit you review.
| Field | Type | Description |
| ---------------- | ------------------------------------------ | ---------------------------------------------------------------------------------------------------- |
| `name` | `string` | Your reviewer's name, such as Acme Review. Keep it stable; branch protection matches checks by name. |
| `head_sha` | `string` | The commit you reviewed. |
| `status` | `'queued' \| 'in_progress' \| 'completed'` | The check run status. |
| `conclusion` | `string` | Your choice. Inspect shows it as is. |
| `details_url` | `string` | A link to the review in your product. The provider row links to it. |
| `output.summary` | `string` | Your summary in Markdown. Inspect shows the first 16 KB. |
The provider row reflects your app's newest check run on the pull request:
- `status: queued` shows Queued.
- `status: in_progress` shows Reviewing.
- `status: completed` with `conclusion: cancelled` or `timed_out` shows Did not finish.
- `status: completed` with any other `conclusion` shows your finding counts, or No findings.
- A check run on a commit that is not the pull request head shows Outdated review.
If your review stops on an error, complete the check run with `cancelled` or `timed_out` so Inspect does not show it as finished. Check runs on merge queue commits are ignored.
The row appears once Inspect receives a check run from your app for the pull request, or once the pull request has an open finding from your app. With a webhook turned on, the row always appears, as **Not reviewed yet** until you report a status, so people can start a review.
## Report status with the API [#report-status-with-the-api]
Instead of a check run, the provider can send its review status to Inspect directly. Use this to show a failure reason, or when your review is not a check run. Findings still come from [inline comments](#report-findings-with-inline-comments).
### API key [#api-key]
Select **Create API key** for the provider in **Review providers** and give the key (`rip_…`) to the provider. Inspect shows it once, and it works only for this provider. **Rotate API key** replaces it and the old key stops working immediately.
```http
Authorization: Bearer rip_...
```
### Send a status [#send-a-status]
Send the full current state of your review of one commit, each time it changes.
```http
PUT /api/v2/review-providers/{provider}/repos/{owner}/{repo}/pulls/{number}/reviews/{sha}
Content-Type: application/json
{
"status": "completed",
"updated_at": "2026-10-22T14:03:11Z",
"message": "3 findings",
"summary_markdown": "Found one retry loop with no upper bound.",
"details_url": "https://acme.example/reviews/7781"
}
```
`{provider}` is your slug and `{sha}` is the full 40-character lowercase commit SHA you reviewed. Use the same host as the Inspect web app.
| Field | Type | Required | Description |
| ------------------ | ---------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `status` | `'queued' \| 'running' \| 'completed' \| 'failed' \| 'canceled'` | Yes | The review status. |
| `updated_at` | `string` | Yes | When you produced this state, RFC 3339 with at most millisecond precision. Inspect never applies an update older than the one it has. |
| `message` | `string` | No | One line, up to 200 characters, shown in the provider row. |
| `summary_markdown` | `string` | No | Markdown summary, up to 16 KB. |
| `details_url` | `string` | No | An https:// link to the review in your product, up to 2,048 characters. |
| `error_message` | `string` | No | Up to 2,000 characters. Shown in place of message when status is failed. |
Unknown fields are rejected. The response is `{"data": {"applied": true, "reason": null, "review": {...}}}`. If `updated_at` is older than the state Inspect has for that commit, Inspect keeps the newer state and returns `{"data": {"applied": false, "reason": "stale_update", "review": null}}`; do not retry it. An update with the same `updated_at` applies again, so retries are safe.
`GET` on the same URL returns your stored state. `GET .../pulls/{number}/reviews` returns your 50 most recently updated reviews of the pull request. Each review has `outdated: true` when its commit is no longer the pull request head.
### How Inspect shows it [#how-inspect-shows-it]
When you send an API status for the pull request head, it takes the place of any check run on the same head. An open pull request page updates as soon as Inspect stores it.
- `queued` shows Queued.
- `running` shows Reviewing.
- `completed` shows your finding counts, or No findings.
- `failed` or `canceled` shows Did not finish, with your `error_message` or `message`, and **Retry review** if you have a webhook.
- A status on a commit that is not the pull request head shows Outdated review.
The API status does not appear among checks and does not block merges. To gate merges, also post a check run.
### Errors [#errors]
Errors return `{"message": "...", "code": "..."}`. `invalid_payload` errors also include `issues`.
| Status | `code` | Meaning |
| ------ | --------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `400` | `invalid_payload` | The body does not match the schema. `issues` lists the fields. |
| `400` | `invalid_sha` | `{sha}` is not a full 40-character lowercase commit SHA. |
| `400` | `invalid_updated_at` | `updated_at` is not RFC 3339 with at most millisecond precision. |
| `401` | `invalid_key` | The key is missing, wrong, rotated, or for another provider, or review providers are off for the organization. |
| `403` | `repository_not_allowed` | The repository is not in the provider's **Repositories**. |
| `404` | `repository_not_registered` | Inspect does not know the repository. |
| `404` | `pull_request_not_found` | Inspect does not know the pull request. |
| `404` | `review_not_found` | `GET` only: you have not sent a status for this commit. |
Retry `5xx` responses with the same body.
## Report findings with inline comments [#report-findings-with-inline-comments]
Post each finding as an inline pull request review comment with a finding marker at the end of the body. GitHub supplies the file, line, and commit.
```markdown
The retry loop has no upper bound. A poisoned message blocks the queue.
```
| Field | Type | Required | Default | Description |
| -------------- | ------------------------------------------------------------ | -------- | --------------------------------------------------- | -------------------------------------------------- |
| `severity` | `'critical' \| 'warning' \| 'suggestion' \| 'informational'` | Yes | | How serious the finding is. |
| `auto_address` | `boolean` | No | true for critical and warning, false for the others | Whether Inspect may fix the finding automatically. |
| `category` | `string` | No | | Free text up to 64 characters, such as security. |
The Reviews menu counts your open findings on the pull request across all commits. The comment is the finding:
- Edit the comment to change its text or severity.
- If the issue persists on a new commit, keep the existing comment. A second comment for the same issue is counted twice.
- When the issue is fixed or no longer applies, resolve the thread or delete the comment, and Inspect stops counting it.
A thread that a person resolves counts as addressed too.
### Marker rules [#marker-rules]
- Use exactly one marker per comment. Markers inside fenced code blocks are ignored.
- The JSON must be one object of at most 4 KB.
- The JSON cannot contain `--`, which would end the HTML comment. Escape one hyphen as `\u002d` when a string needs two in a row.
- Unknown fields are ignored, and new optional fields can appear in `v1`. A breaking change will use a new marker name, such as `inspect-review:v2`.
- An invalid marker never breaks the pull request. Inspect shows the comment as an ordinary bot comment.
## Auto-fix [#auto-fix]
A pull request author turns on auto-fix in **Fix Pull Request review findings** in [Settings → Agent](https://app.inspect.com/settings/agent), for **Robot reviewers** or for your bot as a specific identity. For a registered provider's marked findings, Inspect then:
- Fixes `critical` and `warning` findings.
- Skips `suggestion` and `informational` findings, unless the marker sets `"auto_address": true`.
- Never fixes a finding whose marker sets `"auto_address": false`, even when the author allowed your bot by identity.
An **Ignore** rule for your bot still wins. Comments without a marker follow the author's setting for robot reviewers.
## Receive webhooks from Inspect [#receive-webhooks-from-inspect]
A provider with a webhook receives:
- `review.requested` when someone selects **Run review**, **Re-run review**, or **Retry review** in the provider row.
- `review.finding_feedback` when someone resolves one of the provider's marked finding comments with a reason.
### Set up the webhook [#set-up-the-webhook]
1. Enter the provider's **Webhook URL**. It must be HTTPS on a public host name; IP addresses and names like `localhost`, `*.local`, `*.internal`, or hosts without a dot are rejected.
2. Select **Create secret** and give the secret (`whsec_…`) to the provider. Inspect shows it once.
3. To change it, select **Rotate secret**. For 24 hours after a rotation, Inspect signs each webhook with both the old and new secret, so the provider can switch without missed deliveries.
**Run review** appears only when the webhook has a URL and a secret and is on.
### Delivery [#delivery]
Inspect sends a `POST` with a JSON body and these [Standard Webhooks](https://www.standardwebhooks.com/) headers:
| Field | Type | Description |
| ------------------- | -------- | --------------------------------------------------------------------------------------- |
| `webhook-id` | `string` | The delivery ID, the same on every retry of a delivery. Use it to drop duplicates. |
| `webhook-timestamp` | `string` | Unix seconds when Inspect signed the request. |
| `webhook-signature` | `string` | v1,\. During a secret rotation, two signatures separated by a space. |
Every body has `type`, `schema_version` (currently `1`), `delivery_id` (equal to `webhook-id`), `occurred_at`, and `organization.id`, the ID of the Inspect organization that sent it.
### Verify the signature [#verify-the-signature]
The signed content is `{webhook-id}.{webhook-timestamp}.{raw body}`. The HMAC-SHA256 key is the base64-decoded part of the secret after `whsec_`. Sign the raw request body, never re-serialized JSON, and reject timestamps more than 5 minutes old.
```python
import base64, hashlib, hmac, time
def verify(secret: str, headers: dict, body: bytes) -> None:
msg_id = headers["webhook-id"]
ts = headers["webhook-timestamp"]
if abs(time.time() - int(ts)) > 300:
raise ValueError("stale timestamp")
key = base64.b64decode(secret.removeprefix("whsec_"))
signed = f"{msg_id}.{ts}.".encode() + body
expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()
for candidate in headers["webhook-signature"].split():
version, _, sig = candidate.partition(",")
if version == "v1" and hmac.compare_digest(sig, expected):
return
raise ValueError("bad signature")
```
### `review.requested` [#reviewrequested]
```json
{
"type": "review.requested",
"schema_version": 1,
"delivery_id": "dlv_V1StGXR8Z5jdHi6BmyT",
"occurred_at": "2026-10-22T14:03:05.000Z",
"organization": { "id": "3f6c2a8e-9b1d-4e7a-8c5f-2d0b9e4a7c13" },
"trigger": "inspect_ui",
"actor": { "github_login": "jdoe" },
"repository": { "github_id": 5521, "full_name": "acme/api" },
"pull_request": { "number": 812, "base_ref": "main", "draft": false },
"sha": "9c1e5d0b7a2f4e1c8d3b6a5f0e9d8c7b6a5f4e3d"
}
```
`sha` is the pull request's head when the person made the request. Review that commit and report it. `trigger` is always `inspect_ui`. Two requests for the same pull request and `sha` ask for the same review, so you can ignore the second while the first runs.
### `review.finding_feedback` [#reviewfinding_feedback]
```json
{
"type": "review.finding_feedback",
"schema_version": 1,
"delivery_id": "dlv_8c1rWq0Yb4KpN2sTz7a",
"occurred_at": "2026-10-22T14:09:41.000Z",
"organization": { "id": "3f6c2a8e-9b1d-4e7a-8c5f-2d0b9e4a7c13" },
"github_comment_id": 1987654321,
"comment_url": "https://github.com/acme/api/pull/812#discussion_r1987654321",
"reason": "incorrect",
"note": null,
"actor": { "github_login": "jdoe" },
"repository": { "full_name": "acme/api" },
"pull_request": { "number": 812 }
}
```
Inspect sends this only for a comment your bot wrote with a valid finding marker. `note` is free text up to 2,000 characters, or `null`.
`reason` is one of these, shown in Inspect as the label after it:
- `addressed`: Fixed it
- `incorrect`: Incorrect
- `not_relevant`: Not relevant
- `noise`: Too minor
- `wont_fix`: Won't fix
- `stale`: Outdated
### Responses and retries [#responses-and-retries]
- `2xx`: Inspect records the delivery as done.
- `408`, `429`, `5xx`, no answer in 10 seconds, or a connection error: Inspect retries with exponential backoff, starting at 1 minute and capped at 1 hour, for up to 24 hours.
- `410`: Inspect stops and turns off the webhook. Saving the provider's webhook URL turns it on again.
- Any other status, including a redirect: Inspect stops. It does not follow redirects.
Delivery is at least once and can arrive out of order. When a delivery stops, the provider's entry in **Review providers** shows the last failure and its HTTP status.
## Launch checklist [#launch-checklist]
- The organization has your GitHub App ID and slug, and the app has `checks: write` and `pull_requests: write`.
- You post one check run per reviewed commit and complete it with `cancelled` or `timed_out` when the review fails, or you send every status change to the status API with a new `updated_at`.
- Each finding comment ends with a marker, is edited in place on later commits, and has its thread resolved once fixed.
- If organizations want a merge gate, your check run has a stable name they can require in branch protection.
- If you have a webhook, you verify the signature on the raw body and drop duplicates by `webhook-id`.
# Verification agent (/code-review/verification-agent)
Verification agent checks that a pull request from an Inspect session does what it claims. It runs as a subagent in the session's sandbox, starts your app locally from the pull request's pushed commit, exercises each changed UI or backend behavior, and captures screenshots, recordings, or API responses as evidence. It publishes the result as a comment on the pull request and in the session's Slack thread. Inspect keeps one verification comment per pull request and updates it on each run.
Verification agent runs your repository's local development stack. It does not test against production.
## Set up a repository [#set-up-a-repository]
Verification agent runs only in repositories that have `.inspect/verification/config.yml`. To create it, ask Inspect to "set up the Verification agent for this repo", or run the `/setup-verification-agent` skill. Inspect writes the config and a repository skill that explains how to start the app, sign in, seed data, and capture evidence, tests them, and opens a pull request.
```yaml
skill: .agents/skills/verify-web/SKILL.md
paths:
- 'src/**'
model: auto
instructions: Cover empty and error states for changed screens.
```
| Field | Type | Required | Default | Description |
| -------------- | ---------- | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `skill` | `string` | Yes | | Repository-relative path to the SKILL.md Verification agent follows. It cannot start with '/' or contain '..'. |
| `paths` | `string[]` | No | | Globs that limit automatic runs to pushes that change a matching file. A pattern also matches files under a matching directory. Without paths, every push starts a run. |
| `model` | `string` | No | `auto` | Model ID to run on. auto, the default, uses the session's model. |
| `instructions` | `string` | No | | What to verify and how thoroughly. |
Inspect reads the config from the pull request's head commit, so a pull request that adds or fixes it is verified with its own version. The `model` is the exception: Inspect fixes it when the session is created, from the config on the default branch. If the session owner cannot use that model, Verification agent runs on the session's model instead.
## When it runs [#when-it-runs]
Verification agent runs automatically when a session opens a pull request and after every later push to it, including pushes made outside Inspect. A transcript row marks each request. A push skips automatic verification when:
- The session owner turned off **Run Verification agent on Pull Requests** in [Settings → Agent](https://app.inspect.com/settings/agent). It is on by default.
- No one has used the session in the last 7 days (sent a message, opened it, or created it). Each run resumes the sandbox at the owner's expense.
- The config is missing or invalid, or `paths` matches no changed file.
- The session is read-only.
- A newer push has already arrived. A newer push supersedes evidence from older commits and starts its own run.
When a run reports `issues_found`, the session's agent is asked to fix the failed claims, and the next push is verified again. After 3 such fix attempts since the last `pass`, Verification agent stops asking for fixes and the agent tells you verification is still failing.
## Run it manually [#run-it-manually]
In a session with a pull request, open **Reviews** in the Changes bar and select **Verification agent**. Use **Verify again** for a fresh run or **Retry verification** after an error. Manual runs work even when the setting is off or the session is inactive. If a run is already in progress for the current head, Inspect reuses it.
The agent verifies one exact pushed commit, so avoid changing files in the workspace while it runs.
### From the API [#from-the-api]
Send `POST /api/v2/sessions/{session_id}/verification` with an [API key](/api/api-keys). The optional JSON body `{"repository": "owner/name"}` is required only when the session has pull requests in more than one repository. The key's user must own the session or have created it through the API.
- `202`: `status` is `started` or `already_running`.
- `409`: `code` is one of the values below.
| `code` is one of the values below. |
| `code` | Meaning |
| ---------------------------------------- | --------------------------------------------------------------------------------- |
| `verification_no_pull_request` | The session has no pull request to verify. |
| `verification_not_configured` | The pull request's head has no `.inspect/verification/config.yml`. |
| `verification_readonly` | The session is read-only. |
| `verification_no_runtime` | The session's runtime has not started yet. |
| `verification_session_predates_verifier` | The session started before Verification agent was available. Start a new session. |
## Results [#results]
Each result has one verdict, and each claim it checked has one status. The value is what Verification agent writes to its `result.json`; the label is what the pull request comment shows.
| Type | Value | Label | Meaning |
| ------------ | -------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Verdict | `pass` | Passed | At least one claim was verified and none failed. Skipped claims do not change this. |
| Verdict | `issues_found` | Issues found | At least one claim failed. |
| Verdict | `skipped` | Skipped | No claim failed, but none could be verified. |
| Verdict | `infra_error` | Could not run | The app or local environment could not be brought up. |
| Claim status | `verified` | Verified | The behavior was exercised and matched the claim. |
| Claim status | `failed` | Failed | The behavior was exercised and did not match. |
| Claim status | `skipped` | Skipped | The behavior could not be reached locally, for example because it needs real third-party credentials. The claim states what was tried. |
Verification agent creates missing local data before it gives up on a claim. A result can include a **Not verified** list of what was skipped. Changes with no observable behavior, such as docs, tests, or CI configuration, produce no result.
# Connectors (/connectors)
Connectors give Inspect tools from services such as Linear, Datadog, and Figma. Inspect can search their data and take actions through the connected account. You can use a built-in connector or add a remote Model Context Protocol (MCP) server.
Configure them in [Customize → Connectors](https://app.inspect.com/customize/connectors). For credential handling and the boundary between Inspect and the service, see [connector security](/security/connectors).
## Accounts and permissions [#accounts-and-permissions]
Account credentials, connector availability, and session privacy are separate settings. A personal account does not make its results private unless the connector's privacy settings require it.
- **Organization**: one shared account supplies credentials for the organization.
- **Personal**: everyone can find the connector, but each person connects their own account.
- **Only me**: only the creator can see and connect the custom connector. It uses personal credentials.
You can add an **Only me** custom connector and manage your own connection without an organization-management role. Sharing a custom connector with the organization, changing shared credentials, or managing a built-in connector's organization settings requires the **Edit connectors** role or **Admin**. See [users and roles](/security/users-and-roles).
Where enabled, **Shared account, or each person’s own once they connect it** lets an organization connector use personal accounts too. Once you connect yours, Inspect uses it for every call, including reads. Until then, it uses the shared account. The service account's permissions determine what a call can do; this setting does not split reads and writes between accounts.
For a shared Linear account, see [Linear service user setup](/integrations/linear).
### Restrict who can use a connector [#restrict-who-can-use-a-connector]
Connector managers can limit a built-in or organization-managed connector to selected people or custom agents. Owners manage access to their own **Only me** connectors.
In a session, the acting user, session owner, and every active participant must be allowed to use a restricted connector. A session running an allowed custom agent also qualifies. A connector can therefore be connected and still be unavailable in a particular session.
## Session privacy [#session-privacy]
New custom connectors default to **Never** making sessions private. A connector configured with **Any tool makes sessions private** changes a single-user session to private before Inspect calls the service. Inspect blocks that connector in multiplayer sessions. Connecting the account alone does not change session visibility.
Where enabled, **Selected tools make sessions private** applies that behavior to specific tools instead of the whole connector. Custom privacy rules can also require privacy based on call arguments or results. If a result triggers privacy in a multiplayer session, Inspect withholds the result. A rule that fails to evaluate counts as private.
Privacy controls govern [session visibility](/sessions); they do not limit the connected account's permissions at the provider.
## Built-in connectors [#built-in-connectors]
The built-in catalog includes:
- AWS, Atlassian, Braintrust, Buildkite, Cloudflare, Datadog, Figma, GitHub, Gong, and Granola.
- Hex, Honeycomb, Incident.io, Intercom, Langfuse, LangSmith, LaunchDarkly, Linear, and LogRocket.
- Neon, Netlify, Notion, PagerDuty, Paper, PlanetScale, Polylane, PostHog, and Railway.
- Ramp, Rootly, Sentry, Stripe, Supabase, Supercut, Vercel, and Webflow.
The hosted GitHub MCP connector requires GitHub.com and is unavailable for GitHub Enterprise Server organizations.
## Add a custom MCP server [#add-a-custom-mcp-server]
Inspect supports remote HTTPS servers. Local commands and stdio servers are not supported. The server URL cannot contain embedded credentials or path traversal segments.
1. Open [Customize → Connectors](https://app.inspect.com/customize/connectors) and choose **Add connector**.
2. Enter **Name** and **Server URL**. If you manage organization connectors, choose **Available to**: **Organization**, **Personal**, or **Only me**.
3. Choose **Authentication**. Use **OAuth**, enter a **Bearer token**, or choose **None**. Add header names and secret values if the server requires them.
4. Configure when use makes sessions private, then choose **Add connector**. For OAuth, finish authorization with the provider.
[Inspect OIDC](/connectors/inspect-oidc) is another authentication option for organizations where it is enabled. It requires organization credentials.
### Custom MCP JSON [#custom-mcp-json]
Use **Edit MCP JSON** in a custom connector's configuration for OAuth client options and header placeholders. Each definition accepts exactly one server:
```json
{
"mcpServers": {
"company-tools": {
"url": "https://mcp.example.com/mcp",
"headers": {
"Authorization": "Bearer {{API_KEY}}"
}
}
}
}
```
Enter the value for `API_KEY` as a secret, not as a literal in the definition. Inspect substitutes `{{NAME}}` placeholders in header values. Secret names can contain letters, numbers, underscores, dots, and hyphens, and must start with a letter or number. Shared header secrets on connectors available to the organization supply the same value for everyone who connects; other custom-header secrets belong to each person's connection. OAuth header secrets belong to the connector.
| Field | Type | Default | Description |
| --------------------------- | ------------------------------------ | ------- | ------------------------------------------------------------------------------------------------- |
| `mcpServers` | `object` | | Object containing one named server. mcp and servers are accepted alternatives. |
| Server name | `string` | | 1–200 characters. |
| `url` | `string` | | Remote HTTPS URL. |
| `headers` | `object` | | Object of header names and string values. Use \{\{NAME\}\} for secrets. |
| `auth` | `'oauth' \| 'inspect_oidc' \| false` | | Omit it for secret-header or unauthenticated connections. |
| `oauth` | `object \| false` | | OAuth configuration object, or false. Setting auth to "oauth" enables OAuth with default options. |
| `oauth.grantType` | `'authorization_code'` | | "authorization_code" only. Client-credentials flows are not supported in custom MCP JSON. |
| `oauth.clientId` | `string` | | A registered OAuth client. Without a client ID, Inspect uses dynamic client registration. |
| `oauth.clientSecret` | `string` | | Secret for the registered OAuth client. A secret requires a client ID. |
| `oauth.scope` | `string` | | Space-separated scopes. |
| `oauth.authorizationParams` | `object` | | Object of additional authorization parameters with string values. |
| `oauth.redirectUri` | `string` | | HTTPS callback URL, or HTTP on localhost or 127.0.0.1. |
| `oauth.clientName` | `string` | Inspect | Metadata used for dynamic client registration. |
| `oauth.clientUri` | `string` | | Metadata used for dynamic client registration. |
| `oauth.logoUri` | `string` | | Metadata used for dynamic client registration. |
For example, a server without dynamic client registration can use a registered client:
```json
{
"mcpServers": {
"company-tools": {
"url": "https://mcp.example.com/mcp",
"auth": "oauth",
"oauth": {
"clientId": "inspect-client",
"scope": "issues:read issues:write"
}
}
}
}
```
## Use connectors in a session [#use-connectors-in-a-session]
Ask for the task and name the service or account when it matters. Inspect searches the available connector tools, reads a tool's input schema, and calls it with your task's arguments. When the same service has multiple connections, Inspect selects the connection separately from the tool name.
If authorization is missing, Inspect can request a connection in the conversation. You must finish the connection flow; an agent's request does not grant authorization. Connector calls use the permissions of the account selected for that call, so grant the service account only the access you intend Inspect to use.
## Troubleshooting [#troubleshooting]
Inspect refreshes OAuth tokens when possible. If refresh fails or no refresh token is available, use
**Reconnect** and complete authorization again. For a shared account, a connector manager must
reconnect it.
Start authorization again. Pending OAuth sessions expire after 10 minutes.
Check that the MCP server exposes protected-resource and authorization-server metadata with
authorization and token endpoints.
Configure `oauth.clientId` for a registered client instead of relying on dynamic registration.
Check the provider's response, registered client credentials, and callback URL, then reconnect.
Split the JSON into separate connectors.
Enter a nonempty secret for every `{{ NAME }}` used in the definition.
Start a single-user session for private connector data. Do not change the privacy setting to bypass a
restriction.
Ask a connector manager to check allowed people and agents, or use a session whose participants are
allowed.
Check its provider permissions. If personal accounts are enabled, connect your own account and retry.
# Inspect OIDC connectors (/connectors/inspect-oidc)
An Inspect OIDC connector sends a short-lived token, signed by Inspect, with every request to your MCP server. Your server verifies the signature and claims instead of trusting a shared secret. It can identify the Inspect user and associate calls with sessions or automation runs.
Inspect OIDC must be enabled for your organization. If it is unavailable, **Inspect OIDC** is absent from the authentication options; a custom JSON definition cannot bypass that restriction.
## Add the connector [#add-the-connector]
You need the **Edit connectors** role or **Admin**. See [users and roles](/security/users-and-roles).
1. Open [Customize → Connectors](https://app.inspect.com/customize/connectors) and choose **Add connector**.
2. Enter the HTTPS server URL and set **Authentication** to **Inspect OIDC**.
3. Add the connector, then use **View token verification details** to get the issuer, audience, and JWKS URL for your server.
Inspect OIDC connectors require organization credentials. They have one shared connection with no secret to enter, but each request's token identifies the Inspect user responsible for that call.
In [custom MCP JSON](/connectors#custom-mcp-json), set `"auth": "inspect_oidc"`. It cannot be combined with OAuth or secret-header placeholders.
## What Inspect sends [#what-inspect-sends]
Every request carries `Authorization: Bearer `. Tokens are RS256-signed JWTs that expire after five minutes. Inspect sends them only to the origin of the configured server URL and does not follow redirects with a token attached.
The connector must remain enabled and connected. Inspect checks those conditions and feature availability before minting a request token. Normal [connector access and privacy rules](/connectors#session-privacy) still apply.
## Verify the token [#verify-the-token]
Accept a request only when all of these hold:
1. The signature uses RS256 and validates against a key from Inspect's JWKS. Use the JWKS URL from the connector's verification details, for example:
```text
https://app.inspect.com/api/oidc/jwks
```
OIDC discovery is available at the issuer's `/.well-known/openid-configuration` path, for example `https://app.inspect.com/api/oidc/.well-known/openid-configuration`.
2. `iss` equals the issuer from the verification details, for example `https://app.inspect.com/api/oidc`. Use the supplied value rather than deriving it from the URL you use to open Inspect.
3. `aud` equals the audience from the verification details:
```text
inspect-connector::
```
Inspect URL-encodes the organization ID in this value. The audience includes the server's scheme, hostname, and port when present, but not its path. Connectors for the same organization and origin share an audience, so check `connector_id` too if your server needs to distinguish them.
The organization component prevents another organization's tokens from matching. [Sandbox workload identities](/security/workload-identity) cannot use the reserved `inspect-connector:` audience prefix.
4. `exp` is in the future. Configure only the clock skew your deployment needs.
Most JWT libraries check the signature, `iss`, `aud`, and `exp` when you configure the issuer, audience, and JWKS URL. Inspect publishes discovery and JWKS responses with a five-minute public cache lifetime. Configure your verifier to refresh keys when it encounters an unfamiliar `kid`.
## What the claims mean [#what-the-claims-mean]
| Claim | Meaning |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sub` | `org::user:`, with both IDs URL-encoded. Identifies the session owner, or the user making a request outside a session. |
| `email` | The subject user's email address in Inspect. |
| `org` | The organization ID. |
| `act` | `{ "email": ... }`: the person responsible for the request, when Inspect can determine one. Omitted otherwise. |
| `sid` | The session whose transcript led to the request. Calls from native subagents identify their host session. Omitted for requests outside a session. |
| `aid`, `arid` | Automation ID and automation run ID, when the session belongs to an automation run. |
| `connector_id` | The connector that sent the request. |
| `ver` | Claims format version, currently `1`. |
| `iat`, `exp`, `jti` | Issue time, expiry, and a unique token ID. |
## What to trust [#what-to-trust]
- Identify the Inspect user by `sub`. It scopes the user ID to the organization.
- Use `email` for display or account lookup, not as your permanent identity key. Tokens carry no `email_verified` claim.
- Treat `act` as audit context. For an agent call, it can identify the person whose prompt led to the call. Automated prompts can attribute the call to the automation's owner. Authorize on `sub` and record `act` alongside it.
- Check `ver` before relying on the claims format.
- A signed token can be presented more than once before it expires. Reject reused `jti` values if your server requires replay prevention.
For the broader trust model, see [connector security](/security/connectors).
## Troubleshooting [#troubleshooting]
Inspect OIDC is missing, or creation returns Invalid auth type
>
}
>
The feature must be enabled for your organization, and configuring it requires connector-management
permission.
Use an organization connection, not personal credentials.
The request target must share the configured server URL's origin. Redirects cannot move an
authenticated request to another origin.
Compare against the exact audience in verification details. A URL path is not part of the audience.
Refresh the JWKS and select the key named by the token's `kid`.
Verification metadata returns OIDC keys are unavailable
>
}
>
The JWKS endpoint is unavailable. Retry rather than accepting an unverified token.
# Demos (/demos)
# Inspect (/)
Inspect is a coding agent that works inside your organization's repositories and tools. You hand it a task, it does the work in its own sandbox, and you get back a pull request, an answer, or an artifact to review.
## How it works [#how-it-works]
1. You send a request from the web app, Slack, Linear, GitHub, email, the [API](/api), or an MCP client through [Inspect MCP](/api/mcp).
2. Inspect starts a [session](/sessions): a conversation attached to an isolated sandbox. When the task names a repository, the sandbox has that repository checked out and built from its [build configuration](/sessions/repositories/build).
3. The agent reads code, runs commands and tests, drives a [browser](/sessions/browser), and calls the services your organization has connected through [connectors](/connectors). Credentials for those services stay outside the sandbox where possible; see [Security](/security).
4. When the work changes code, Inspect pushes a branch and opens a pull request under your GitHub account. Without a linked GitHub account, your sessions are read-only.
5. The [Review agent](/code-review/review-agent) reviews the pull request, and Inspect can address review comments and CI failures in the same session. You decide what merges.
You can reply in the session at any point to steer it, and teammates can join it. Sessions are visible to your organization unless one is made private.
## Where to go next [#where-to-go-next]
# Email (/integrations/email)
Email [inspect@inspect.com](mailto:inspect@inspect.com) to start a session, then reply in the same email thread to continue it. Inspect sends an acknowledgment with a session link for new sessions and emails its response to the request. You can include attachments or bring Inspect into an existing conversation.
## Enable email [#enable-email]
An **Admin** or someone with **Manage integrations** permission can turn email on or off in [Settings → Integrations](https://app.inspect.com/settings/integrations). Select **Enable** for **Email**.
When email is disabled, Inspect does not act on incoming messages.
## Who can send requests [#who-can-send-requests]
Send from the email address on your active Inspect account. That address must be verified, and the message must pass the authentication checks below. Unknown or deactivated senders cannot start sessions. Each accepted request uses its sender's Inspect access.
If your account exists but its email is unverified, Inspect can send you a verification reminder instead of starting a session. Open **Settings → Profile → Email**, select **Verify**, and send the request again after verification. Inspect limits this reminder to one per member per 24 hours and sends it only to the sender.
## Start and continue a session [#start-and-continue-a-session]
For a new email, the subject and new message text become the request. Inspect selects a repository from the email content. The acknowledgment links to the [session](/sessions), where you can follow the work and review changes.
Reply to answer a question, change the request, or ask for another pass. Inspect uses the email's reply headers to find the session; keeping the same subject alone does not establish a continuation. Only your new text becomes the follow-up prompt. Quoted messages are reference context.
### Conversations with other people [#conversations-with-other-people]
Include `inspect@inspect.com` in **To** or **Cc**. For replies that include other people, write `@inspect` in your new text when you want Inspect to act. Without that mention, Inspect ignores the reply so the human conversation can continue.
Another teammate can send a request to the same thread's session using their own Inspect access. If they cannot join it because of private-session access or code-writing permissions, Inspect starts a separate session for them.
Inspect replies to the sender. It copies other thread participants only when their email domains match the organization's domain or the additional domains allowed by its [sign-in policy](/security/sign-in). Other participants are removed from Cc. A reply has at most 50 recipients, including the sender.
## Attachments and limits [#attachments-and-limits]
Attachments and inline images can reach the session. Inspect filters images identified as unrelated signature or footer decoration, such as tracking pixels and social icons. Images that could matter to the request are kept; other attachment types are not discarded by this filter.
- The entire incoming email can be up to 10 MiB, including encoded attachments.
- Decoded attachments are limited to 100 files, up to 10 MiB combined.
- New message text is truncated to 20,000 characters.
- Quoted thread history is truncated to 20,000 characters.
An email containing only attachments can still start work. Put the request in the message when the files alone do not explain what you need.
## Authentication and safety [#authentication-and-safety]
Inspect checks messages before acting on them:
- The sender's domain must pass DMARC. A verified, sender-aligned DKIM signature must cover the **To** or **Cc** header containing Inspect's address.
- Inspect must appear in **To** or **Cc**. Bcc delivery does not meet this requirement.
- Auto-replies, mailing-list messages, and bulk mail are ignored to prevent reply loops.
- Quoted history is passed as untrusted reference material with instructions not to follow directions inside it.
- Duplicate message deliveries do not create duplicate requests.
Authentication failures and rejected automated mail do not receive a bounce or reply from Inspect. Account-verification reminders are separate from those failures.
Because email requests use the sender's Inspect access, protect mailbox access as you would any other sign-in method. Deactivated Inspect accounts cannot send requests.
## Troubleshooting [#troubleshooting]
If Inspect does not respond:
- Confirm email is enabled in [Settings → Integrations](https://app.inspect.com/settings/integrations).
- Send from your Inspect account's verified email address. If you received a verification reminder, verify the address and resend the request.
- Address Inspect in **To** or **Cc**, rather than Bcc.
- In a reply with other people, include `@inspect` in your new text, not only in the quoted history.
- Keep the whole email within 10 MiB and use no more than 100 attachments.
- Ask your mail administrator to check DMARC and DKIM, including whether the signature covers the recipient header.
If a participant does not receive Inspect's reply, check whether their domain is allowed by the organization's sign-in policy. External participants can remain on the human conversation without receiving Inspect's output.
# GitHub (/integrations/github)
GitHub is how Inspect reads your code and ships changes. The organization installs the Inspect GitHub App once per GitHub organization; each person then links their own GitHub account so Inspect can push branches and open pull requests as them.
## Requirements [#requirements]
- Installing or disconnecting the GitHub App in Inspect needs the **Manage integrations** role.
- Installing the App on a GitHub organization needs an owner of that organization. Anyone else can request the installation, and an owner approves it on GitHub.
- Adding the App's repositories to Inspect is a separate step. See [Repositories](/sessions/repositories).
## Install the GitHub App [#install-the-github-app]
1. Open [Settings → Integrations](https://app.inspect.com/settings/integrations) and choose **GitHub**.
2. Choose **Install GitHub App**. On GitHub, pick the organization and the repositories the App can access.
3. Back in Inspect, a **GitHub App installed** notice confirms the connection. If you aren't an owner, you see **Installation requested** until an owner approves it on GitHub.
4. Add the repositories you want sessions to work in under [Repositories](/sessions/repositories).
To add another GitHub organization, choose **Install on another organization** and repeat. If the App is already installed on an organization, for example after an owner approved your request, Inspect lists it as **ready to connect**; choose **Connect**.
Inspect only connects installations that your own GitHub account can see, and each GitHub organization can be connected to one Inspect organization.
### Repository access [#repository-access]
The App's repository access on GitHub sets the outer limit of what Inspect can reach. If a repository is missing or adding it fails, grant it in the installation's repository access on GitHub. **Manage on GitHub** opens that page for each connected organization.
**Disconnect** removes an organization from Inspect. Sessions can't use its repositories until you connect it again.
### GitHub Enterprise Server [#github-enterprise-server]
On Inspect deployments that support GitHub Enterprise Server, an admin creates a dedicated GitHub App for your server with **Create GitHub App**, entering the **GitHub Enterprise Server URL** and the GitHub **Organization** that will own the App. Creating the App disconnects members' GitHub accounts, so each member links their account on the server afterward. Then install the App as above.
## Link your GitHub account [#link-your-github-account]
Each person links their GitHub account in [Settings → Profile](https://app.inspect.com/settings/profile). Without a linked account, Inspect is read-only for you: it can read code and suggest changes, but it can't push, open pull requests, or run automations on your behalf.
If your GitHub authorization expires or is revoked, Inspect reports `GitHub access expired. Reconnect so Inspect can open and update pull requests as you.` Reconnect from the same page.
## What Inspect does on GitHub, and as whom [#what-inspect-does-on-github-and-as-whom]
- Commits in a session are made as the session owner. Commits use the owner's GitHub name and their `+@users.noreply.github.com` address, so GitHub attributes them even when your Inspect email isn't on your GitHub account.
- Pushing branches and opening and updating pull requests use the session owner's linked GitHub account. Pull requests go through review like anyone else's.
- Comments, replies, and reactions Inspect posts on pull requests come from the Inspect GitHub App.
### Commit signing [#commit-signing]
Turn on **Commit signing** under [Settings → Integrations](https://app.inspect.com/settings/integrations) → **GitHub** to have GitHub sign every commit Inspect pushes, so GitHub shows them as **Verified**. With it on, Inspect recreates each branch push through the GitHub API so GitHub signs it, whether or not the repository requires signed commits. Tag pushes and branch deletions are pushed normally. It is off by default and needs the **Manage integrations** role.
## Mention @inspect on a pull request [#mention-inspect-on-a-pull-request]
Write `@inspect` followed by a request in a pull request comment, a review, or an inline review comment. Inspect works on the pull request's code and replies on GitHub.
- Inspect reacts with 👀 and posts a `One moment. ⏳` placeholder while it works. When the turn ends, the 👀 becomes 👍 if Inspect replied on GitHub, or 😕 if it didn't.
- A review that mentions `@inspect` in several comments gets one reply in each thread.
- Mentions inside code blocks or inline code are ignored. Mentions on issues that aren't pull requests are ignored.
- The person who writes the mention must have linked their GitHub account to Inspect. The work runs with their Inspect access.
- If you already have an open session for the pull request, the mention continues it. When the pull request's author writes the mention, Inspect continues the author's session. Otherwise it starts a new session for you.
- Comments from Inspect itself never trigger it. A bot's mention is only handled when the pull request's author has a linked account.
After 20 GitHub mentions in one session, Inspect pauses them and shows **GitHub @inspect messages paused** in the session. Choose **Re-enable GitHub messages** to accept more.
For automatic responses to review comments and failing checks, see [Code review](/code-review). For automations that start from pushes, pull requests, and checks, see [GitHub automations](/automations/github).
## Troubleshooting [#troubleshooting]
Ask someone with the **Manage integrations** role to install or connect the App.
Link a GitHub account in [Settings → Profile](https://app.inspect.com/settings/profile) that is a
member of that GitHub organization.
A GitHub organization can belong to one Inspect organization. Disconnect it there first.
The App was uninstalled or suspended on GitHub. Reinstall it, then choose **Reconnect**.
The App doesn't have access to that repository. Grant it under the installation's repository access
on GitHub.
Reconnect GitHub in [Settings → Profile](https://app.inspect.com/settings/profile), then retry.
@inspect gets no response
>
}
>
Link your GitHub account, write the mention outside code formatting, and check the session isn't
paused for GitHub mentions.
# Integrations (/integrations)
Organization integrations live in [Settings → Integrations](https://app.inspect.com/settings/integrations) and need the **Manage integrations** role or **Admin**. Most also ask each person to link their own account, so Inspect knows who made a request and acts with that person's access.
}
title='GitHub'
href='/integrations/github'
description='Open pull requests and respond to @inspect mentions.'
/>
}
title='Slack'
href='/integrations/slack'
description='Start and continue sessions from Slack.'
/>
}
title='Linear'
href='/integrations/linear'
description='Delegate Linear issues to Inspect.'
/>
}
title='Email'
href='/integrations/email'
description='Start sessions by emailing Inspect.'
/>
}
title='Sentry'
href='/automations/sentry'
description='Trigger automations from Sentry alerts.'
/>
}
title='Trunk'
description='Submit pull requests to the Trunk merge queue.'
/>
# Linear (/integrations/linear)
Delegate a Linear issue to Inspect, or mention Inspect in an issue comment, to start a session from that issue. Inspect uses the issue context to choose a repository and returns its response to the Linear agent conversation. Follow-up requests in that conversation continue the linked Inspect session.
## Connect the Linear app [#connect-the-linear-app]
An **Admin** or someone with **Manage integrations** permission can connect the app for your Inspect organization.
1. Open [Settings → Integrations → Linear](https://app.inspect.com/settings/integrations/linear) and select **Connect Linear**.
2. Authorize Inspect in the Linear workspace you want to connect.
3. Link your own Linear identity in [Settings → Profile](https://app.inspect.com/settings/profile), or follow Inspect's **Link your Inspect account to continue.** prompt in Linear.
The app requests permission to read and write Linear data, receive mentions, and accept issue assignments. You can connect more than one Linear workspace using **Connect another workspace**. A Linear workspace cannot be connected to two Inspect organizations at once.
Installing the workspace app and linking your identity are separate steps. Inspect uses the linked account to identify who made each request and apply that person's Inspect access. Deactivated Inspect users cannot submit requests through the app.
## Delegate an issue or mention Inspect [#delegate-an-issue-or-mention-inspect]
Assign or delegate an issue to Inspect in Linear to start work from its context. You can also mention Inspect in an issue comment with a specific request. The comment becomes the opening prompt; if there is no comment, Inspect creates a request to review the assigned issue.
Inspect uses the issue title, description, team, and available Linear context when choosing a repository. It adds a link to the Inspect session to the Linear agent session so you can follow the work in either place.
When work begins on an issue delegated to Inspect, Inspect attempts to move it from triage, backlog, or an unstarted state to the team's first started state. It leaves issues already in another state alone. A mention on an issue that is not delegated to Inspect does not cause this status change.
## Continue the conversation [#continue-the-conversation]
Send follow-ups through the same Linear agent conversation to continue its Inspect session. Inspect posts its response back to Linear. Linear's stop signal also stops a running or pending Inspect session.
Teammates must link their own accounts before contributing. Inspect checks access to the existing session and repository for each follow-up; being able to comment on the Linear issue does not bypass those checks.
Each Linear agent conversation maps to one Inspect session. A separate agent conversation on the same issue gets its own session.
## Linear service user [#linear-service-user]
The Linear app above starts sessions from issues. The [Linear connector](/connectors) serves a different purpose: it lets Inspect sessions find, create, and update Linear issues and planning data through tools.
For a shared organization connector, use a dedicated Linear service user and create the Linear API key while signed in as that user. Everyone using the shared connection acts as the credential's owner, so choose the account and its access before connecting it. A personal Linear connector uses OAuth instead.
The service user is the shared connector's identity. It does not replace each teammate's account link for requests sent through the Linear app.
## Troubleshooting [#troubleshooting]
Follow the link, sign in to Inspect, and link the Linear account that made the request. Successful
linking resumes the pending request.
Reconnect the workspace from Linear integration settings. Older installations need a new
authorization grant with assignment permission.
Submit the request from your account, rather than an automation or another agent user.
Ask for the required Inspect access or start work in a session and repository you can use. Linear
issue access alone is insufficient.
Contact support to resolve the existing connection before installing it in this organization.
Contact support before replacing the connection.
Run **Connect Linear** again and complete authorization.
Restart authorization from the integration settings.
Disconnecting the app in Inspect can report that Linear did not confirm removal. If you see **Remove the Inspect app in your Linear workspace settings**, remove it there to finish disconnecting.
# Slack (/integrations/slack)
Mention Inspect in a Slack conversation to turn a request into a session. Inspect uses the message and available conversation context, then posts replies to the thread. You can open the linked session in Inspect to review the work or continue there.
## Connect your workspace and account [#connect-your-workspace-and-account]
An **Admin** or someone with **Manage integrations** permission can install the Slack app for your Inspect organization.
1. Open [Settings → Integrations → Slack](https://app.inspect.com/settings/integrations/slack) and select **Install Slack app**.
2. Approve the installation in Slack.
3. Invite Inspect to the channels where you want to use it. Invite it to private channels before requesting work there.
4. Link your own Slack account in [Settings → Profile](https://app.inspect.com/settings/profile), or use **Link Slack account** when Inspect prompts you in Slack.
Installing the app connects the workspace. Linking your account tells Inspect which user made a request. Without that link, Inspect asks you to connect your account instead of starting work. Completing the link can resume the request that prompted it.
Slack requests use your Inspect access. A linked Slack account does not replace a [GitHub connection](/integrations/github): you need GitHub linked to contribute to a session that can write code.
## Finish setup: playground channel and emoji [#finish-setup-playground-channel-and-emoji]
After the install, the Slack integration settings show two remaining steps for people with **Manage integrations**:
- A playground channel where teammates try Inspect. Inspect creates it on the first install. If it doesn't exist, create it from the settings with the suggested name or your own. Members open it from the same settings to complete their "Try Inspect in Slack" task.
- Inspect's emoji. Download the emoji pack from the settings and add each image in Slack's [custom emoji settings](https://slack.com/customize/emoji). Inspect reacts with them to show status, and people react with `:inspect-this:` to start work.
- `:inspect-this:`: react to start a session.
- `:inspect-thinking:`: Inspect is working.
- `:inspect-done:`: Inspect finished.
- `:inspect-merged:`: the pull request merged.
- `:inspect-closed:`: the pull request closed.
Inspect checks which emoji are in your workspace and marks the missing ones until you add them.
## Start work [#start-work]
- Mention `@Inspect`. Include the request in the same message. Mention it in an existing thread to use that conversation as context.
- Add `:inspect-this:`. When reaction triggers are available, the reacted message becomes the request, with the reacting person as the requester.
- Send a direct message. Send your request to Inspect without an `@Inspect` mention. Reply in that DM thread to continue.
A reaction doesn't create another request if the message already mentions Inspect or the reaction was already handled, so adding more copies of the reaction won't rerun work. Mention Inspect with a follow-up instead. The source message must contain text.
You can mention a specialist agent by its own handle. See [Custom agents](/agents-and-skills/custom-agents) for handle setup and channel auto-replies.
### Choose a repository or project [#choose-a-repository-or-project]
Inspect can choose a repository from the request, conversation, and channel description. To specify one, include `repo=` in your message. A `repo=` directive in the channel description also supplies a repository for requests in that channel. If Inspect needs a choice, it asks **What repository should I start the session in?**
Where Projects are enabled, include `project=` or `project="Travel Platform"` in the opening request to add the new session to a [Project](/projects) you participate in. A missing or ambiguous match leaves the session outside a project and produces an explanation in Slack. This directive applies to a new session, not an existing session's follow-up.
## Continue in the thread [#continue-in-the-thread]
Mention `@Inspect` in the same channel thread to send another request to its session. In a one-to-one DM thread, no mention is needed. Teammates with linked accounts can contribute, subject to the session's access rules.
Start a new thread for separate work. A follow-up in an existing thread normally continues its session. If that session is archived, or its pull request has merged or entered the merge queue, Inspect starts a new session with context about the previous work.
## Attachments and audio [#attachments-and-audio]
Inspect attaches images, text files, PDFs, and ZIP archives from the Slack request to the session. It also includes files from the parent message when starting work from a thread. For other file types, such as videos, Inspect receives file references it can fetch during the session.
Slack audio clips become transcripts in the request. If transcription fails and you supplied a typed request, Inspect can continue with that text. If the clip was the entire request, type the message or send the clip again.
## Slack automations [#slack-automations]
For Inspect-managed triggers that start sessions from channel messages, see [Slack automations](/automations/slack).
## Permissions and private sessions [#permissions-and-private-sessions]
Slack channel membership and Inspect session access are separate checks. Access to a channel does not grant access to a private Inspect session. Requests to an existing code-writing session also require a linked GitHub account.
Private sessions cannot post results to their originating Slack channel thread. They can respond in their linked Slack DM; otherwise, continue in Inspect. See [Sessions](/sessions) for session visibility.
An integration manager can enable **External channels** in the Slack integration settings to allow responses in Slack Connect channels shared with other organizations. Channel trust and user-access checks still apply.
## Troubleshooting [#troubleshooting]
Select **Link Slack account** and sign in to the Inspect account you want to use.
Invite Inspect to the channel, then react again.
Mention Inspect with the request. Slack may have rate-limited access to the reacted message.
Link GitHub, or start a new read-only session in Inspect.
Resend the clip or provide a typed request.
Repeat the installation from Slack integration settings.
Mention `@Inspect` in the reply. Ordinary channel messages do not invoke Inspect unless an automation
or custom-agent auto-reply is configured.
# Artifacts and the Library (/projects/artifacts)
An artifact is a deliverable a session produced or saved: a file the agent uploaded, or a pointer to an outside resource such as a Notion page, Linear ticket, dashboard, or report. Every session lists its own artifacts. Publishing an artifact adds it to the organization's Library, where people and agents in any later session can find it.
## Where artifacts appear [#where-artifacts-appear]
- `/sessions//artifacts` lists everything that session produced, published or not, in the order it produced them.
- `https://app.inspect.com/library/artifacts` lists published artifacts from your whole organization, searchable by title, description, and URL and filterable by **Kind**.
- `/library/artifacts/` shows one artifact with the sessions and other entities it's related to.
- A project's resources include artifacts linked to the project plus artifacts from its sessions. See [Projects](/projects#resources-and-artifacts).
Agents search published artifacts when you ask them to find or recall something saved ("find the deploy runbook we saved"). They don't search the Library on their own initiative.
## Kinds [#kinds]
`link`, `doc`, `ticket`, `message`, `channel`, `dashboard`, `pdf`, `design`, `feature_flag`, `file`, and `session_replay`. Files come from uploads; the rest point to a URL.
## Saving and publishing resources [#saving-and-publishing-resources]
Ask the agent to save or publish a resource and it records the URL with a title (up to 200 characters), a description (10 to 2,000 characters), and a kind. The URL has to appear in the conversation or a current session artifact, and the title and description have to come from the conversation or content the agent fetched. Each URL is saved once per organization; saving it again points the agent at the existing artifact to update.
Without being asked, the agent publishes only durable resources it created, updated, or delivered as a final output: docs and runbooks, Linear tickets and projects, feature flags, durable dashboards, canonical Slack or incident threads, design references, final reports. It doesn't publish screenshots, videos, logs, CI artifacts, traces, temporary query results, scratch notes, pull requests, commits, or signed URLs. Ask it to publish or unpublish anything explicitly.
Published artifacts are visible to everyone in your organization. Ask the agent to rename, re-describe, re-categorize, publish, or unpublish an existing artifact. Removing a published artifact that a session produced unpublishes it and leaves it in that session; removing one that no session produced deletes it.
## Uploaded files [#uploaded-files]
The agent uploads files from its sandbox with `upload_file`. It's the supported way for a session to hand you a file, and the agent uses it for exports, reports, logs, and recordings you ask for.
- Up to 1 GB from a sandbox path.
- Up to 5 MB for inline content.
- File types: png, jpg, jpeg, gif, webp, svg, bmp, webm, mp4, mov, pdf, pptx, xlsx, csv, htm, html, json, xml, txt, md, log, zip.
Each upload returns links with different reach:
- `url` opens for anyone signed in to your Inspect organization who has the link. It never expires.
- `public_url` opens for anyone with the link, no sign-in. It expires after 30 days.
- `download_url`, returned only when requested for scripts, opens for anyone with the link, no sign-in. It expires after 1 hour.
The agent shares `url` with people. It uses `public_url` only to embed images, video, or audio in Markdown, pull request comments, and Slack messages, which load without an Inspect sign-in. The `url` link isn't limited by the session's visibility: anyone in your organization with the link can open the file, even from a private session.
Uploading a new version with the same artifact overwrites the file in place, so existing links show the new content.
Browser-playable videos and self-contained HTML open inline, CSV files open as a table, and other files download. Uploaded HTML runs in isolation: inline scripts, styles, and embedded `data:` or `blob:` media work, but the page can't reach Inspect cookies, storage, or APIs, load external resources, or submit forms. In a session with a Slack Code Channel, an uploaded HTML file also opens as a tab in the channel.
Participants can also upload files directly to a project's resources, up to 20 MB each.
## Troubleshooting [#troubleshooting]
Ask the agent to write the file in the sandbox and upload it by path.
Applies to direct uploads to a project. Ask a session in the project to upload the file and link it
instead.
The artifact isn't published, or the id is wrong. Find it from the session's artifacts.
The artifact was unpublished or removed.
# Projects (/projects)
A project groups the sessions, deliverables, and decisions behind one goal, such as a migration across several repositories or a launch with many workstreams. Each participant gets their own **coordinator**: a long-running session that plans your requests, starts child sessions to do the work in any repository, tracks them, and reports back. The project also keeps a shared memory, so decisions made in one session reach the others.
## Requirements [#requirements]
Projects must be enabled for your organization. When they aren't, `/projects` redirects away and project tools aren't available to the agent.
Anyone in the organization can see every active project and join it. Changing a project (renaming it, archiving it, adding sessions, linking resources or automations) requires being a participant: `Only project participants can do that`.
## Create a project [#create-a-project]
1. Go to `https://app.inspect.com/projects` and select **New project**.
2. Enter a name (up to 120 characters) and a description (up to 4,000 characters). The coordinator reads the first 2,000 characters of the description as project context on every turn, so put goals and constraints there.
You become the first participant, and Inspect starts your coordinator. You can also ask the agent in any session to create a project. It can add participants by email, move the current session into the new project, or make the current session your coordinator instead of starting a new one. Project names don't have to be unique.
**Scope** on the projects list switches between **My projects** and **All projects**.
## Coordinators [#coordinators]
Each participant's coordinator is a separate session owned by that participant. Ask it to plan or run work and it delegates to child sessions, follows their progress, and answers with a summary and links. Children report back on their own; you don't need to ask for updates.
Inspect also wakes your coordinator when:
- One of its sessions fails.
- A pull request merges from any of your sessions in the project.
- One of your sessions joins the project without the coordinator starting or adding it.
- A schedule you asked it to set fires.
The coordinator acts on these wakes and only messages you when you need to know or decide something.
Ask the coordinator to check on something on a schedule ("every weekday at 9am, summarize what merged"). Schedules run at most once an hour and use `America/New_York` unless you give the coordinator another time zone. Leaving the project removes your schedules.
If your coordinator was archived or deleted, opening the project offers to start a fresh one. Coordinator sessions can't be moved out of their project.
## Sessions in a project [#sessions-in-a-project]
Add a session to a project by asking the agent in that session, by choosing a project under **Move to project** in the session's **...** menu, or by dragging the session onto the project in your session list. **Move to project** lists your most recently updated projects first, has a search box, and offers **New project…** to create one and move the session into it. You need to own or participate in the session and be a participant of the project. Moving a session also moves its child sessions and their descendants. Remove a session from a project by asking its agent, choosing **Remove from project** under **Move to project**, or dragging it out of the project.
A private session stays private inside a project. Other participants don't see its title or status, and its artifacts don't appear in the project for them.
## Resources and artifacts [#resources-and-artifacts]
The project's resources combine:
- Linked resources: artifacts, files, and URLs that participants or agents pin to the project. Uploaded files can be up to 20 MB. A URL must be `http` or `https` without credentials or a private host.
- Produced artifacts: the latest 200 artifacts from sessions in the project that you can open, each shown with the session that produced it.
Linking never changes or publishes an artifact, but anyone who can view the project can open it. Unlinking leaves the artifact in place. See [Artifacts and the Library](/projects/artifacts).
## Automations [#automations]
Link an [automation](/automations) to a project and its future runs start as sessions in that project. An automation can be linked to one project at a time; unlink it before linking it elsewhere. Unlinking doesn't change the automation.
## Project memory [#project-memory]
Project memory holds what the code and tools don't record: why a decision was made, what was rejected, who wants what, what is still only proposed. After each turn in a project session, Inspect reads the messages people sent and saves memories from them on its own. You can also ask any session in the project to remember, correct, or forget something.
- Every session in the project can read the memory. The coordinator checks it before planning, reporting, or asking you a question.
- Each memory is a file with a type: `user` (a person), `directive` (a rule for future work), `project` (a decision or open question), or `reference` (an outside source). An index, `MEMORY.md`, lists them.
- A memory can be up to 16 KB.
- Deleting a memory removes it and its earlier versions permanently.
The project page shows the memory files. Your personal [memories](/sessions/memories) are a separate feature.
## Leave or archive [#leave-or-archive]
Leaving a project removes you as a participant and deletes your coordinator schedules. When the last participant leaves, Inspect archives the project. Any participant can archive a project directly. Archived projects drop out of the projects list and reject changes with `Project is archived`; their sessions and artifacts remain.
## Troubleshooting [#troubleshooting]
Join the project first.
Coordinators always stay in their project. Start a different session for the work.
Archived projects can't change. Create a new project.
Unlink it from the other project first.
# Audit logs (/security/audit-logs)
The audit log records who changed access, credentials, and organization settings, from where, and when. Open it at [Settings → Audit log](https://app.inspect.com/settings/audit-log).
## Requirements [#requirements]
Reading or exporting the audit log requires the **View audit logs and usage** role or **Admin**. Other members get a not-found page, and the audit log API rejects them.
## What each entry contains [#what-each-entry-contains]
| Field | Description |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| Time | When the action happened. |
| Actor | The person who acted. Empty for actions your identity provider made over SCIM. |
| Action | One of the action types below. |
| IP address and user agent | The client that made the request, when there was one. |
| API key prefix | The first characters of the key involved, such as `riu_1a2b3c4d`. Never the full key. |
| Session | The Inspect session involved, if any. |
| Metadata | Event-specific details as JSON, such as the role granted or the setting's old and new values. Changes made over SCIM include `"source": "scim"`. |
Secret values, environment variable values, tokens, and connector credentials are never recorded.
## Find and export entries [#find-and-export-entries]
Entries are newest first and default to **This month**. Filter by date range, **Actor**, and **Action**, with 50 or 100 entries per page. Search matches the action, actor name or email, API key prefix, IP address, user agent, session ID, and the SCIM source, case-insensitively. It doesn't search other metadata.
**Export CSV** downloads every entry that matches the current date range, filters, and search, including metadata as JSON. Export requires a date range.
Inspect has no scheduled export, streaming, or SIEM forwarding. Retention isn't configurable and has no published fixed period, so export what you need to keep for compliance.
## Recorded actions [#recorded-actions]
Only successful changes are recorded. A failed connector authorization, for example, produces no entry.
| Area | Actions |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Sign-in and authentication | `sign_in_policy.updated`, `sso_provider.registered`, `sso_provider.deleted`, `scim_token.created`, `auth.signed_out`, `auth.account_linked`, `auth.account_unlinked`, `auth.identity_verification_required`, `auth.identity_verification_failed`, `auth.identity_verified`, `auth.deactivated_sign_in_blocked`, `session.revoked` |
| People | `user_invitation.created`, `user_invitation.resent`, `user_invitation.revoked`, `user_invitation.accepted`, `user_role.granted`, `user_role.revoked`, `user.provisioned`, `user.updated`, `user.email_changed`, `user.directory_updated`, `user.deactivated`, `user.reactivated` |
| Directory groups | `user_group.created`, `user_group.updated`, `user_group.deleted`, `user_group.members_added`, `user_group.members_removed` |
| API keys | `api_key.created`, `api_key.rotated`, `api_key.updated`, `api_key.revoked`, `api_key_ip_allowlist.updated` |
| Network and identity | `private_networking.updated`, `sandbox_oidc.updated`, `domain.added`, `domain.verified`, `domain.unverified`, `domain.removed` |
| Organization | `organization.renamed`, `legal_agreement.accepted`, `session_cost_limits.updated`, `inbound_email.updated`, `signed_commit_push.updated`, `canvas_default_design_system.updated` |
| Models | `provider_secret.updated`, `provider_secret.deleted`, `model_provider.enabled`, `model_provider.disabled`, `organization_model_defaults.updated`, `model_subscription_key_fallback.updated` |
| Repositories and environment | `repository.added`, `repository.updated`, `repository.removed`, `repository_setup_scripts.updated`, `shared_build_script.created`, `shared_build_script.updated`, `shared_build_script.deleted`, `shared_build_script.reordered`, `environment_variable.created`, `environment_variable.updated`, `environment_variable.deleted`, `egress_secret.created`, `egress_secret.updated`, `egress_secret.deleted` |
| Connectors | `connector.created`, `connector.updated`, `connector.deleted`, `connector_authorization.connected`, `connector_authorization.enabled`, `connector_authorization.disabled`, `connector_authorization.removed` |
| Code review | `organization_review_agent_settings.updated`, `approval_agent_settings.updated`, `approval_agent_baseline_policies.updated`, `auto_address_pr_reviews_policy.updated`, `review_provider.created`, `review_provider.updated`, `review_provider.deleted`, `review_provider.api_key_rotated`, `review_provider.webhook_secret_rotated` |
| Automations | `automation.created`, `automation.updated`, `datadog_installation.created`, `datadog_installation.revalidated`, `datadog_installation.deleted`, `datadog_trigger.created`, `datadog_trigger.updated`, `datadog_trigger.deleted`, `datadog_trigger.retried`, `datadog_cleanup.failed` |
| Integrations | `github_installation.disconnected`, `github_enterprise_app.connected`, `github_enterprise_app.disconnected`, `slack_installation.removed`, `slack_external_channels.updated`, `slack_onboarding_channel.updated`, `trunk_installation.updated`, `trunk_installation.deleted`, `buildkite_installation.updated`, `buildkite_installation.deleted` |
When Inspect revokes a personal key that went unused for 21 days, the `api_key.revoked` entry's metadata has `"reason": "unused_for_3_weeks"` and `revokedBy` set to `cron` for the daily job or `admin` when an admin ran it. See [API keys](/api/api-keys#automatic-revocation).
## What the audit log doesn't cover [#what-the-audit-log-doesnt-cover]
The audit log covers administrative and access changes. It isn't a record of session prompts, agent tool calls, code changes, or network requests. Requests a sandbox sends to private destinations through [private networking](/security/private-networking) aren't logged by Inspect; use your VPN's and the destination service's logs.
# Connector security (/security/connectors)
Connectors give the agent tools from external services through remote Model Context Protocol (MCP) servers. This page covers the trust model: who operates each part, where credentials live, and the limits of Inspect's controls. To add or connect a connector, see [Connectors](/connectors).
## Who operates what [#who-operates-what]
Inspect operates:
- Connector definitions and the connection flow
- OAuth flows and encrypted credential storage
- The gateway that adds credentials to outbound requests
- Checks on connector status, credential ownership, and session visibility
- The MCP client that lists and calls tools
The external service operates:
- The MCP server and its software supply chain
- Tool names, descriptions, input schemas, and behavior
- The data its tools return
- Authorization and audit controls inside the service
Inspect doesn't run provider-supplied connector code inside Inspect. A remote MCP server stays an external dependency, and connecting one gives that service a role in agent work. Review the provider's security, privacy, retention, and incident response the same way you would for any vendor.
## Credentials [#credentials]
Inspect resolves connector credentials at its gateway and adds them to outbound requests. They never enter the model's context or the session sandbox. Connector authorizations and custom MCP secrets are encrypted at the application layer, and a custom named secret is sent only to its configured server origin.
- **Personal**: each person authorizes their own account, so tool calls carry that person's identity and permissions at the provider.
- **Organization**: one shared credential, connected once. Everyone who can use the connector in an eligible session acts with that credential's access.
Give an organization credential access only to data that everyone who can run sessions with it may see. The external account, OAuth grant, API key, or cloud role is the final permission boundary; scope it with least privilege.
Managing shared connector definitions and organization credentials requires the **Edit connectors** role or **Admin**. That role governs configuration, not individual tool calls: once an organization connector is connected, members can use it in eligible sessions.
## Session visibility [#session-visibility]
Credential scope and session visibility are separate. A connector's access level decides visibility:
- Using a connector marked private makes a solo session private.
- Private connectors expose one person's data, so they aren't available in multiplayer sessions with other active participants.
- A public connector can be used in sessions visible to your organization.
## Built-in connectors [#built-in-connectors]
Inspect ships these built-in definitions. Availability depends on your organization's configuration; the Connectors page in your Inspect organization is authoritative.
| Connector | Endpoint host | Default scope | Authentication |
| ------------ | --------------------------------------------- | ------------- | ------------------------------------------------ |
| Atlassian | `mcp.atlassian.com` | Organization | OAuth |
| AWS | `aws-mcp..api.aws` | Organization | Inspect OIDC federation to an IAM role |
| Braintrust | `api.braintrust.dev`, `api-eu.braintrust.dev` | Organization | OAuth |
| Buildkite | `mcp.buildkite.com` | Organization | OAuth |
| Cloudflare | `mcp.cloudflare.com` | Organization | OAuth, or an API token for the shared connection |
| Datadog | Regional `mcp.*.datadoghq.*` hosts | Organization | API and application keys |
| Figma | `mcp.figma.com` | Organization | OAuth |
| GitHub | `api.githubcopilot.com` | Personal | Linked GitHub account (GitHub.com only) |
| Gong | `mcp.gong.io` | Personal | OAuth |
| Granola | `mcp.granola.ai` | Personal | OAuth |
| Hex | `app.hex.tech` | Personal | OAuth |
| Honeycomb | `mcp.honeycomb.io` | Organization | OAuth |
| Incident.io | `mcp.incident.io` | Organization | OAuth |
| Intercom | `mcp.intercom.com` | Organization | API token |
| Langfuse | Regional `*.cloud.langfuse.com` hosts | Organization | API keys |
| LangSmith | Regional `*.smith.langchain.com` hosts | Organization | API keys |
| LaunchDarkly | `mcp.launchdarkly.com` | Organization | OAuth, or an API token for the shared connection |
| Linear | `mcp.linear.app` | Organization | OAuth, or an API key for the shared connection |
| LogRocket | `mcp.logrocket.com` | Organization | OAuth |
| Neon | `mcp.neon.tech` | Organization | OAuth |
| Netlify | `netlify-mcp.netlify.app` | Organization | OAuth |
| Notion | `mcp.notion.com` | Organization | OAuth |
| PagerDuty | `mcp.pagerduty.com` | Organization | API key |
| Paper | `mcp.paper.design` | Organization | OAuth |
| PlanetScale | `mcp.pscale.dev` | Organization | OAuth |
| Polylane | `mcp.polylane.com` | Organization | API key |
| PostHog | `mcp.posthog.com` | Organization | OAuth |
| Railway | `mcp.railway.com` | Organization | OAuth |
| Ramp | `mcp.ramp.com` | Personal | OAuth |
| Rootly | `mcp.rootly.com` | Organization | OAuth |
| Sentry | `mcp.sentry.dev` | Organization | OAuth |
| Stripe | `mcp.stripe.com` | Organization | OAuth |
| Supabase | `mcp.supabase.com` | Organization | OAuth |
| Supercut | `mcp.supercut.ai` | Organization | OAuth |
| Vercel | `mcp.vercel.com` | Organization | OAuth |
| Webflow | `mcp.webflow.com` | Organization | OAuth |
## Limitations [#limitations]
- Inspect fetches the live tool catalog from the server. It doesn't attest the provider's implementation or pin tool schemas, so a provider can change tool descriptions, schemas, behavior, and results without Inspect.
- Tool descriptions and results are external content and can carry prompt injection. Inspect can't fully prevent it. Use least-privilege credentials and review consequential actions.
- Disabling or disconnecting a connector blocks new credential lookups. A prompt already running can keep its authenticated connection until that run ends. Revoke the credential at the provider when you need an immediate cutoff.
- Custom connectors get the same gateway, credential, status, and session checks, but Inspect doesn't attest the server's identity, implementation, or supply chain.
## Technical controls [#technical-controls]
- Configured MCP URLs and discovered OAuth endpoints must use HTTPS, include a hostname, and contain no embedded credentials or path-traversal segments.
- OAuth authorization-code connections use random state and PKCE with S256. A pending authorization expires after 10 minutes.
- Successful connector lifecycle changes are written to the [audit log](/security/audit-logs) with the actor, connector, credential scope, and authentication type. Credentials, secrets, and tokens are never recorded. Failed authorization attempts aren't recorded because nothing changed.
- For AWS, Inspect signs a 5-minute OIDC token, exchanges it through AWS STS `AssumeRoleWithWebIdentity` for 15-minute credentials, and signs each request with SigV4. The credentials sign requests only to the selected AWS MCP endpoint, and signed requests don't follow redirects. See AWS's documentation on [web identity federation](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html) and [IAM OIDC providers](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html).
When a process inside the sandbox or a repository image build must call AWS or another service directly, use [workload identity](/security/workload-identity) instead.
# Security (/security)
Inspect runs an agent that can read your code, execute commands, and call external services. This page describes the boundaries around that agent and the controls your organization has over it.
## Sandboxes [#sandboxes]
Each session runs in its own sandbox. Repository code, setup scripts, dependencies, and every command the agent runs execute there, so anything in the sandbox should be treated as readable by all of them.
- Outbound HTTP and HTTPS traffic goes through Inspect's egress proxy. Private services are reachable only through a VPN tunnel with [private networking](/security/private-networking) on, and cloud metadata, loopback, and link-local addresses stay blocked either way.
- [Environment variables](/sessions/repositories/environment-variables) are visible to every process in the scopes you choose. For HTTP credentials the sandbox shouldn't see, use [egress secrets](/sessions/repositories/egress-secrets): Inspect adds the header as the request leaves the sandbox.
- For direct cloud access from the sandbox, [workload identity](/security/workload-identity) issues short-lived OIDC tokens instead of storing long-lived keys.
## Credentials [#credentials]
- Connector credentials are resolved at Inspect's gateway and added to outbound MCP requests. They never enter the model's context or the sandbox. See [Connector security](/security/connectors).
- Egress secrets are added at egress. The sandbox gets a reference, never the value.
- API keys are stored as a salted scrypt hash. Inspect shows the full key once. See [API keys](/api/api-keys).
- The OpenID Connect client secret is stored encrypted and never returned to the browser. The SCIM token is stored as a hash and shown once.
- Your GitHub account is used to push branches and open pull requests as you. Without it, your sessions are read-only.
## Who can see a session [#who-can-see-a-session]
Sessions are visible to everyone in your organization by default. A private session is visible only to its owner, its participants, and people with the **View all sessions** role, who can read but not write to it.
A solo session becomes private when it uses a connector marked private, and private connectors aren't available in sessions with other participants. A private session can only post to Slack in its linked DM. See [Sessions](/sessions) for making a session private yourself.
## Who can change what [#who-can-change-what]
Every administrative capability is a permission granted through a role. [Users and roles](/security/users-and-roles) lists each role and permission. The most security-relevant:
- **Admin** controls everything, including granting Admin.
- **Manage security** controls [sign-in](/security/sign-in), provisioning, private networking, workload identities, the API key IP allowlist, and session [spend limits](/security/spend-limits).
- **Manage people** controls invitations, deactivation, and roles the manager already holds.
- **Manage API keys** controls system API keys and revoking anyone's personal keys.
- **Edit connectors** controls organization connectors and their shared credentials.
- **Manage secrets** controls organization environment secrets and egress secrets.
- **View audit logs and usage** controls the [audit log](/security/audit-logs) and everyone's cost.
Deactivating a person ends their signed-in sessions and stops their API keys immediately.
## Records [#records]
The [audit log](/security/audit-logs) records access, credential, and settings changes with the actor, IP address, and user agent, and exports to CSV. It doesn't record prompts, tool calls, or network requests.
# Private networking (/security/private-networking)
Private networking lets a session sandbox reach private HTTP and HTTPS services, such as an internal API or staging environment, through VPN tunnel software you install in the sandbox, such as Tailscale or WireGuard. It's off by default.
## Requirements [#requirements]
Turning private networking on or off requires the **Manage security** role or **Admin**. Change it under **Private networking** at [Settings → Security](https://app.inspect.com/settings/security). Each change is recorded in the [audit log](/security/audit-logs) as `private_networking.updated`.
You also need to install and authenticate the tunnel in the sandbox yourself, usually in the repository's [build](/sessions/repositories/build) or setup scripts. Inspect doesn't install VPN software or provision VPN credentials.
## When the setting applies [#when-the-setting-applies]
Inspect reads the setting when a sandbox starts: for a new session, or when a session gets a replacement sandbox. Changing it doesn't affect sandboxes that are already running. Start a new session to pick up a change right away.
## How traffic is routed [#how-traffic-is-routed]
Keep using the HTTP and HTTPS proxy environment Inspect sets in the sandbox. You don't need `NO_PROXY`, CIDR allowlists, interface names, route tables, or another proxy.
For each connection to a private address, the sandbox's local proxy resolves the destination inside the sandbox and checks the tunnel's routes. Once the tunnel provides a specific route to that address, later connections use it without reconfiguring the session or proxy. Private DNS, including Tailscale MagicDNS, must resolve inside the sandbox to an address the route covers.
- Tailscale peer routes, MagicDNS names, and advertised subnet routes work once Tailscale is connected and the route is available.
- WireGuard and other tunnels work when they install a kernel route to the destination. Userspace-only tunnels without a kernel route aren't supported.
- A tunnel's default route or exit node doesn't authorize private connections. Public traffic keeps going through Inspect's standard egress.
- Cloud metadata, loopback, link-local, and other restricted or special-use addresses stay blocked.
## Security considerations [#security-considerations]
With private networking on, the agent, its tools, and the repository code in the sandbox can all send HTTP and HTTPS requests to anything the tunnel reaches. Use a dedicated, least-privilege tunnel identity and network ACLs that expose only the services sessions need, and keep authentication on the private services themselves. Inspect's route checks prevent accidental exposure of default routes and restricted addresses; they don't replace your VPN access policy.
Untrusted prompts and repository changes run with the same network access, so review them before giving sessions access to sensitive services.
Inspect doesn't log requests a sandbox sends to private destinations through the tunnel, and they don't appear in the audit log. Use your VPN's and the destination service's logs for that traffic.
# Sign-in (/security/sign-in)
Your sign-in policy controls two things: who can get an Inspect account in your organization, and which methods people can use to sign in. Both live under [Settings → Security → Sign-in and provisioning](https://app.inspect.com/settings/security).
## Requirements [#requirements]
Changing the sign-in policy requires the **Manage security** role or **Admin**. See [Users and roles](/security/users-and-roles). Every change is recorded in the [audit log](/security/audit-logs) as `sign_in_policy.updated`.
## Defaults [#defaults]
A new organization starts with:
- **Who can join:** invited people only.
- **How people sign in:** email codes only.
Organization setup leaves this policy in place. Change it after setup if people should use Google, Microsoft, or your identity provider, or if everyone at your email domain should be able to join.
## Who can join [#who-can-join]
- **Invited people** is always on. Anyone with an open invitation from [Settings → Users & groups](https://app.inspect.com/settings/users) can join. Invitations expire 30 days after they were last sent.
- **Approved email domains** lets anyone who can receive email at one of these domains join without an invitation. Up to 50 domains.
- **Directory sync** lets your identity provider create, update, and deactivate people over SCIM.
The policy only decides who can join. Existing members can always sign in with any allowed method unless they are deactivated.
Inspect checks domains for valid syntax and lowercases them. You can paste a full address such as `alex@acme.com`; Inspect keeps the domain. Adding a public email provider such as `gmail.com`, `outlook.com`, or `icloud.com` asks you to confirm, because anyone with an address there could then join. To add one person with a personal address, invite them instead.
## Sign-in methods [#sign-in-methods]
Everyone with an account can use any method you allow. At least one method must stay on.
- **Google**: your Google Workspace admin may need to approve Inspect under **App access** in the Google Admin console. Copy Inspect's client ID from the method's note to find it.
- **Microsoft**: your Microsoft Entra admin may need to approve Inspect on the admin consent page linked from the method's note. Work, school, and personal Microsoft accounts can sign in if their address is admitted.
- **OpenID Connect**: connect your own app from Okta, OneLogin, JumpCloud, Ping Identity, or another compatible OIDC provider. See [OpenID Connect](#openid-connect).
- **Email code**: Inspect emails a 6-digit code that expires after 10 minutes.
A method that isn't available for your organization shows "Not available for your organization yet." Contact Inspect support to turn it on.
Inspect refuses a change that would lock you out. If you turn off **Email code** and none of the remaining methods is linked to your own account, saving fails with "You would no longer be able to sign in." Keep a method you use, or keep email codes on.
### OpenID Connect [#openid-connect]
Your identity provider belongs to your organization, so you connect an app from it. The sign-in button names recognized identity providers; otherwise, it says **Sign in with SSO**.
1. Under **Sign-in methods**, check **OpenID Connect**.
2. In your identity provider, create an OIDC web app with the redirect URI Inspect shows, and assign the people or groups who should be able to sign in. To let people open Inspect from your provider's dashboard, also set the app's initiate login URI to the one Inspect shows.
3. Enter the provider's issuer URL, such as `https://acme.okta.com` or `https://acme.onelogin.com/oidc/2`.
4. Paste the app's client ID and client secret, choose the **Client authentication** the app uses (HTTP Basic or request body), then save.
Inspect reads the issuer's OpenID configuration before saving. If it can't, or the provider isn't compatible, saving fails with the reason on the field to fix. Inspect stores the client secret encrypted and never sends it back to the browser. The saved secret is kept until you change the issuer or client ID, which requires a new secret. Turning OpenID Connect off removes the connected app.
The provider's assignments and the sign-in policy both apply: a person must be assigned to the app in your identity provider and admitted by your policy.
Okta apps connected before OpenID Connect replaced the Okta method keep working unchanged, including their redirect URI.
### Email verification for linked identities [#email-verification-for-linked-identities]
When Inspect can't treat a provider's sign-in as proof that you own the email address, it emails you a code before finishing the sign-in. This happens when a new identity is linked to an existing account by matching email, and for Google or Microsoft accounts whose provider isn't authoritative for the domain. After the code, the identity signs in directly.
OpenID Connect counts as proof only at a domain your organization verified, since your provider's admins can assign any address. An OpenID Connect identity that created your account still signs in without a code, because your organization's admins configured the app, but your email stays unverified until you verify it from your profile settings.
Members can connect additional sign-in identities from their account settings. To add a second provider to an existing account, sign in with the original provider first, then connect the new one.
## Directory sync (SCIM) [#directory-sync-scim]
Your identity provider can manage membership:
1. Check **Directory sync** under **Who can join**.
2. In your identity provider, add a SCIM app with the SCIM URL Inspect shows.
3. Generate a token in Inspect and use it as the app's API token. Inspect shows the token once and stores only its hash.
4. Assign people and push groups to the app.
5. Save the sign-in policy before testing the connection.
Generating a new token stops the old one immediately; the identity provider can't sync until you paste the new token.
People the directory provisions join right away and get the default roles. If your organization [verified the domain](#verified-domains) of a person's email, the directory's address counts as verified once the domain verification takes effect, about 30 minutes after you verify it; people the directory synced before then are verified in the background. Otherwise the email is verified once the person proves it with an email code or signs in with a provider that owns the mailbox, such as a Google Workspace account; a first OpenID Connect sign-in alone doesn't verify it. While the directory manages someone, change their name and deactivate them in the identity provider; Inspect rejects those changes in Settings with "Your identity provider manages this person over SCIM. Deactivate them there." The directory can't deactivate your organization's last active admin. Changes the directory makes show in the audit log with no actor and a `scim` source; search the log for `scim` to find them.
Provisioned people can sign in with any enabled method:
- **OpenID Connect, as their first sign-in:** goes straight in, because your organization's admins manage both the directory and the app.
- **Google or Microsoft:** asks for an email code, unless the provider owns the mailbox, such as a Google Workspace account or a Microsoft work account.
- **OpenID Connect, after signing in another way first:** asks for an email code, unless your organization [verified the domain](#verified-domains).
Each identity asks for a code at most once. After that, it signs in directly.
## Verified domains [#verified-domains]
Verify your email domain so OpenID Connect sign-ins at it don't need an email code. Without a verified domain, Inspect sends a one-time code when an OpenID Connect sign-in is matched to an existing account by email, such as someone who first signed in with Google. With one, that sign-in goes straight in and the person's email is marked verified, and so is the email of each person directory sync manages at the domain, including people it synced before. Google and Microsoft sign-ins work the same either way. Domains are shown only when they're available for your organization.
1. At [Settings → Security](https://app.inspect.com/settings/security), under **Domains**, select **Add a domain** and enter your email domain, such as `acme.com`.
2. Add the TXT record Inspect shows wherever the domain's DNS is managed. It lives at `_inspect-verification.`.
3. Select **Verify**. Inspect checks for the record right away, then keeps checking in the background for 7 days. Once it finds a match, the domain shows **Verified** and you can delete the record. If the checks end first, open the domain and select **Verify** again.
A domain can be verified by only one Inspect organization; if another one already has it, contact support@inspect.com. Adding, verifying, and removing domains require the **Manage security** role or **Admin**, and each change is recorded in the [audit log](/security/audit-logs).
## Troubleshooting [#troubleshooting]
The address isn't a member, isn't invited, and isn't on an approved domain. Invite the person or add
their domain.
The method is off in the sign-in policy. Turn it on or use another method.
If the person canceled, they can try again. Otherwise, assign them to the Inspect app in your
identity provider.
The Workspace admin hasn't allowed Inspect. Approve it under App access.
The Entra admin hasn't granted Inspect access. Approve it on the admin consent page.
The provider didn't send a valid `email` claim. Check the person's email in the directory, and for
OpenID Connect allow the app the `email` scope.
The person signed in with a provider not yet linked to their account. Sign in with the original
provider, then connect the new one in account settings.
The provider account's email belongs to another Inspect account. An admin needs to resolve the
duplicate.
Email codes have a 60-second cooldown per address.
Inspect allows 5 code requests per address and 20 per IP address in 15 minutes.
Request a new code.
Start sign-in again from the same browser tab.
# Spend limits (/security/spend-limits)
Spend limits stop runaway sessions. Inspect has two kinds: per-session limits that apply to every session in your organization, and a Review agent cost limit that applies to the automated reviews of each pull request. Set both at [Usage & Limits → Limits](https://app.inspect.com/usage/limits).
## Requirements [#requirements]
- **Session soft limit** and **Session hard limit** can be changed by **Manage security** or **Admin**.
- **Review agent cost limit** can be changed by **Manage code review** or **Admin**. It's also under [Settings → Review agent](https://app.inspect.com/settings/review-agent) as **Cost limit**.
The **Limits** tab only appears for people who can change at least one of these. Every change to the session limits is recorded in the [audit log](/security/audit-logs) as `session_cost_limits.updated`.
## Session limits [#session-limits]
Both session limits are off until someone sets them. Amounts are in US dollars and must be positive, and the soft limit must be lower than the hard limit.
- **Session soft limit**: the session pauses. Anyone who can work in the session can choose **Continue** on the session page, which lets it run until the hard limit.
- **Session hard limit**: the session stops and can't continue. Start a new session to keep working.
### How enforcement works [#how-enforcement-works]
- Inspect checks a running session's spend about every 30 seconds and stops the current turn once it reaches a limit. A turn can run slightly past the amount before the check catches it.
- When a session first reaches a limit, Inspect adds a note to the transcript and tells the session owner once: in the session's Slack thread if it has one, otherwise in a Slack DM. Owners without a linked Slack account get no Slack message.
- New prompts to a session at a limit are rejected, whichever channel they come from. The API returns `409` with code `session_cost_limit_reached`.
- Approving a soft limit applies only to that session. The hard limit still applies.
- If an admin raises or removes a limit, a stopped session can take prompts again once its spend is under the new limit.
- Project coordinator sessions and Operate home sessions are exempt, because they run for weeks.
## Review agent cost limit [#review-agent-cost-limit]
The Review agent cost limit is on by default at $10. When the automated reviews of one pull request reach it, the Review agent pauses re-reviews on that pull request and skips new commits. The pause comment on the pull request includes a checkbox to resume; checking it resumes reviews if you have permission on the repository. You can also resume from the pull request's review panel in Inspect.
Turning the switch off removes the limit, so automated reviews never pause for cost. See [Review agent](/code-review/review-agent).
## Usage [#usage]
[Usage & Limits](https://app.inspect.com/usage) shows sessions, spend, and token usage by period and repository. Everyone can see their own spend. Seeing other people's cost requires the **View audit logs and usage** role or **Admin**.
A session's own cost appears in the session once it passes $5. Sessions started with a system API key always show their cost.
# Users and roles (/security/users-and-roles)
People join your organization by invitation, through an approved email domain, or through directory sync (see [Sign-in](/security/sign-in)). What each person can manage is set by roles. Inspect checks permissions, never role names, so a role is a bundle of permissions you grant per person.
Manage people at [Settings → Users & groups](https://app.inspect.com/settings/users). It requires the **Manage people** role or **Admin**.
## Invite people [#invite-people]
Invite one or more email addresses from [Settings → Users & groups](https://app.inspect.com/settings/users). You can attach one role to the invitation; the person gets it when they join.
- An invitation stays open for 30 days from when it was last sent. Resending it, or inviting the same address again, restarts the 30 days and replaces the attached role.
- Inviting someone who is already an active member with a verified email grants them the attached role instead of sending an invitation.
- Addresses of existing members without a role to grant, deactivated members, and addresses with an invitation already in flight are skipped and listed back to you.
- Revoke an open invitation from **Invitations**.
If your organization has a seat limit and it's reached, joining fails with "Your organization's seat limit is reached. Deactivate a member to free a seat."
## Roles [#roles]
Every new member gets **Add repositories**, so they can add repositories without asking an admin. Revoke it per person like any other role.
| Role | Permissions | What it allows |
| ------------------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Admin | All | Everything, including granting and revoking Admin. |
| Manage people | `users.manage` | Invite, deactivate, and reactivate people, edit names, and grant roles they already hold. |
| Manage security | `security.manage` | Change sign-in methods, provisioning, private networking, workload identities, the API key IP allowlist, and session spend limits. |
| Manage API keys | `apiKeys.manage` | Create and revoke system API keys and revoke anyone's personal keys. |
| View audit logs and usage | `auditLogs.read`, `usage.read` | Read the audit log and everyone's usage and cost. |
| Edit connectors | `connectors.manage` | Manage organization-wide connectors. |
| Edit providers | `providers.read`, `providers.manage` | Manage model providers. |
| View providers | `providers.read` | View model providers. |
| Edit repositories | `repositories.read`, `repositories.add`, `repositories.manage` | Add, configure, and remove repositories. |
| Add repositories | `repositories.read`, `repositories.add` | View and add repositories. |
| View repositories | `repositories.read` | View repository settings. |
| Manage integrations | `integrations.manage` | Connect Slack, Linear, GitHub, and email. |
| Manage secrets | `secrets.manage` | Manage organization secrets and egress secrets. |
| Manage code review | `reviews.manage` | Configure the Review agent, review providers, approvals, and the Review agent cost limit. |
| Manage all content | `content.manage` | Edit and delete anyone's skills, agents, automations, and templates. |
| View all sessions | `sessions.readAll` | Read everyone's sessions, including private ones. Read access only. |
Some roles appear only when the feature they cover is turned on for your organization: **Manage PR approval policies** (`approvalPolicies.manage`), **Manage design systems** (`designSystems.manage`), **View Operate cost** (`operateUsage.read`), and **View billing** (`billing.read`). While a feature is off, its role can't be granted, but existing grants can still be revoked.
### Who can grant what [#who-can-grant-what]
- Only an Admin can grant or revoke Admin, or deactivate, reactivate, or invite an Admin.
- Anyone else with **Manage people** can grant or revoke only roles whose permissions they already hold. Otherwise the change fails with "You can only grant roles you already hold" or "You can only remove roles you already hold".
- Inspect never removes the last active Admin. Revoking it or deactivating that person fails with "Cannot revoke the last admin".
You can grant or revoke one role for many people at once from **Roles**.
## Deactivate and reactivate [#deactivate-and-reactivate]
Deactivating someone ends every signed-in browser session they have and blocks future sign-ins with any method. Their API keys stop working, because Inspect only authenticates keys whose owner is active. Inspect doesn't delete their sessions or other data.
- You can't deactivate yourself.
- People managed by directory sync must be deactivated in your identity provider.
- Reactivating restores access with the roles the person held.
A deactivated person who tries to sign in is refused, and the attempt is recorded in the audit log as `auth.deactivated_sign_in_blocked`.
## Groups [#groups]
**Groups** lists the groups you create in Inspect and, when [directory sync](/security/sign-in#directory-sync-scim) is on, the groups your identity provider pushes. Filter the user list by group or role.
- **Create group** names the group and adds its members. Edit or delete it from its row's menu.
- Groups from your identity provider are read-only in Inspect; manage their membership in the identity provider.
- Creating, renaming, or deleting a group, and adding or removing members, is recorded in the audit log.
When directory sync is on, each person's page also shows what the directory synced for them.
## Read-only members [#read-only-members]
A member who hasn't linked a GitHub account is read-only. Their sessions can't push code or open pull requests. Linking GitHub from [Settings → Profile](https://app.inspect.com/settings/profile) removes the restriction.
# Workload identity (/security/workload-identity)
Workload identity gives processes in a session sandbox or repository image build a short-lived OIDC token from Inspect. They exchange it for access to AWS, Vault, a cloud provider's workload federation, or any service that trusts OIDC, so no long-lived credential is stored in Inspect.
Configure up to 16 identities under [Settings → Security → Workload identities](https://app.inspect.com/settings/security). It requires the **Manage security** role or **Admin**. With no identities configured, Inspect issues no tokens. Changes are recorded in the [audit log](/security/audit-logs) as `sandbox_oidc.updated`.
## Prefer the AWS connector [#prefer-the-aws-connector]
Use the AWS [connector](/connectors) by default when Inspect needs to inspect or change AWS resources. The connector exchanges OIDC tokens outside the sandbox and exposes controlled AWS tools, so credentials never become available to repository code, setup scripts, dependencies, or shell commands.
Use sandbox workload identity only when a process inside the sandbox or repository image build must authenticate directly, for example when running the AWS CLI, Terraform, an AWS SDK integration test, Vault, or a provider-specific development tool. In that model, every process that can affect the sandbox or build must be trusted with the resulting identity. If a connector can perform the task, prefer the connector.
## Configure workload identities [#configure-workload-identities]
Each workload identity has:
- a **name**, such as `aws` or `vault`, which determines its token file path
- an **audience**, such as `sts.amazonaws.com` or `https://vault.example.com`, which becomes the token's exact `aud` claim
Names start with a lowercase letter or number, contain only lowercase letters, numbers, underscores, and hyphens, are unique, and are at most 64 characters. Repository processes and provider configuration depend on the file path a name produces, so keep names stable. Audiences are 1 to 256 printable ASCII characters with no spaces. Use `sts.amazonaws.com` for AWS. Saving `sts.amazonaws.com/` fails because that audience is reserved for the AWS connector.
Identities apply to every repository in the organization.
## Issuer and discovery [#issuer-and-discovery]
The token's issuer (`iss`) is shown under **Workload identities** and has this form:
```text
https://app.inspect.com/api/oidc
```
Inspect publishes standard OIDC discovery and signing keys at:
```text
https://app.inspect.com/api/oidc/.well-known/openid-configuration
https://app.inspect.com/api/oidc/jwks
```
## Subject and claims [#subject-and-claims]
The subject (`sub`) identifies the Inspect organization, canonical source-control repository, and lifecycle:
```text
org::repository::/:lifecycle:
```
For GitHub.com repositories, the source-control host key is `github`. For example, `github.com/acme/payments` has these subjects:
```text
Runtime: org::repository:github:acme/payments:lifecycle:runtime
Build: org::repository:github:acme/payments:lifecycle:build
```
**Workload identities** shows your organization's issuer and subject prefix (for example, `org::repository:`), each with a copy button. Append the source-control host key, repository, and lifecycle to that prefix to build a subject.
Organizations can share an issuer, so trust policies must keep the organization segment exact. Inspect percent-encodes organization and repository values when necessary. Workspace aliases resolve to the canonical source-control repository before Inspect builds the subject. Repository renames and transfers change the subject.
Tokens contain the standard `iss`, `sub`, `aud`, `iat`, `exp`, and `jti` claims plus a numeric `ver` claim and an `org` claim with the issuing organization's ID. Repository and lifecycle scope live in `sub`; relying parties can inspect `ver` before interpreting versioned claims.
The current claims format is version 3 (`ver=3`).
## Projected token files [#projected-token-files]
Inspect installs a token refresher before repository setup and writes files with mode `0600` under:
```text
/run/inspect/oidc-tokens/
```
For example, a workload identity named `aws` is available at `/run/inspect/oidc-tokens/aws`. Repository processes should read that file directly. The configured token paths are the only supported customer interface; other files under `/run/inspect` are implementation details.
Tokens live for one hour and are atomically replaced after roughly 40–50 minutes, leaving at least ten minutes for retries. The refresher polls the current administrator configuration every five minutes, so it adds newly configured identities and removes renamed or deleted identity files without replacing the sandbox. Inspect reinstalls the refresher after a sandbox is restored or replaced.
Repository image builds install the same projection before pre-clone and repository setup scripts. Inspect stops the refresher and removes projected tokens and AWS CLI credential caches before persisting any build snapshot. Build scripts must also remove downstream credentials, such as CodeArtifact tokens in package-manager configuration, before the snapshot is created.
Inspect authenticates each token request and binds it to the active repository sandbox or image build. Repository processes can request only configured identity names, and each identity's audience comes from organization settings. Failed refreshes preserve an existing token file and retry; an unavailable identity removes its file.
Any process in the sandbox or image build can read its projected tokens: that environment is the workload principal.
## Connect a sandbox or image build to AWS [#connect-a-sandbox-or-image-build-to-aws]
AWS is one example of a service that can trust Inspect workload identity. The same feature also works with Vault, other cloud providers, and internal services that accept OIDC tokens; use the audience and setup instructions from that service instead.
First, add a workload identity named `aws` with the audience `sts.amazonaws.com`, or ask someone with **Manage security** to add it.
### 1. Add Inspect as an AWS identity provider [#1-add-inspect-as-an-aws-identity-provider]
Follow AWS's [IAM OIDC provider setup guide](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html). In the AWS console, go to **IAM → Identity providers → Add provider** and select **OpenID Connect**.
- For **Provider URL**, enter the issuer documented above.
- For **Audience**, enter `sts.amazonaws.com`.
If this AWS account already uses the Inspect AWS MCP connector, the provider already exists. You can use the existing provider instead of creating another one. The same provider works for both features, but sandbox workload identity and connector tokens use different subjects and credential boundaries.
### 2. Create a role for the repository [#2-create-a-role-for-the-repository]
In **IAM → Roles**, create a role with **Web identity** as the trusted entity. Select the Inspect identity provider and the `sts.amazonaws.com` audience. AWS documents the underlying exchange in [AssumeRoleWithWebIdentity](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html).
Use an exact subject when runtime sandboxes and image builds should assume different roles. For example, this condition trusts only runtime sandboxes for one repository:
```json
{
"StringEquals": {
":aud": "sts.amazonaws.com",
":sub": "org::repository:github:acme/payments:lifecycle:runtime"
}
}
```
In condition keys, replace `` with the complete issuer minus its `https://` prefix, including the `/api/oidc` path. Replace the organization ID, owner, and repository with your values; the subject prefix in workload identity settings already includes your organization ID.
When one role intentionally serves both lifecycles, use `StringLike` to wildcard only the final lifecycle segment while keeping the organization and repository exact:
```json
{
"StringEquals": {
":aud": "sts.amazonaws.com"
},
"StringLike": {
":sub": "org::repository:github:acme/payments:lifecycle:*"
}
}
```
When one role intentionally serves multiple repositories, the repository segment can also use a wildcard:
```json
{
"StringEquals": {
":aud": "sts.amazonaws.com"
},
"StringLike": {
":sub": "org::repository:github:acme/*:lifecycle:*"
}
}
```
Keep the organization, source-control host key, and owner exact. Prefer the narrowest repository prefix, or an array of explicit repository subjects, that covers every repository meant to receive the role's permissions. Attach a permissions policy that grants only the AWS actions and resources those repositories need. Do not reuse the AWS MCP connector's role because connector tokens have a different subject.
### 3. Configure repository environment variables [#3-configure-repository-environment-variables]
Set the standard AWS web identity variables in the repository's [environment variables](/sessions/repositories/environment-variables):
```dotenv
AWS_ROLE_ARN=arn:aws:iam::123456789012:role/inspect
AWS_WEB_IDENTITY_TOKEN_FILE=/run/inspect/oidc-tokens/aws
AWS_ROLE_SESSION_NAME=inspect
AWS_REGION=us-east-1
```
Select the **Build** scope for image setup, **Runtime** for live sandboxes, or both when they share a role. These values identify the role and token path and aren't secrets. The AWS SDK or CLI exchanges the token for credentials itself.
AWS SDKs and the AWS CLI reread the projected file when credentials need refreshing. Verify the setup from a new sandbox or build with the AWS operation your repository requires. For a sandbox with permission to call STS, you can run:
```bash
aws sts get-caller-identity
```
The returned ARN should contain the role you created.
## Security and revocation [#security-and-revocation]
Configuring an identity gives every process in an eligible repository sandbox or image build access to a bearer token for that relying party. The agent, tools, setup scripts, dependencies, and repository code can read, copy, or exchange the token. Treat the sandbox or build as the workload principal, not as a trusted credential store.
Use dedicated, least-privilege roles and policies. Trust an exact audience and the narrowest practical subject. Do not wildcard Inspect organization, repository owner, or repository identifiers unless every matching sandbox and build should receive the same access. Continue enforcing authorization at the destination service. OIDC federation removes long-lived static secrets from Inspect, but it does not make an over-permissioned role safe.
Removing an identity blocks new minting and removes its projected file on the next configuration poll. Existing JWT copies remain valid for up to one hour, and downstream credentials remain valid until their own expiration. For immediate AWS invalidation, use **Revoke active sessions** on the IAM role.
Public or collaborative sessions can be influenced by users other than the session owner. Configure only roles whose permissions are appropriate for every user and process that can affect the sandbox. Review untrusted prompts, repository changes, setup scripts, and dependencies before granting access to sensitive systems.
# Browser (/sessions/browser)
Every session sandbox includes a Chromium browser the agent can drive. It uses it to check UI changes against a running dev server, reproduce bugs, fill in forms, and record proof that a change works. You can watch the same browser live in the session's **Browser** tab and take control of it when a step needs a person, such as signing in.
## How the agent uses it [#how-the-agent-uses-it]
The agent starts the browser the first time it needs it. It acts through real pointer movement and key presses, and reads the page through screenshots and the accessibility tree. It can:
- Open URLs, including servers it started in the sandbox such as `http://localhost:3000`.
- Resize the window: `desktop` is 1920×1080, `mobile` is 402×874 at 2× scale, or an exact size from 320×240 up to 3840×2400.
- Work across tabs and inside iframes.
- Run a scripted step for up to 5 minutes (1 minute by default) before it is abandoned.
Ask for browser checks in plain terms: "start the app and confirm the empty state renders on mobile" is enough.
## Watch and take control [#watch-and-take-control]
**Browser** appears once the agent has started the browser. Anyone who can open the session and has a connected GitHub account can watch the stream. One person controls it at a time; the stream shows who is controlling.
1. Open **Browser** and select **Take control**. If no one is controlling, your first click claims it.
2. Use the page as you would a local browser. Your keyboard and pointer go to the sandbox, and anything you do (cookies, sign-ins, open pages) is state the agent inherits.
3. Release control, then send a short prompt that starts from where you left the page, such as "use the examples on this page."
**Open browser in a new tab** pops the stream out. If the stream is open in another tab, the current tab becomes view-only until you take control there.
When the session's pull request has a reported deploy preview, **Browser** can also show that preview alongside the sandbox browser.
## Recordings [#recordings]
When you ask the agent to show or prove a behavior, it records the browser. While recording, the agent holds control so viewers cannot interfere. Each recording covers one behavior and ends with an outcome of `passed`, `failed`, or `blocked`.
Inspect produces an MP4 with idle time removed, a synthetic cursor, and captions for typed text, plus a JSON log of each step. Both are attached to the session as files, and the agent links the video in its reply.
## Availability [#availability]
- The browser is not available in read-only sessions, or to people without a connected GitHub account.
- Archived sessions have no running sandbox. Unarchive the session before opening its browser.
- Terminating the sandbox closes the browser and its state. The next prompt starts a fresh sandbox.
## Troubleshooting [#troubleshooting]
The agent hasn't started the browser yet. Ask it to open the page you want.
Unarchive the session, or send it a prompt.
The stream closed, often because the sandbox stopped after an hour idle. Send a prompt to restart the
sandbox.
The stream is still connecting. Wait for it to show the page.
# Custom instructions (/sessions/custom-instructions)
Custom instructions are standing preferences that apply to every session you start, in any repository. Use them for corrections you would otherwise repeat in each prompt: how you want handoffs summarized, how terse PR descriptions should be, which checks you always expect.
## Set them [#set-them]
1. Open [Settings → Agent](https://app.inspect.com/settings/agent).
2. Select **Custom instructions** and write your instructions. The editor supports rich text, which Inspect converts to Markdown for the agent.
3. Save. Closing with unsaved edits asks you to discard or keep editing. Clearing the text removes your instructions.
Custom instructions are personal. No one else in your organization sees them or gets them in their sessions.
## How they apply [#how-they-apply]
- Inspect adds your instructions to the first prompt of every new session you start, whether from the web app, Slack, Linear, email, or the API. Sessions created with the API on your behalf use your instructions, not the API key owner's.
- The agent is told to reread them before sending anything external: Slack and Linear messages, DMs, pull request and issue comments, and pull request titles and descriptions.
- Changes apply to sessions started after you save. Running sessions keep the instructions they started with.
Phrase each rule so one reply shows whether it was followed, for example "End every handoff with what you validated and what is still blocked."
## How they combine with other instructions [#how-they-combine-with-other-instructions]
A session can carry several layers of guidance:
- Inspect system prompt: from Inspect; applies to every session.
- [Custom agent](/agents-and-skills/custom-agents) prompt: from the agent's settings, appended to the default agent prompt or replacing it; applies to sessions running that agent.
- Repository instructions: from `AGENTS.md` and related files in the repository ([details](/sessions/repositories)); applies to that repository's checkout.
- Custom instructions: from Settings → Agent; applies to sessions you start.
- [Memories](/sessions/memories): directives you or the agent saved; applies to sessions you start.
Custom instructions still apply when a session runs a custom agent. Repository instructions are treated as guidance subordinate to Inspect's system instructions and apply only inside their checkout.
Put conventions that belong to a codebase (build commands, architecture rules) in `AGENTS.md` so every teammate's sessions follow them. Put preferences that follow you across repositories in custom instructions.
# Sessions (/sessions)
A session is one conversation with Inspect plus the isolated sandbox it works in. Each coding session gets its own checkout of a repository, its own branch, and at most one open pull request per repository. The transcript, branch, and pull request stay linked, so you can return days later and continue from where the work stopped.
## Start a session [#start-a-session]
You can start a session from any connected surface. The session behaves the same way regardless of where it started; the surface decides where Inspect posts its replies.
Mention `@Inspect` in a channel or thread.
Send or copy `inspect@inspect.com`.
Mention `@inspect` on a pull request.
`POST /api/v2/sessions`.
When you pick **(Auto)** as the repository, Inspect infers it from your prompt. If nothing matches, it falls back to the repository you use most. Pick **Chat** for sessions that need no repository, such as research or writing.
## The sandbox [#the-sandbox]
Each session runs in its own VM sandbox with a checkout of the repository at its base branch (the repository's default branch unless you choose another). The sandbox includes Git, Docker, Node.js, Python, `ripgrep`, `jq`, and a Chromium browser, plus whatever your repository's [build](/sessions/repositories/build) installs. Repository [environment variables](/sessions/repositories/environment-variables) scoped to Runtime are available as environment variables.
Inspect prepares the checkout, environment, and Git credentials in the background when the session starts, so the agent can begin reading code before setup finishes.
### Idle, snapshot, and restore [#idle-snapshot-and-restore]
- A sandbox stops after an hour with no activity. Inspect snapshots the sandbox after turns and restores it when you send the next prompt, so files and uncommitted work normally survive.
- If a sandbox cannot be restored, Inspect provisions a new one and checks out the session's saved branch. Work that was never committed and pushed is lost in that case.
- Use **Terminate sandbox** in a session's menu to stop the sandbox immediately. The next prompt starts a fresh sandbox. The session owner, its participants, and admins can terminate a sandbox.
### Archive [#archive]
Archiving stops any running turn, clears queued prompts, stops the sandbox, and hides the session from default lists. By default, archiving also closes the session's open pull requests; pass `close_pull_request=false` to the API to keep them open. Sending a prompt to an archived session unarchives it. The session owner and its participants can archive or unarchive a session.
## Branches and pull requests [#branches-and-pull-requests]
Before its first commit, the agent creates a branch named `/inspect--<4 hex characters>`, for example `jane-doe/inspect-fix-ci-timeout-3f9a`. Commits and pull requests are made as you through your linked GitHub account.
- New pull requests open as drafts unless you turn on **Create Pull Requests as Ready for Review** in [Settings → Agent](https://app.inspect.com/settings/agent). The setting of the session's owner applies.
- Inspect adds links to the session and, when one exists, the Slack thread to the pull request description.
- After a pull request merges or closes, new work in the same session starts on a fresh branch from the latest base branch and becomes a new pull request.
- The agent can attach an existing open pull request to the session when you ask it to continue that pull request.
- The agent merges only when you explicitly ask. "Get it ready to merge" is not a merge request.
See [Reviewing changes](/sessions/reviewing-changes) for the diff, merge, and conflict tools, and [Code review](/code-review) for how the session responds to review comments and CI failures.
## Sending prompts while a session runs [#sending-prompts-while-a-session-runs]
Prompts you send while the agent is working are delivered right away and steer the current turn. You can also queue a prompt so it runs after the current work finishes. Queued prompts can be sent immediately or discarded before they run. Stopping a session's active turn cancels any queued prompts.
## Sharing and access [#sharing-and-access]
Sessions are public by default: anyone in your organization can open one, and anyone with a connected GitHub account can prompt it. People without a connected GitHub account can prompt only read-only sessions.
**Make private** limits a session to you, the collaborators you add with **Manage collaborators**, and people with the **View all sessions** role, who can read but not prompt it. Private sessions stay out of other people's session lists and exports. A private session cannot be made public again, and anything it already posted (a pull request, a Slack reply) stays as visible as the place it was posted.
### Link to transcript text [#link-to-transcript-text]
Select text in a transcript to link to it. **Copy link** copies a URL that opens the session at that message with the text highlighted. **Add to chat** quotes the selection in your next prompt.
## What the agent can reach [#what-the-agent-can-reach]
- The repository checkout, a shell, and the network from inside the sandbox.
- GitHub, acting as you through your linked account.
- [Connectors](/connectors) you and your organization have connected, such as Linear, Notion, or Datadog.
- Other sessions you can access, so it can read an earlier session when you reference it.
- A browser it drives and you can watch or control. See [Browser](/sessions/browser).
- [Subagents and child sessions](/sessions/subagents) for parallel work.
Every new session starts with your [custom instructions](/sessions/custom-instructions), your [memories](/sessions/memories), and the repository's [instructions](/sessions/repositories). Spend is capped by your organization's [spend limits](/security/spend-limits).
## Troubleshooting [#troubleshooting]
Link GitHub in your settings, or start your own session.
The browser of an archived session is stopped. Send a prompt or unarchive the session first.
The sandbox was replaced instead of restored. Ask the agent to check `git status` and the branch;
pushed commits are intact.
# Memories (/sessions/memories)
Memories are durable notes Inspect carries from one session into the next. When you tell the agent to remember something ("always run the linter before pushing", "remember that staging uses the EU region"), it saves a memory, and future sessions you start load it automatically. Memories are personal: they belong to you and appear only in your sessions.
## Types [#types]
- A directive is guidance that should always apply. It is loaded in full into every new session.
- A fact is knowledge that is relevant only sometimes. Sessions list it by title and summary, and the agent reads the full body when it looks relevant.
Each memory has a title, a description (the summary the agent uses to decide relevance), and a Markdown body.
## How memories are created [#how-memories-are-created]
- The agent saves a directive when you ask it to remember guidance. It can also update or archive a directive it saved earlier, for example when you say a rule no longer applies.
- The agent can read facts but does not create, update, or archive them.
- You can create directives and facts with the API: `POST /api/v2/memories`.
- Read-only sessions cannot change memories.
## Manage your memories [#manage-your-memories]
Your memories are listed in [Settings → Agent](https://app.inspect.com/settings/agent) under **Memories**. Edit a memory to change its title, type, description, or body. Changing a fact to a directive applies the shorter directive limit. **Archive** removes a memory from future sessions; archived memories stay readable but are no longer loaded.
## How they load [#how-they-load]
Inspect builds the memory context once, on the first prompt of each new session you start:
- Up to 20 directives, each in full.
- Up to 50 fact summaries, most recently updated first. Older facts may be omitted.
- At most 16,000 characters in total across both.
Memories saved during a session apply from the next session on. If loading memories fails, the session starts without them rather than failing.
Sessions started with an API key load no personal memories.
## Limits [#limits]
- Title: up to 200 characters.
- Description: 10 to 420 characters.
- Directive body: up to 2,000 characters.
- Fact body: up to 20,000 characters.
- Archive reason: up to 500 characters.
## Privacy [#privacy]
Memories don't appear in other people's sessions. They are readable through the API, though: any API key in your organization with the `memories:read` scope can read memory context, including another person's memories when it passes their `user_id`. See [API keys](/api/api-keys).
## Troubleshooting [#troubleshooting]
Shorten the body, split it into separate directives, or save it as a fact.
Edit facts yourself in Settings → Agent or with the API.
Ask from a session that isn't read-only.
Check that it is active in Settings → Agent, and that you have fewer than 20 directives. Start a new
session; running sessions don't reload memories.
# Models (/sessions/models)
Every session runs on one model at a time with a reasoning effort. You pick both in the composer, save personal defaults, and administrators set the organization default and connect the providers that decide which models exist at all.
## Which models are available [#which-models-are-available]
The models you can choose come from the providers your organization has connected in [Settings → Models](https://app.inspect.com/settings/models):
- Router: every model Router lists, through one key with centralized usage and billing.
- Anthropic: Claude.
- OpenAI: GPT.
- Google Gemini: Gemini.
- xAI: Grok.
- Cerebras and Groq: supported open models with fast inference.
- Fireworks AI: Kimi, GLM, DeepSeek, and other open models.
Connect Router or one or more providers directly. At least one provider must stay enabled. When the organization has no provider connected, sessions can't start; settings stay editable.
`GET /api/v2/models` returns the models and aliases available to your API key, with each model's supported reasoning efforts.
## How a session's model is chosen [#how-a-sessions-model-is-chosen]
For a new session, Inspect uses the first of these that is available to you:
1. The model you pick in the composer, or pass as `model` to the API.
2. The custom agent's model, when the session runs a [custom agent](/agents-and-skills/custom-agents).
3. The parent session's model, for [child sessions](/sessions/subagents).
4. Your **Default model** in [Settings → Agent](https://app.inspect.com/settings/agent).
5. The organization's **Default model** in Settings → Models.
6. The Inspect default (Claude Opus 5.5, then GPT-6.1 Sol).
7. The first model your organization has available.
A follow-up prompt keeps the session's current model unless you pick another. You can switch models mid-session; a few models can be chosen only when a session starts and are disabled in the picker afterwards. Subagents always use their parent's model.
## Reasoning effort [#reasoning-effort]
Reasoning effort controls how much the model thinks before answering. The scale is **None**, **Minimal**, **Low**, **Medium**, **High**, **XHigh**, and **Max**, and each model supports a subset with its own default.
You set the effort next to the model in the composer, in your default model, and in the organization default. A saved effort applies only when it is valid for the chosen model; otherwise the model's default is used. Child sessions inherit the parent's effort unless the agent sets a different one.
## Organization defaults [#organization-defaults]
Requires the **Edit providers** role (or Admin) to change; **View providers** can read Settings → Models.
- The organization's **Default model** sets the model and reasoning effort for people who haven't saved their own. Choosing **Inspect default** leaves it to Inspect.
- Settings → Models shows how many people, automations, and custom agents have each model saved as their default. You can move everyone using one model to another in one step, choosing which of the three groups to update.
- Only models that can be defaults appear in default pickers.
## Personal default [#personal-default]
**Default model** in [Settings → Agent](https://app.inspect.com/settings/agent) applies to new sessions you start from any surface, including Slack and the API. Leaving it on the default row follows the organization default. When a newer release of your saved model is available, Inspect shows a notice suggesting it.
## Troubleshooting [#troubleshooting]
The model isn't available or can't be a default. Pick another.
Choose an effort the model lists.
That model can be chosen only when a session starts. Start a new session with it.
The model isn't available to you. Use one from the list.
# Repository builds (/sessions/repositories/build)
Repository builds install tools and dependencies into an image that Inspect can restore for new sessions. Use them for setup that would otherwise run each time an agent starts work, such as installing system packages or resolving a lockfile.
You need the Edit repositories role to change repository scripts. Managing shared scripts requires the Manage secrets role. See [Users and roles](/security/users-and-roles).
## Configure setup scripts [#configure-setup-scripts]
Open [Repositories](https://app.inspect.com/settings/repositories), select your repository, and choose Build scripts. Inspect has two repository-level scripts:
- The Pre-install script runs before cloning, with `/root` as the working directory. Use it for toolchains and other setup that does not read repository files.
- The Post-install script runs after cloning and repository image setup. Use it for dependency installation and setup that reads the checkout.
Between these scripts, Inspect clones the configured base branch and runs `.inspect/image-setup.sh` from the repository if that file exists. The image captures the resulting filesystem, including installed dependencies.
Setup scripts receive variables with the Build scope. Read credentials from [environment variables](/sessions/repositories/environment-variables) instead of embedding their values in scripts. A script can still write credentials into files that become part of the image; marking a variable Secret does not prevent that.
## Default dependency installation [#default-dependency-installation]
The default Post-install script installs dependencies only when the corresponding dependency directory is missing:
- `package.json` and `bun.lock` or `bun.lockb`: `bun install --frozen-lockfile`, then `bun install --no-cache` if needed.
- `package.json` and `package-lock.json`: `npm ci`, then `npm install` if needed.
- `package.json` and `pnpm-lock.yaml` or `yarn.lock`: warns that you must add an install command.
- `package.json` without those lockfiles: `bun install`, then `bun install --no-cache` if needed.
- `uv.lock` without `.venv`: `uv sync --frozen`.
JavaScript installation is skipped when `node_modules` exists. Each default install attempt has a 15-minute timeout. Failed installs print a warning and let the default script continue, so a successful image build does not guarantee that dependencies installed. Add the commands your repository needs when the defaults do not cover it.
## Shared scripts [#shared-scripts]
Configure reusable setup in [Environment → Build scripts](https://app.inspect.com/settings/environment/scripts). Each shared script applies to all repositories or the repositories you select. Names must be unique.
Shared scripts run in their configured order before the repository's Pre-install script. Move up and Move down change that order. Each runs in its own Bash process: files written by one script remain available to later scripts, but shell exports do not carry over. A shared script failure stops the build.
Saving a shared script does not start builds for all affected repositories. New session setup uses the updated scripts, and images pick them up on their next build. Shared scripts and repository scripts can run again during session setup, so commands must tolerate files or packages that the image already contains. During session setup, script failures produce warnings and setup continues.
If a shared script needs a credential during both image builds and session setup, give its environment variable both Build and Runtime scopes.
## Rebuilds and failures [#rebuilds-and-failures]
Saving repository scripts or repository environment variables starts a rebuild and supersedes any active build for that repository. The current published image normally remains available until the replacement is ready. Deleting a repository variable or updating an existing Secret invalidates the published image at once, because an earlier script may have persisted that value into it.
Organization environment variables and shared-script changes take effect in future builds without starting a rebuild for every repository.
Each build command has a maximum runtime of 30 minutes, further limited by the build's remaining execution budget. The build execution deadline is 2 hours 15 minutes after queuing; publishing the completed image can take additional time. A nonzero exit from a custom setup command fails the build unless the script handles that error itself.
When dependencies are missing despite a successful build, check for the default install script's warnings and whether an existing `node_modules` or `.venv` caused installation to be skipped. For an authentication failure during session setup, check that the credential has Runtime scope as well as Build scope.
# Egress secrets (/sessions/repositories/egress-secrets)
Egress secrets let an agent call an authenticated API without reading its credential. Inspect adds the secret as an HTTP header when an HTTPS request leaves the sandbox for the configured host. The sandbox receives a reference to the secret, not its value.
Use an egress secret when a tool only needs to send a credential in a request header. Use an [environment variable](/sessions/repositories/environment-variables) when a process must read the value itself.
## Permissions and scope [#permissions-and-scope]
Organization egress secrets require the Manage secrets role to view or change. They apply to all sessions, including sessions without a GitHub repository. Repository egress secrets apply to sessions using that repository; changing them requires the Edit repositories role. Users who can view repository settings can view the configured hosts and header names, but saved values are not returned.
Read-only users cannot change egress secrets. See [Users and roles](/security/users-and-roles).
## Configure an egress secret [#configure-an-egress-secret]
1. Open [Environment → Egress secrets](https://app.inspect.com/settings/environment/egress-secrets) for an organization secret. For a repository secret, open [Repositories](https://app.inspect.com/settings/repositories), select the repository, and choose Egress secrets.
2. Choose Add egress secret.
3. Set Host to the exact API hostname, such as `api.example.com`.
4. Set Header to the header the API expects, such as `Authorization`, and Value to the complete header value, such as `Bearer YOUR_TOKEN`.
5. Choose Add secret.
Secrets added through settings target HTTPS on port 443. Do not include a port in Host. Host matching is exact: `api.example.com` does not grant the same header to `example.com` or another subdomain. Wildcard hosts are not accepted.
Inspect normalizes hostnames and header names to lowercase. A repository secret takes precedence over an organization secret for the same host, port, and header. Different headers for the same host are separate secrets.
## Update or remove a secret [#update-or-remove-a-secret]
Edit a secret to change its header or replace its value. Leave New value blank to keep the stored value. You cannot move an existing secret to another host or port; add a new secret for that destination instead.
Deleting a secret stops sessions from sending it, but the proxy may continue using a cached value for up to 60 seconds.
## Limits [#limits]
- Effective secrets per session: 16, after repository overrides replace matching organization entries.
- Host: up to 253 characters; a DNS hostname, without wildcards.
- Header name: 1 to 128 characters; must be a valid HTTP header name.
- Value: nonempty, up to 8,192 bytes, without control characters or line breaks.
Inspect rejects headers that control the connection or proxy itself: `host`, `content-length`, `transfer-encoding`, `connection`, `proxy-authorization`, `proxy-authenticate`, `upgrade`, `trailer`, and `te`.
## Troubleshooting [#troubleshooting]
Confirm the request uses HTTPS, the exact configured hostname, and port 443. Check the header name
and include any required value prefix, such as `Bearer `.
Choose the API's authentication header instead of a connection or proxy header.
Edit the existing entry for that host, port, and header instead of adding a duplicate.
Remove unused entries or replace a matching organization entry with a repository override. The limit
applies to the effective combined set.
Egress secret storage is unavailable for your organization; Inspect cannot accept a new value.
# Environment variables (/sessions/repositories/environment-variables)
Environment variables supply configuration and credentials to repository builds and session processes. Organization variables provide defaults across repositories; a repository variable with the same name overrides the organization variable.
Secret variables are hidden after saving, but their values are still available to processes in the scopes you select. For HTTP credentials that must stay outside the sandbox, use [egress secrets](/sessions/repositories/egress-secrets).
## Permissions [#permissions]
- Repository variables: viewing requires the View repositories, Add repositories, or Edit repositories role. Changing them requires the Edit repositories role.
- Organization variables: viewing and changing both require the Manage secrets role.
Read-only users cannot change variables. See [Users and roles](/security/users-and-roles) for role assignment.
## Add variables [#add-variables]
1. For a repository variable, open [Repositories](https://app.inspect.com/settings/repositories), select the repository, and choose Environment variables. For a shared variable, open [Environment → Variables](https://app.inspect.com/settings/environment).
2. Enter the variable name and value.
3. Select Build, Runtime, or both, and choose Secret or Plain text.
4. Save your changes.
New variables default to Secret with Build scope. Add Runtime when the agent's session processes need the variable.
- Build: available to setup commands that create the repository image.
- Runtime: available to processes in the session sandbox, including session setup scripts.
A repository variable overrides an organization variable by name, even when their scopes differ. For example, if an organization variable has both scopes and its repository override has only Build, the organization value does not fill in Runtime. Give the override every scope you need.
## Secret and Plain text [#secret-and-plain-text]
Inspect encrypts both types in storage. Plain text values can be read back in settings; Secret values are omitted when Inspect returns the saved variable list. Leaving an existing Secret's value unchanged preserves its stored value.
You can convert Plain text to Secret. A saved Secret stays Secret in the editor; to make it Plain text, remove it and add it again. Build scripts can write variable values into image files, so a Secret setting does not by itself prevent credentials from being persisted by your scripts.
## Bulk changes [#bulk-changes]
Paste multiple `.env` assignments into a variable name field to add them together. Pasted names that already exist update those values; new names default to Secret with Build scope. Review the scopes before saving.
Select variables to use Edit scopes, Make secret, or Delete across the selection. Changes remain a draft until you save them.
## Limits and reserved names [#limits-and-reserved-names]
- Name: 1 to 200 characters; letters, digits, and underscores; cannot start with a digit.
- Value: up to 64,000 characters.
- Scopes: at least one of Build or Runtime.
- Save request: up to 500 additions or updates and 500 deletions.
Inspect rejects reserved names with “This environment variable name is reserved.” You cannot update and delete the same name in one request.
## When changes take effect [#when-changes-take-effect]
Saving repository variables supersedes an active build and starts a replacement [repository build](/sessions/repositories/build). The current image normally stays published until the new image is ready. Deleting a variable or updating an existing Secret invalidates the old image at once, since a script may have written the previous value into it.
Organization variable changes do not start builds across all repositories. Future builds resolve the updated organization values.
If a variable is missing during session setup, check Runtime scope and whether a repository override hides the organization value. A Build-only variable is not supplied as a runtime environment variable.
# Repositories (/sessions/repositories)
Adding a repository lets Inspect start sessions against its code and prepare a reusable environment with its dependencies installed. Repository configuration controls the base branch, setup scripts, and environment variables used for that work.
## Add a repository [#add-a-repository]
You need the Add repositories or Edit repositories role. The [Inspect GitHub app](/integrations/github) must have access to the repository before you add it.
1. Open [Repositories](https://app.inspect.com/settings/repositories) and choose Add repositories.
2. Select the repositories to connect, then confirm with Add repositories.
3. Inspect starts an onboarding session for each repository you add.
Inspect initializes Base branch from the repository's default branch in GitHub. You can change Base branch in repository settings with the Edit repositories role. Builds clone this branch, so it must exist in the repository.
If adding a repository fails with “Grant the Inspect GitHub app access to this repository,” check the repository URL and the GitHub app installation's repository access. Access through your personal GitHub account does not replace access for the app.
See [Users and roles](/security/users-and-roles) for repository management permissions.
## Repository instructions [#repository-instructions]
Commit repository-wide guidance in an instruction file at the repository root. Inspect selects the first readable file in this order:
1. `AGENTS.override.md`
2. `AGENTS.md`
3. `AGENTS.MD`
4. `CLAUDE.md`
5. `CLAUDE.MD`
6. `REVIEW.md`
These are alternatives, not files that Inspect combines. Inspect also loads `.inspect/AGENTS.md` when it exists. That file applies across the repository and takes precedence over conflicting guidance in the selected root file.
The agent receives the selected files as repository-scoped context, including their paths and an instruction version. An initial snapshot can come from onboarding or an image build and may be stale. Inspect refreshes instruction context from the session checkout; the agent is instructed to reread relevant guidance after branch changes or instruction-file edits. Context is restored after conversation compaction or workspace recovery rather than repeated on every message.
Each automatically loaded file has a 16 KiB limit. Inspect marks larger files as truncated and tells the agent to read the full file before relying on it. Unreadable files, files that resolve outside the repository, and files that change during the read are reported as unavailable; Inspect can fall back to the next readable root file.
For guidance that applies to a subdirectory, add a nested instruction file there. The agent looks for nested guidance along the paths it works on and applies it within that directory's scope. Nested files are discovered as needed, rather than included in the root instruction snapshot.
## Prepared environments [#prepared-environments]
Inspect can restore a prebuilt repository image instead of installing dependencies from scratch for every session. The image includes the checkout and the results of setup scripts. Configure [repository builds](/sessions/repositories/build) for toolchains and dependency installation, [environment variables](/sessions/repositories/environment-variables) for process configuration, and [egress secrets](/sessions/repositories/egress-secrets) for HTTP credentials that should stay outside the sandbox.
# Reviewing changes (/sessions/reviewing-changes)
The **Changes** tab of a session shows what the agent changed, commit by commit, while you can still redirect it with full context. Use it before a pull request exists and after.
## Read the diff [#read-the-diff]
- Changes shows the session's working-tree diff while the agent is running, and the pushed diff afterwards. Switch between unified and split views per file.
- Select a single commit to see only what it changed.
- A file's menu has **Copy link to file**, **Copy full path**, **Copy filename**, **Copy file contents**, and **Open file in GitHub**.
- Mark files **Viewed** as you go. Viewed state is yours alone, saved per session or pull request. When a later commit changes a file, its mark clears, so you only re-read what moved.
The same diff is available from the API as a raw unified diff: `GET /api/v2/sessions/{session_id}/diff`.
## Ask for revisions [#ask-for-revisions]
Select lines in the diff and click **+** to open a follow-up composer on those lines. Sending it prompts the agent right away with the commit, file, and selected lines attached, so the agent knows exactly which code you mean. Each follow-up is its own prompt; to cover several spots in one request, describe them in a single follow-up or in the session composer.
Write a revision as a decision the agent can act on ("return 404 here, not 500") instead of a question.
## Open the pull request [#open-the-pull-request]
The agent usually opens the pull request itself once its work is pushed. If the session has pushed changes without one, **Create PR** opens it.
- The pull request uses the session title and the agent's description. If Inspect cannot generate a title, it says so in the description so you can fix it.
- It opens as a draft unless the session owner turned on **Create Pull Requests as Ready for Review** in [Settings → Agent](https://app.inspect.com/settings/agent). Ask the agent to mark it ready when you want reviewers notified.
- Inspect cannot open a pull request from the repository's default branch, and it does not reuse a merged or closed pull request. After a merge, ask for more work and the agent starts a new branch and pull request.
After the pull request exists, **View PR** links to it on GitHub.
## Review, merge, and resolve conflicts [#review-merge-and-resolve-conflicts]
When the pull request is open, Changes offers GitHub actions you have permission for:
- **Submit review** / **Approve** submits a GitHub review on the pull request.
- **Merge** merges right away if the pull request is ready; otherwise it adds it to the merge queue or turns on GitHub auto-merge, depending on the repository.
- **Disable auto-merge** turns off a pending auto-merge or leaves the merge queue.
- **Fix conflicts** prompts the session to rebase its branch onto the latest base branch and resolve conflicts.
- **Fix conflicts & merge** does the same rebase, then the agent pushes, compares the diff with the pre-rebase diff, and merges only if no changes were dropped or picked up from the base branch.
- **Resolve on GitHub** opens GitHub's conflict editor.
You can also ask in the prompt ("merge it"). The agent merges only when asked.
## Deploys [#deploys]
When your deploy pipeline reports deployments of a session's pull request through the [deployments API](/api), **Deploys** appears next to **Reviews**. The API accepts `deployed` and `failed` statuses, each tagged with an optional environment name. **Deploys** lists each environment's latest status, the deployed commit, a link when one was reported, and the error for a failed deploy. A deploy of an older commit on an open pull request is marked `outdated`.
## Checks and reviews [#checks-and-reviews]
The pull request's CI checks, reviewers, and approvers appear with the session, including the [Review agent](/code-review/review-agent). **Fix CI failures** asks the session to fix failing checks. [Verification agent](/code-review/verification-agent) results are covered on their own page. How the session responds to review comments and CI failures on its own is covered in [Code review](/code-review).
## Troubleshooting [#troubleshooting]
The work was committed on the default branch. Ask the agent to create a branch and push there.
The session's pull request is finished. Ask for the new work; the agent starts a new branch from the
latest base branch.
This session can open a pull request only in its own repository. Start a child session in the other
repository.
The agent has changes but has not pushed a branch yet. Ask it to commit and push.
# Subagents and child sessions (/sessions/subagents)
Inspect can delegate part of a task in two ways. A subagent is a second agent inside the same session and sandbox. A child session is a full Inspect session with its own sandbox, branch, and pull request. Both run in the background and report back to the session that started them.
## Which one Inspect uses [#which-one-inspect-uses]
| | Subagent | Child session |
| ------------------------ | ------------------------------------------------- | ------------------------------------------------------------------------------------ |
| Workspace | Shares the parent's sandbox, files, and Git state | Its own sandbox and checkout |
| Repository | The parent's | Any onboarded repository |
| Branch and pull request | Changes land on the parent's branch | Its own branch and pull request |
| Conversation | Visible under the parent's **Agents** tab | A separate session with its own URL, linked to its parent |
| Model | The parent's model and reasoning effort | The parent's, unless the prompt names another model or you set a default child model |
| Cost | Counted in the parent session's cost | Counted on the child session |
| Can be prompted directly | No; it reports to the parent | Yes, like any session |
Inspect starts subagents for substantial, self-contained pieces that can run while it keeps working, such as writing tests while it updates docs. It starts child sessions when work needs its own pull request, belongs in another repository, or should be reviewable on its own. Ask for either explicitly ("use a subagent to…", "start a child session in `payments` to…").
## Subagents [#subagents]
- Each subagent starts with a fresh context and a brief from the parent. It does not see the parent's conversation, so the parent passes along the goal, constraints, and relevant paths.
- Subagents edit the same files the parent does. The parent assigns them work that does not overlap and reviews their result before reporting to you.
- Open a subagent from **Agents** to read its steps. You can't send it messages; prompt the parent instead.
- The API lists a session's subagents and their messages and cost: `GET /api/v2/sessions/{session_id}/subagents`. Subagents are not sessions and have no session ID of their own.
The [Verification agent](/code-review/verification-agent) runs as a subagent of the session that opened the pull request.
## Child sessions [#child-sessions]
- A child session runs as the same user as its parent and uses the repository the work concerns. When no repository applies, it uses your selected default repository.
- The parent writes the child's first prompt, including whether it should write code or only research. Each child gets a category: `research`, `parallel_work`, `continuation` (stacked or follow-on work), or `aside`.
- Children post meaningful results or blockers back to the parent automatically. The parent can send a child follow-up prompts; prompting an archived child unarchives it.
- A child can run a [custom agent](/agents-and-skills/custom-agents) and can use a different base branch for stacked pull requests.
- A child's menu has **Go to parent session**.
### Default child model [#default-child-model]
When **Default child model** is available in [Settings → Agent](https://app.inspect.com/settings/agent), it sets the model and reasoning effort for child sessions you start. **Same as parent** keeps inheritance. The setting does not apply when the prompt names a model, when a custom agent is chosen, or when the parent runs a custom agent. If the saved model is no longer available to you, children inherit the parent's model.
## Limits [#limits]
A session tree can hold at most 50 descendant sessions, counting nested children, not only direct ones. Past that, starting another child fails with `Child session limit reached`. Start new delegated work from a new top-level session.
## Troubleshooting [#troubleshooting]
Start a new top-level session for further work.
The requested model isn't available to you. Name one from the list, or omit the model.
Ask the parent to give each worker files the others don't touch, or to do the work itself.
# Writing requests (/sessions/writing-requests)
Inspect reads your prompt alongside context it gathers on its own. Knowing what it already has tells you what you need to write and what you can leave out.
## What the agent starts with [#what-the-agent-starts-with]
On the first prompt of a new session, Inspect adds:
- Your [custom instructions](/sessions/custom-instructions) from Settings → Agent.
- Your directive [memories](/sessions/memories), plus a catalog of fact memories it can look up.
- The repository's root [instruction files](/sessions/repositories) (`AGENTS.md` and its alternatives), once the checkout is ready.
- The instructions of any [skill](/agents-and-skills/skills) you invoke as `/skill-id` in the prompt, plus a manifest of the skills you have enabled.
- The custom agent's prompt, when the session runs a [custom agent](/agents-and-skills/custom-agents).
- Context from the Slack thread or Linear issue, when the session started there.
The agent searches code, runs commands, and reads your other sessions as needed. You do not need to paste file contents it can read, or decisions recorded in an earlier session; name the session or the decision and the agent can find it.
## What to put in the prompt [#what-to-put-in-the-prompt]
Write what the agent cannot discover: the outcome you want, what must not change, and how you will judge the result. Include error text, links, and identifiers verbatim.
```text
Checkout shows a blank page after the last receipt is removed (Safari, 390px wide).
Show the empty state from ReceiptsList instead. Don't change the API response.
Add a regression test.
```
Say when you want research without code changes. Inspect creates a branch and pull request only when there are changes to commit, so an investigation prompt that says "report, don't change code" ends with a written answer.
## Choose a repository [#choose-a-repository]
- Pick a repository when you know it. The agent checks out its default branch unless you choose another base branch.
- Choosing **(Auto)** infers the repository from the prompt and falls back to the repository you use most. Name the repository in the prompt when it is ambiguous.
- Choosing **Chat** starts a session with no repository.
- If the guess was wrong and the session has made no changes yet, the agent can switch the session to another onboarded repository. For work that spans repositories, it starts a [child session](/sessions/subagents) per repository.
## Attachments [#attachments]
Attach files in the composer, paste screenshots, or send files with the API's `attachments` field.
- Images are sent to the model with your prompt and also saved into the sandbox, so the agent can both see them and process the original bytes.
- Every other file is saved into the sandbox at a path the agent receives with the prompt. Zip files are saved as archives for the agent to extract.
- Files up to 10 MiB each, and 20 MiB per prompt in total, are saved before the agent starts. Larger files are not staged up front; the agent downloads the original on demand.
- The agent can fetch any file attached earlier in the same session, but not files from other sessions.
## Steer a running session [#steer-a-running-session]
You do not need to wait for a turn to finish. A prompt sent while the agent works is delivered right away and redirects the current turn. Queue a prompt instead when it should run only after the current work is done. Queued prompts can be sent early or discarded.
A follow-up you send from lines in [Changes](/sessions/reviewing-changes) includes the commit, file, and line range, so "make this a constant" is enough.
## Troubleshooting [#troubleshooting]
Tell the agent which repository to use. It switches if it has not changed anything yet; otherwise it
starts a child session there.
The file exceeded the staging limit. The agent can still download the original; ask it to.
Invoke it by exact ID with a leading slash, for example `/db-migrations`. A slash command puts the
skill's instructions in the prompt; naming it in prose leaves the agent to match it from the
manifest.
# List agents (/api/agents/listAgents)
List available agents. Returns all non-deleted agents with their basic metadata (no `prompt` or `skills` here; use `GET /api/v2/agents/{agent_id}` for full configuration). Use the returned `id` in the `agent_id` field when creating a session.
GET /api/v2/agents
# Create agent (/api/agents/createAgent)
Create a custom agent owned by the user associated with the API key. Slack app, avatar, and contributor settings are not managed by this endpoint.
POST /api/v2/agents
# Get agent (/api/agents/getAgent)
Retrieve a single agent by ID, including system `prompt`, `skills`, capabilities, and repository configuration. The list endpoint (`GET /api/v2/agents`) returns summary metadata only; use this route for full configuration. Same API key authentication as other public v1 endpoints.
GET /api/v2/agents/{agent_id}
# Update agent (/api/agents/updateAgent)
Partially update a custom agent. The API key user must be the creator, a contributor, or an Inspect admin. Only provided fields are changed.
PATCH /api/v2/agents/{agent_id}
# Archive agent (/api/agents/archiveAgent)
Archive (soft-delete) a custom agent. Archived agents are omitted from list and get responses and cannot start new sessions. The agent's Slack user group is disabled and its avatar is deleted. The API key user must be the creator, a contributor, or an Inspect admin. Archived agents cannot be restored through the API.
DELETE /api/v2/agents/{agent_id}
# List agent versions (/api/agents/listAgentVersions)
List every saved prompt version for an agent, newest first. Only the prompt is versioned; the rest of the agent's configuration is always current. The API key user must be the creator, a contributor, or an Inspect admin.
GET /api/v2/agents/{agent_id}/versions
# List artifacts (/api/artifacts/listArtifacts)
List or search published artifacts, newest first. Supports cursor pagination.
GET /api/v2/artifacts
# Create artifact (/api/artifacts/createArtifact)
Publish a link artifact. If an artifact with the same canonical URL already exists, returns it unchanged with status 200 and `meta.created: false`. Returns 400 when the URL has credentials or a local/private host.
POST /api/v2/artifacts
# Get artifact (/api/artifacts/getArtifact)
Retrieve a published artifact.
GET /api/v2/artifacts/{artifact_id}
# Update artifact (/api/artifacts/updateArtifact)
Partially update a published artifact. Returns 400 when `url` or `type` is set on a `file` or `session_replay` artifact or the URL has credentials or a local/private host, and 409 when another artifact already uses the URL.
PATCH /api/v2/artifacts/{artifact_id}
# Delete artifact (/api/artifacts/deleteArtifact)
Remove a published artifact. Artifacts produced in a session stay with that session, unpublished; others are deleted.
DELETE /api/v2/artifacts/{artifact_id}
# List automations (/api/automations/listAutomations)
List automations owned by or shared with the authenticated user. Pass `scope=all` to also include published automations and their soft forks. Supports cursor pagination.
GET /api/v2/automations
# Create automation (/api/automations/createAutomation)
Create a new automation with zero or more independently configured triggers.
POST /api/v2/automations
# Get automation (/api/automations/getAutomation)
Retrieve a single automation by ID.
GET /api/v2/automations/{automation_id}
# Update automation (/api/automations/updateAutomation)
Partially update an automation. Only provided fields are changed.
PATCH /api/v2/automations/{automation_id}
# Archive automation (/api/automations/archiveAutomation)
Soft-archive an automation. The automation is disabled and hidden from default list queries but can still be retrieved with include_archived=true.
DELETE /api/v2/automations/{automation_id}
# Trigger automation (/api/automations/triggerAutomation)
Manually trigger an automation run.
POST /api/v2/automations/{automation_id}/trigger
# List memories (/api/memories/listMemories)
List active memories in a personal scope. Memory reads are available to every Inspect API key holder.
GET /api/v2/memories
# Create memory (/api/memories/createMemory)
Create one durable memory. `personal` always targets the API key user's own scope.
POST /api/v2/memories
# Get memory context (/api/memories/getMemoryContext)
Read the active memory context for a user. Personal memories default to the API key user; pass `user_id` to read another user's context.
GET /api/v2/memories/context
# Get memory (/api/memories/getMemory)
Read one memory by id, including its canonical body, lifecycle state, and every scope it is placed in. Archived memories are returned.
GET /api/v2/memories/{memory_id}
# Update memory (/api/memories/updateMemory)
Replace the title, canonical body, discovery summary, and type of an active memory.
PATCH /api/v2/memories/{memory_id}
# Archive memory (/api/memories/archiveMemory)
Archive a stale, superseded, or no-longer-relevant memory.
POST /api/v2/memories/{memory_id}/archive
# List models (/api/models/listModels)
List available models.
GET /api/v2/models
# List repositories (/api/repositories/listRepositories)
List available repositories. System API keys see every repository available to them; user keys see their visible, non-hidden repositories.
GET /api/v2/repositories
# Create repository (/api/repositories/createRepository)
Create a repository in Inspect from a GitHub repository URL. Requires repository add permission; API keys restricted to specific repositories cannot create repositories. Returns 404 when the Inspect GitHub App cannot access the repository.
POST /api/v2/repositories
# Get repository (/api/repositories/getRepository)
Retrieve a repository and its settings.
GET /api/v2/repositories/{repository_id}
# Update repository (/api/repositories/updateRepository)
Update a GitHub repository's settings. Requires repository management permission.
PATCH /api/v2/repositories/{repository_id}
# Delete repository (/api/repositories/deleteRepository)
Delete a GitHub repository from Inspect and cancel its active environment build. Requires repository management permission.
DELETE /api/v2/repositories/{repository_id}
# Report deployment (/api/deployments/reportDeployment)
Report deployment status for one or more pull requests. Accepts normal personal or system API keys with write access and access to the repository. Only deployed and failed statuses are accepted. Each new event is notified independently, without a cross-environment completion gate. Send requests to your own Inspect origin. Idempotency keys are scoped per repository/PR, independent of the API key: retries with the same key do not record or notify again. Reuse a key only for the same event.
POST /api/v2/repositories/{owner}/{repo}/deployments
# List pull request deployments (/api/deployments/listPullRequestDeployments)
List the latest status of every environment the pull request has been deployed to.
GET /api/v2/repositories/{owner}/{repo}/pulls/{pull_request_number}/deployments
# List pull request previews (/api/previews/listPullRequestPreviews)
List the latest state of every preview reported for a pull request, as stored on the Inspect sessions currently linked to it.
GET /api/v2/repositories/{owner}/{repo}/pulls/{pull_request_number}/previews
# Delete pull request preview (/api/previews/deletePullRequestPreview)
Remove a named preview from every Inspect session linked to the pull request, for example after the preview environment is torn down.
DELETE /api/v2/repositories/{owner}/{repo}/pulls/{pull_request_number}/previews/{name}
# Report pull request preview (/api/previews/upsertPullRequestPreview)
Record the deploy status of a named preview for a pull request, typically from CI. The status is applied to every Inspect session currently linked to the pull request; sessions linked later receive the next reported status. Retries are safe: an update whose `occurred_at` is older than the stored status for the same preview is ignored. A `deploying` or `failed` status keeps the last successful URL.
PUT /api/v2/repositories/{owner}/{repo}/pulls/{pull_request_number}/previews/{name}
# List sessions (/api/sessions/listSessions)
List sessions. By default returns only sessions owned by the authenticated user. Use `all=true` to return all sessions. Private sessions are excluded from this discoverable listing unless the API key user owns or participates in them; fetch other sessions by direct session ID instead.
GET /api/v2/sessions
# Create session (/api/sessions/createSession)
Create a new Inspect session with an initial prompt. Accepts either `application/json` or `multipart/form-data`. Use multipart when you need to upload file attachments alongside the prompt; put the JSON request in the `data` field.
Supports an `Idempotency-Key` request header. When the same key is sent twice from the same API key, the second call returns the originally-created session (HTTP 200) instead of creating a new one. Keys are scoped per API key user and remain valid until the originally-created session is archived; a same-key request after archive starts a fresh session.
POST /api/v2/sessions
# Get session (/api/sessions/getSession)
Retrieve details for a specific session.
GET /api/v2/sessions/{session_id}
# Update session (/api/sessions/updateSession)
Update session metadata. Only the session owner can update a session.
PATCH /api/v2/sessions/{session_id}
# Archive session (/api/sessions/archiveSession)
Archive a session by setting its deletedAt timestamp. Archived sessions are hidden from default list queries but can still be retrieved individually or by using include_archived=true. The session can be archived by the session owner or by the API key user who originally created the session (e.g. when using on_behalf_of).
DELETE /api/v2/sessions/{session_id}
# Get session cost (/api/sessions/getSessionCost)
Best-effort refresh the session durable-object export and return the latest persisted token totals and cost for a specific session. This can be used while a session is still running, without waiting for the scheduled export job. Laminar-runtime sessions return Laminar usage totals, including the usage of the session's subagents such as Verification agent runs, and messageCount is always 0 for them. Use GET /sessions/{session_id}/subagents/{subagent_id}/cost for a single subagent's usage. A Laminar-runtime session that was never bound to a Laminar session returns zero totals.
GET /api/v2/sessions/{session_id}/cost
# Get session diff (/api/sessions/getSessionDiff)
Retrieve the raw unified diff for an authorized Inspect session. The endpoint is session-scoped and does not accept arbitrary diff file IDs. Pending or running sessions return the local working-tree diff when one is available; otherwise the stored authoritative session diff is returned.
GET /api/v2/sessions/{session_id}/diff
# List session messages (/api/sessions/getSessionMessages)
Retrieve all messages for a specific session, including user prompts and assistant responses. Laminar-runtime sessions return the same message shape, projected from the Laminar transcript. If the Laminar transcript exceeds the read limits, the response contains the latest history only and has the header `X-Inspect-Transcript-Truncated: true`.
GET /api/v2/sessions/{session_id}/messages
# Send prompt (/api/sessions/sendPrompt)
Send a follow-up prompt to an existing session. Accepts either `application/json` or `multipart/form-data` (JSON request in the `data` field, files in `attachments`). By default prompts are delivered immediately. Set `delivery` to `queued` to enqueue the prompt behind active or outstanding work. If the session has no outstanding prompts, the prompt is delivered immediately and `queued_prompt` is omitted, restarting a dormant sandbox when necessary. Prompts that remain queued may not appear in `/messages` until they are released and processed.
POST /api/v2/sessions/{session_id}/prompt
# Stop session (/api/sessions/stopSession)
Interrupt the session's active turn without archiving it. Cancels any queued prompts and sets the session status to `finished`, but leaves `deletedAt` untouched — so a session that was previously archived and resumed can still be stopped. No-ops (returns the current session) when the session is not running. The session can be stopped by the session owner or by the API key user who originally created the session (e.g. when using on_behalf_of).
POST /api/v2/sessions/{session_id}/stop
# List session subagents (/api/sessions/listSessionSubagents)
List the subagents of a session, newest first, including Verification agent runs Inspect started for it. Subagents are not sessions: read them through the subagent endpoints of their parent session. Sessions without a Laminar runtime return an empty list.
GET /api/v2/sessions/{session_id}/subagents
# Get session subagent cost (/api/sessions/getSessionSubagentCost)
Return the token totals and cost of a subagent of the session, including its own subagents. `sessionId` is the subagent ID and messageCount is always 0. Returns 404 when the subagent does not belong to the session.
GET /api/v2/sessions/{session_id}/subagents/{subagent_id}/cost
# List session subagent messages (/api/sessions/getSessionSubagentMessages)
Retrieve the messages of a subagent of the session, in the same shape as GET /sessions/{session_id}/messages. Returns 404 when the subagent does not belong to the session. If the transcript exceeds the read limits, the response contains the latest history only and has the header `X-Inspect-Transcript-Truncated: true`.
GET /api/v2/sessions/{session_id}/subagents/{subagent_id}/messages
# Replace session tags (/api/sessions/updateSessionTags)
Replace the set of tags that the API key's user has applied to a session. Tags are scoped per user: this endpoint only affects tags added by the calling API key's user and never modifies tags added by the session owner or anyone else. Passing an empty array removes all of the caller's tags from the session. The operation is idempotent, making it suitable for pipelines that periodically reconcile labels onto sessions. Find sessions by these tags with `GET /sessions?tag=...&tagged_by=`.
PUT /api/v2/sessions/{session_id}/tags
# Update session base branch (/api/sessions/updateSessionBaseBranch)
Update the base branch for a session's first repository. The branch must exist in the session repository. If the session already has an open pull request, its base branch is updated on GitHub as well. Only the session owner can update the base branch. Returns 400 when the branch or repository is invalid (including a branch that does not exist), 409 when the session's pull request is merged or closed, 502 when updating the pull request on GitHub fails, and 500 when the new base branch could not be saved.
POST /api/v2/sessions/{session_id}/update-base-branch
# Start session verification (/api/sessions/startSessionVerification)
Start or rerun the Verification agent on the current head of the session's pull request. A new run supersedes any older run for that pull request. Runs even when the session owner has turned off automatic Verification agent runs, as long as the repository configures verification at `.inspect/verification/config.yml`. The session owner or the API key user who originally created the session can start a run; read-only API keys cannot start runs in writable sessions. Returns 202 when a run started or was already running, 400 when the session has pull requests in multiple repositories and no repository was given, and 409 with a `verification_*` code when no run started.
POST /api/v2/sessions/{session_id}/verification
# List skills (/api/skills/listSkills)
List active skills in the catalog, including built-in skills. Filter by a case-insensitive `query` that matches the skill ID or description. Use `GET /api/v2/skills/{skill_id}` for skill files.
GET /api/v2/skills
# Create skill (/api/skills/createSkill)
Create a skill owned by the API key user. Provide either `content` (the `SKILL.md` body) or `files` (the complete file set, which must include `SKILL.md`). Creating a skill with the ID of an archived skill restores it; only its original owner or an admin can do this.
POST /api/v2/skills
# Get skill (/api/skills/getSkill)
Retrieve an active skill, including every file, its owner, and its collaborators.
GET /api/v2/skills/{skill_id}
# Update skill (/api/skills/updateSkill)
Update or rename a skill. Omitted fields are unchanged. `files` replaces the complete file set and must include `SKILL.md`; `content` replaces only `SKILL.md`. Renaming updates references from user settings and custom agents. Only the owner, a collaborator, or an admin can update a skill; built-in skills are read-only.
PATCH /api/v2/skills/{skill_id}
# Archive skill (/api/skills/archiveSkill)
Archive a skill so it no longer appears in the catalog or loads for agents. Only the owner, a collaborator, or an admin can archive a skill; built-in skills cannot be archived.
DELETE /api/v2/skills/{skill_id}
# Get user preferences (/api/user/getUserPreferences)
Retrieve the authenticated user's preferences, including their default model and agent.
GET /api/v2/user/preferences