> ## 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.

# Delete a delegation

> Delete an Agent Vault delegation with the Python SDK.

`client.agent_vault.delegations.delete()` stops a machine identity from creating sessions on behalf of users. The client must log in as a user or machine identity with the **Admin** role in the [Agent Vault project](https://infisical.com/docs/documentation/platform/agent-vault/access-control#product-membership).

The proxy refuses the sessions that the machine identity already created on behalf of users until a delegation covers those users again. To end those sessions for good, [revoke them](https://infisical.com/docs/sdks/languages/python/agent-vault/revoke-session.md).

## Parameters

**project\_id** `str` *required*

The ID of the [Agent Vault project](https://infisical.com/docs/documentation/platform/agent-vault/projects.md#find-the-project-id) to delete the delegation from.

**machine\_identity\_id** `str` *required*

The ID of the machine identity.

## Returns

**delegation** `AgentVaultDelegation`

The deleted delegation, with `missingAccessBundles` set to `None`.

```python Basic theme={"dark"}
delegation = client.agent_vault.delegations.delete(
    project_id="<project-id>",
    machine_identity_id="<machine-identity-id>",
)
```

```json Response theme={"dark"}
{
  "machineIdentity": {
    "id": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
    "name": "deploy-bot"
  },
  "scope": "selected",
  "users": [],
  "groups": [
    {
      "id": "9f8e7d6c-5b4a-4392-8170-6f5e4d3c2b1a",
      "name": "platform-team",
      "addedAt": "2026-12-02T13:00:00.000Z",
      "missingAccessBundles": null
    }
  ],
  "missingAccessBundles": null,
  "createdAt": "2026-11-20T10:00:00.000Z",
  "updatedAt": "2026-12-02T13:10:00.000Z"
}
```


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