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

# Update session label and metadata

> Change an Agent Vault session's label and metadata with the Python SDK.

`client.agent_vault.sessions.update()` adds, changes, or removes a session's label or metadata, for example to record what the agent is working on. You can change them after the session expires or is revoked, unless someone deleted the session's owner or the user that the session was created on behalf of.

## Parameters

**session\_id** `str` *required*

The ID of the session.

**label** `Optional[str]`

The new label, or `None` to remove the label (up to 128 characters, without line breaks, tabs, or invisible characters; leave it out to keep the current label).

**metadata** `Dict[str, str]`

The new [metadata](https://infisical.com/docs/documentation/platform/agent-vault/sessions#label-a-session-and-add-metadata), which replaces all of it, or `{}` to remove it (up to 20 keys, each key up to 255 characters and each value 1 to 1020, without line breaks, tabs, or invisible characters, and no `=` in a key; leave it out to keep the current metadata).

## Returns

**session** `AgentVaultSession`

The updated session.

```python Basic theme={"dark"}
session = client.agent_vault.sessions.update(
    session_id="<session-id>",
    label="support ticket triage",  # Optional
    metadata={"ticket": "OPS-142"},  # Optional
)
```

```python Remove the label theme={"dark"}
session = client.agent_vault.sessions.update(
    session_id="<session-id>",
    label=None,
)
```

```json Response theme={"dark"}
{
  "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
  "label": "support ticket triage",
  "actor": {
    "type": "machineIdentity",
    "id": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
    "name": "deploy-bot"
  },
  "onBehalfOf": null,
  "status": "active",
  "expiresAt": "2026-12-02T13:00:00.000Z",
  "revokedAt": null,
  "createdAt": "2026-12-02T12:00:00.000Z",
  "accessBundle": {
    "id": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
    "name": "release"
  },
  "services": [],
  "metadata": { "ticket": "OPS-142" }
}
```


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