# Set agent policy

`PUT https://api.instacloud.com/projects/{projectId}/agent-policy`

**Token scope:** `account` · `org` · `project` — read-only tokens refused (not a GET).

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | `string` | yes |  |

## Request body (application/json)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `mode` | `"full_access" \| "read_only" \| "branch_specific" \| "customize" \| "branch_developer"` | yes |  |
| `protectedBranchIds` | `string[]` | yes |  |
| `rules` | `object` | no |  |
| `branchDeveloperRules` | `object` | no |  |
| `updatedBy` | `string` | no |  |
| `updatedAt` | `string` | no |  |

## Response 200

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `policy` | `object` | yes |  |
| `policy.mode` | `"full_access" \| "read_only" \| "branch_specific" \| "customize"` | yes |  |
| `policy.protectedBranchIds` | `string[]` | yes |  |
| `policy.rules` | `object` | yes |  |
| `policy.branchDeveloperRules` | `object` | yes |  |
| `policy.updatedBy` | `string` | no |  |
| `policy.updatedAt` | `string` | no |  |

## Response 202

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | yes |  |
| `approvalId` | `string` | yes |  |
| `action` | `string` | yes |  |
| `actions` | `string[]` | yes |  |
| `message` | `string` | yes |  |
| `url` | `string` | yes |  |

## Response 403

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes |  |
