> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.adid.dev/llms.txt.
> For full documentation content, see https://docs.adid.dev/llms-full.txt.

# Agent Detail & Lifecycle

#### When to use

Day-to-day inspection of one agent — its capabilities, delegations, audit log, and trust trajectory.

#### Before you begin

* The agent DID.
* (For lifecycle actions) you are the principal or have admin role.

#### Steps

1. Navigate to `/agents/<did>`.
   2\. The page has six tabs:

| Tab                  | Endpoint(s)                                  | Purpose                                  |
| -------------------- | -------------------------------------------- | ---------------------------------------- |
| **Overview**         | `GET /agents/{did}`                          | Identity, autonomy, trust, capabilities. |
| **Delegations**      | `GET /agents/{did}/delegations`              | Active IBCTs to/from this agent.         |
| **Delegation chain** | `GET /agents/{did}/delegation-chain`         | Full provenance back to a human.         |
| **Credentials**      | `GET /agents/{did}/credentials`              | VCs the agent holds.                     |
| **Audit log**        | `GET /agents/{did}/audit-log`                | Per-action audit trail.                  |
| **Settings**         | `PUT /agents/{did}` / `DELETE /agents/{did}` | Update or decommission.                  |

#### API surface

All under `/api/v1/agents/{did}` (registered at `router.go:130–143`):

| Endpoint                          | Verb   | Purpose                                                                                   | Handler        |
| --------------------------------- | ------ | ----------------------------------------------------------------------------------------- | -------------- |
| `/agents/{did}`                   | GET    | Detailed agent profile (always returns the detailed view via handler `agent.GetDetailed`) | `agent.go:307` |
| `/agents/{did}`                   | PUT    | Update agent (capabilities, autonomy, endpoints)                                          | `agent.go:79`  |
| `/agents/{did}`                   | DELETE | Decommission (soft-delete; DID is deactivated)                                            | `agent.go:129` |
| `/agents/{did}/delegate`          | POST   | Mint a new IBCT *from* this agent to a sub-agent                                          | `agent.go:166` |
| `/agents/{did}/verify-delegation` | POST   | Validate an inbound IBCT                                                                  | `agent.go:203` |
| `/agents/{did}/audit-log`         | GET    | Query audit log                                                                           | `agent.go:232` |
| `/agents/{did}/delegations`       | GET    | List active delegations                                                                   | `agent.go:402` |
| `/agents/{did}/delegation-chain`  | GET    | Full chain to root principal                                                              | `agent.go:474` |
| `/agents/{did}/credentials`       | GET    | List VCs held                                                                             | `agent.go:521` |

#### Decommissioning

```bash
curl -X DELETE https://adid.dev/api/v1/agents/did:adi:0xAgent... \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

(`agent.go:129`.) The agent DID is deactivated, all outstanding IBCTs become invalid, and the AgentTrustRegistry status flips to `decommissioned`.

> ⚠️ **Warning** — Decommissioning is irreversible. Existing audit-log entries remain (auditability), but the agent cannot perform new actions. Plan a graceful shutdown first.

#### Verify

After decommissioning, `GET /agents/{did}` returns `status: "decommissioned"`. Inbound `verify-delegation` calls return `allowed: false`.