---
# @generated by sylphx-gen 0.1.0 from contracts@3118f36f16f799965338811e17ed3a9f565a9f136b14c95e9c94a1e21d42ea3e. Do not edit.
title: "Interrupt an agent session"
description: "`agents.agent_sessions.interrupt` (POST /v1/{name}:interrupt): Stops the running turn at its current step."
type: reference
product: agents
summary: "Stops the running turn at its current step."
updated: 2026-09-28
nav: false
---

Stops the running turn at its current step. Calls already made keep their results; the session becomes idle. A no-op on an idle session.

**Not available yet.** Sylphx Agents is declared in the registry but no backend serves it: every call answers `501` with the problem code `UNIMPLEMENTED`.

- **Path** `POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/agent_sessions/agent-session:interrupt`
- **Scope** `agents:sessions`
- **Effect** `write` — a successful call changes state.
- **Collection** [agent_sessions](/docs/api/agent_sessions)

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | The name of the session. Required. |
| `reason` | `string` | Why, recorded on the status event; at most 500 characters. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | `orgs/{org}/projects/{project}/envs/{env}/agent_sessions/{agent_session}`. |
| `uid` | `string` | `ases_<cell><ulid>`; never reused. Output only. |
| `meta` | `ResourceMeta` | Resource metadata. |
| `agent` | `string` | The Agent the session talks to. Required. |
| `agent_version` | `string` | The AgentVersion the session pinned; the Agent's current version when unset at create. |
| `end_user` | `string` | The Sylphx Auth end user the session belongs to, set from the caller's end-user session; empty for a session a secret key started. An end user reads and changes only their own sessions. Output only. |
| `title` | `string` | A short title; set by the caller or summarised by the runtime. |
| `state` | `SessionState` | The session's state. Output only. One of `idle`, `running`, `awaiting_approval`, `awaiting_client`, `failed`. |
| `turn_count` | `int64` | The number of turns started, from 0. Output only. |
| `last_event_sequence` | `int64` | The sequence of the newest event, from 0. Output only. |
| `create_time` | `timestamp` | When the session was created. Output only. |
| `update_time` | `timestamp` | When the last event was appended. Output only. |
| `usage` | `SessionUsage` | What the session has used so far. Output only. |
| `environment_lease` | `string` | The Sylphx Sandboxes lease attached to the session, while it has one. Output only. |
| `environment` | `EnvironmentSpec` | The environment for this session; when omitted, use the pinned Agent version's default. An explicit value replaces that default. |
| `credentials` | `map<string, CredentialBinding>` | Session-scoped credential bindings, keyed by the tool or MCP credential name. Values are references or opaque handles, never secret values. |
| `profiles` | `ProfileMount[]` | Granted platform Profiles to mount when the session starts, each by resource name and mode. The runtime never puts profile values in events. |

### ResourceMeta

| Field | Type | What it is |
| --- | --- | --- |
| `generation` | `int64` | Increases by one on every change to `spec`. Output only. |
| `etag` | `string` | Strong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as `If-Match` or `etag` to make Update and Delete conditional; a mismatch fails with ABORTED / 409 `ETAG_MISMATCH`. Output only. |
| `create_time` | `timestamp` | When the Resource was created. Output only. |
| `update_time` | `timestamp` | When the Resource last changed. Output only. |
| `delete_time` | `timestamp` | Set while the Resource is being deleted. Output only. |
| `labels` | `map<string, string>` | Caller-writable, indexed labels (AIP-122 label rules). |
| `annotations` | `map<string, string>` | Caller-writable, unindexed annotations. |
| `display_name` | `string` | Caller-writable human-readable name. |
| `creator` | `string` | The principal that created the Resource. Output only. |

### SessionUsage

| Field | Type | What it is |
| --- | --- | --- |
| `active_turn_duration` | `duration` | Time turns were active. Output only. |
| `gateway_calls` | `int64` | Tool calls made through the gateway. Output only. |
| `spend_micros` | `int64` | Spend so far in micro-USD, models and tools together. Output only. |

### EnvironmentSpec

| Field | Type | What it is |
| --- | --- | --- |
| `shape` | `string` | A Sylphx Sandboxes shape; empty gives sessions no environment. |
| `idle_standby` | `duration` | Put the environment in standby after this long idle, 1m to 24h; default 10m. |
| `template` | `string` | The Sandboxes image: `template:<name>` or an artifact image by digest, passed unchanged to the lease's `image` field. |
| `repo` | `RepositorySpec` | The repository to prepare inside the fresh lease, if any. |
| `egress` | `LeaseNetwork` | The lease's outbound policy, using the Sandboxes network contract. |
| `budget` | `LeaseBudget` | The lease's CPU and cost ceiling, separate from model and tool spend. |
| `ttl` | `duration` | The lease's maximum wall time, passed to Sandboxes as `ttl`. The lease is released when the session ends even if this bound has not been reached. |

