---
question: Does deleting an agent in Settings remove it from its module?
kind: task
via_web: available
via_cli: na
via_python: available
via_api: available
via_config: na
ref_web: Settings › Agents
ref_python: ABIModule.agents
ref_api: DELETE /api/agents/{id}
next:
  - /capabilities/build/agents/enable-in-a-workspace
  - /capabilities/build/agents/creating-an-agent
---

# Delete an agent

Deleting a workspace agent removes its record for good. A module agent is published by its module: Nexus keeps one record of it per workspace and creates it again at that workspace's next [sync](/capabilities/build/agents/enable-in-a-workspace#when-a-workspace-syncs) while the module publishes it. To stop offering a module agent in a workspace, turn it off instead; for the default agent, change `default_agent` first, since every sync turns it back on. To remove a module agent, take it out of its module.

## Web UI

### Open the agent list

In the workspace, open Settings › Agents.

### Delete the row

Click the trash icon (**Delete**) on the agent's row, then **Delete** in the **Delete agent?** dialog.

A workspace agent is gone. A module agent comes back at the workspace's next [sync](/capabilities/build/agents/enable-in-a-workspace#when-a-workspace-syncs) while its module publishes it: [turn it off](/capabilities/build/agents/enable-in-a-workspace) to hide it, or take it out of its module.

![Workspace Settings on Agents, enabled agents](/abi/Screenshot_Agents.png)

*Settings › Agents, filtered to enabled agents. The trash icon in Actions deletes a row.*

## CLI

Not applicable. No `abi` command deletes an agent: take it out of its module, as in the Python steps.

## Python

### Take it out of the module

In the module's `__init__.py`, remove its `AgentDescriptor` from `agents` and its `expose_agent` call from `on_initialized`, then delete its file:

```bash
rm src/research/agents/ReviewerAgent.py
```

Remove what refers to it too: a tool list another agent builds from it, a `default_agent` or workspace `agents:` entry in `config.yaml`.

### Restart the module

```bash
abi dev down --service research
abi dev up -d --service research
```

Discovery then no longer lists the agent. Each workspace turns its record off at its next [sync](/capabilities/build/agents/enable-in-a-workspace#when-a-workspace-syncs) and keeps it, off; delete the record in Settings › Agents or with the REST API to remove it from the list.

## REST API

### Delete the record

```http
DELETE /api/agents/{id}
```

`{id}` is the agent's id from `GET /api/agents/?workspace_id=<id>`. Auth: a Nexus session with access to the workspace. The response is `{"status": "deleted"}`.

As in the Web UI, the record of a module agent is created again by the workspace's next sync (such as `POST /api/agents/sync?workspace_id=<id>`) while its module publishes it. To hide it, send `PATCH /api/agents/{id}` with `{"enabled": false}`; the default agent is turned back on at each sync.

## Config

Not applicable: `config.yaml` does not define a module's agents. To hide one agent, leave it out of the workspace's `agents:` list ([Enable in a workspace](/capabilities/build/agents/enable-in-a-workspace?via=config)).
