# Get the policy

> Get the policy assigned to the agent.

`GET /v1/agent-api/policy`

## Responses

| Status | Description        |
| ------ | ------------------ |
| `200`  | Assigned policy    |
| `404`  | No policy assigned |

## Response fields

| Field                  | Type                     | Required | Description                                                                                                                                             |
| ---------------------- | ------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `policy`               | object                   | Yes      |                                                                                                                                                         |
| `policy.id`            | string                   | Yes      |                                                                                                                                                         |
| `policy.name`          | string                   | Yes      |                                                                                                                                                         |
| `policy.description`   | string                   | Yes      |                                                                                                                                                         |
| `policy.capabilities`  | array of string          | Yes      |                                                                                                                                                         |
| `policy.accountAccess` | object or null           | Yes      | Accounts the policy permits for each capability; null when the policy is invalid                                                                        |
| `policy.rules`         | object or null           | Yes      | Every rule that limits sends and transfers, each scoped to one account or to all of the capability's accounts together; null when the policy is invalid |
| `policy.invalidReason` | string or null           | Yes      | Why the stored policy cannot be read as account access and scoped rules; null when it can                                                               |
| `policy.version`       | number                   | Yes      |                                                                                                                                                         |
| `policy.kind`          | `"base"` \| `"override"` | Yes      |                                                                                                                                                         |
| `policy.expiresAt`     | string                   |          |                                                                                                                                                         |

## Example

### SDK

```ts
import { createCatenaClient } from "@catena/sdk"

// Reads CATENA_SECRET_KEY
const client = createCatenaClient()

const policy = await client.getPolicy()
```

### CLI

```sh
catena policy show
```

### Response `200`

```json
{
  "policy": {
    "id": "pol_01JC2Y5N2Q4S6U8W0Y3A5C7E9G",
    "name": "Accounts payable",
    "description": "Pay approved vendors from the operating account.",
    "capabilities": ["read", "send"],
    "accountAccess": {
      "read": ["acct_01JC2Y6ZQ8R4M7N9P3S5T6V8WX"],
      "send": ["acct_01JC2Y6ZQ8R4M7N9P3S5T6V8WX"],
      "transfer": []
    },
    "rules": {
      "send": [
        {
          "id": "rule_01JC2Y5P8R1T3V5X7Z9B2D4F6H",
          "scope": {
            "accounts": {
              "type": "all"
            },
            "counterparties": {
              "type": "all"
            }
          },
          "limit": {
            "type": "per_transaction_amount",
            "threshold": {
              "amount": "2000.00",
              "assetId": "USD"
            }
          },
          "action": {
            "type": "require_approval",
            "requiredApprovals": 1
          }
        },
        {
          "id": "rule_01JC2Y5Q2S4U6W8Y0A3C5E7G9J",
          "scope": {
            "accounts": {
              "type": "all"
            },
            "counterparties": {
              "type": "all"
            }
          },
          "limit": {
            "type": "daily_amount",
            "threshold": {
              "amount": "25000.00",
              "assetId": "USD"
            }
          },
          "action": {
            "type": "block"
          }
        }
      ],
      "transfer": []
    },
    "invalidReason": null,
    "version": 3,
    "kind": "base"
  }
}
```