### CredentialBinding

| Field | Type | What it is |
| --- | --- | --- |
| `secret` | `string` | A Kernel Secret of this environment, by name. One of the `source` group. |
| `connection` | `string` | A Kernel Connection (a third-party OAuth installation), by name. One of the `source` group. |
| `end_user_provider` | `string` | The end user's own grant in Sylphx Auth's agent token vault, by provider id; the session's end user must hold it. One of the `source` group. |
| `placement` | `string` | How the value is sent: `bearer` (default), `header:<Name>` or `query:<name>`. |
| `handle` | `string` | An opaque credential handle issued for this session, resolved only at egress. This is never a credential value. One of the `source` group. |

### ProfileMount

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | `orgs/{org}/projects/{project}/envs/{env}/profiles/{profile}`. Required. |
| `mode` | `string` | `read_only` (default) or `write_back`. Only a write_back grant saves changes at session end while its lease still answers; empty is read_only. |

### RepositorySpec

| Field | Type | What it is |
| --- | --- | --- |
| `uri` | `string` | The repository URI. Access uses the session's bound credential handles. Required. |
| `revision` | `string` | The commit or ref to check out; empty uses the repository's default branch. |

### LeaseNetwork

| Field | Type | What it is |
| --- | --- | --- |
| `egress` | `EgressPolicy` | Default ALLOW. One of `allow`, `deny`, `allowlist`. |
| `allowed_domains` | `string[]` | Hosts reachable when `egress` is ALLOWLIST: exact names or one leading `*.` wildcard label, for example `api.openai.com`, `*.github.com`. |
| `allowed_cidrs` | `string[]` | Public CIDRs reachable when `egress` is ALLOWLIST. |
| `blocked_cidrs` | `string[]` | The ranges blocked under every policy. Output only. |

### LeaseBudget

| Field | Type | What it is |
| --- | --- | --- |
| `max_cpu_seconds` | `int64` | End CPU_BUDGET after this many vCPU-seconds of guest CPU time. |
| `max_cost_micros` | `int64` | End COST_BUDGET once the shape's list price times wall seconds reaches this many millionths of a US dollar. |

## Errors

- [`UNAUTHENTICATED`](/docs/api/errors/UNAUTHENTICATED) — No valid key or token was presented.
- [`PERMISSION_DENIED`](/docs/api/errors/PERMISSION_DENIED) — The key lacks the method's permission.
- [`RESOURCE_NOT_FOUND`](/docs/api/errors/RESOURCE_NOT_FOUND) — The named Resource does not exist or is not visible.
- [`INVALID_FIELD`](/docs/api/errors/INVALID_FIELD) — A field failed validation.
- [`INVALID_STATE`](/docs/api/errors/INVALID_STATE) — The Resource is in a state that forbids the call.
- [`IDEMPOTENCY_KEY_REUSED`](/docs/api/errors/IDEMPOTENCY_KEY_REUSED) — An Idempotency-Key was reused with another body.
- [`IDEMPOTENCY_IN_PROGRESS`](/docs/api/errors/IDEMPOTENCY_IN_PROGRESS) — The first call with this Idempotency-Key is still running.

Every error arrives in the body [Errors](/docs/platform/errors) describes.

## Examples

**cURL**

```curl
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/agent_sessions/agent-session:interrupt" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

**TypeScript**

```ts
const response = await sylphx.agents.agentSessions.interrupt({ name: 'orgs/acme/projects/shop/envs/production/agent_sessions/agent-session' })
```

**Rust**

```rust
let mut req = sylphx::agents::InterruptAgentSessionRequest::default();
req.name = "orgs/acme/projects/shop/envs/production/agent_sessions/agent-session".to_string();
let response = sx.agents().agent_sessions().interrupt(req).await?;
```

**CLI**

```bash
sylphx agents agent-sessions interrupt orgs/acme/projects/shop/envs/production/agent_sessions/agent-session
```

**MCP**

```json
{ "method_id": "agents.agent_sessions.interrupt", "args": {"name":"orgs/acme/projects/shop/envs/production/agent_sessions/agent-session"} }
```
