# Autonomy policies and intent compilation

Paths on this page are relative to <code>/api/liquidity-studio/v2</code>. Authentication and required headers vary by operation.

[API reference overview](/api-reference/overview/) · [OpenAPI download](/openapi/liquidity-operating-system-v2.openapi.json)

## Operations on this page

| Method | Path | Operation |
| --- | --- | --- |
| <code>GET</code> | <code>/autonomy-policies</code> | [listAutonomyPolicies](#listAutonomyPolicies) |
| <code>POST</code> | <code>/autonomy-policies</code> | [createAutonomyPolicies](#createAutonomyPolicies) |
| <code>GET</code> | <code>/autonomy-policies/{id}</code> | [getAutonomyPolicies](#getAutonomyPolicies) |
| <code>PATCH</code> | <code>/autonomy-policies/{id}</code> | [supersedeAutonomyPolicies](#supersedeAutonomyPolicies) |
| <code>GET</code> | <code>/policy-intent-drafts</code> | [listPolicyIntentDrafts](#listPolicyIntentDrafts) |
| <code>POST</code> | <code>/policy-intent-drafts</code> | [createPolicyIntentDrafts](#createPolicyIntentDrafts) |
| <code>GET</code> | <code>/policy-intent-drafts/{id}</code> | [getPolicyIntentDrafts](#getPolicyIntentDrafts) |
| <code>POST</code> | <code>/policy-intent-drafts/{id}/compile</code> | [compilePolicyIntent](#compilePolicyIntent) |
| <code>POST</code> | <code>/policy-intent-drafts/structured</code> | [createStructuredPolicyIntentDraft](#createStructuredPolicyIntentDraft) |
| <code>POST</code> | <code>/policy-checks</code> | [checkAutonomyPolicy](#checkAutonomyPolicy) |

<a id="listAutonomyPolicies"></a>

## List autonomy policies

`GET /autonomy-policies`

Operation ID: <code>listAutonomyPolicies</code>

**Authentication:** <code>&#95;&#95;Host-klineo&#95;session</code> cookie (<code>sessionCookie</code>)

### Parameters

| Name | Location | Required | Type | Description and constraints |
| --- | --- | --- | --- | --- |
| <code>x-klineo-organization-id</code> | header | Yes | <code>string</code> | — |
| <code>cursor</code> | query | No | <code>string</code> | Opaque cursor returned in the previous response metadata. |
| <code>limit</code> | query | No | <code>integer</code> | Default: <code>50</code>; Minimum: <code>1</code>; Maximum: <code>100</code> |

### Responses

| Status | Description | Content type and schema |
| --- | --- | --- |
| <code>200</code> | Latest tenant-isolated aggregate versions | <code>application/json</code>: <code>object</code> |

**<code>200</code> <code>application/json</code> body**

<code>object</code> — Additional properties rejected

| Field | Required at this level | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>data</code> | Yes | Array of All of: [RecordEnvelope](/api-reference/schemas/record-envelope/); <code>object</code> | — |
| <code>data&#91;&#93;.allOf&#91;2&#93;.payload</code> | Yes | [AutonomyPolicy](/api-reference/schemas/autonomy-policy/) | — |
| <code>meta</code> | Yes | <code>object</code> | Additional properties rejected |
| <code>meta.count</code> | Yes | <code>integer</code> | Minimum: <code>0</code> |
| <code>meta.hasMore</code> | Yes | <code>boolean</code> | — |
| <code>meta.nextCursor</code> | No | <code>string</code> | — |

Nested required fields apply when their parent object or matching union branch is present. Named types link to their complete schema.

<a id="createAutonomyPolicies"></a>

## Create or expand autonomy using server-reconciled exact v2 Safe-envelope evidence

`POST /autonomy-policies`

Operation ID: <code>createAutonomyPolicies</code>

**Authentication:** <code>&#95;&#95;Host-klineo&#95;session</code> cookie (<code>sessionCookie</code>)

**Conditional version precondition:** <code>A current policy already exists for payload.vaultId.</code>

### Parameters

| Name | Location | Required | Type | Description and constraints |
| --- | --- | --- | --- | --- |
| <code>Idempotency-Key</code> | header | Yes | <code>string</code> | Min length: <code>8</code>; Max length: <code>160</code> |
| <code>x-klineo-organization-id</code> | header | Yes | <code>string</code> | — |
| <code>If-Match</code> | header | No | <code>string</code> | Pattern: <code>^"&#91;^"&#92;&#92; &#93;+"$</code> |

### Request body

Required: **yes**.

**<code>application/json</code>**

<code>object</code> — Additional properties rejected

| Field | Required at this level | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>payload</code> | Yes | [AutonomyPolicyInput](/api-reference/schemas/autonomy-policy-input/) | — |
| <code>status</code> | No | [OperatingSystemRecordStatus](/api-reference/schemas/operating-system-record-status/) | — |
| <code>evidenceHashes</code> | No | Array of [Hash](/api-reference/schemas/hash/) | Max items: <code>256</code> |
| <code>reason</code> | Yes | <code>string</code> | Min length: <code>3</code>; Max length: <code>500</code> |

Nested required fields apply when their parent object or matching union branch is present. Named types link to their complete schema.

### Responses

| Status | Description | Content type and schema |
| --- | --- | --- |
| <code>201</code> | Policy admitted with server-derived approval time and Safe transaction hash where authority expands | <code>application/json</code>: <code>object</code> |
| <code>400</code> | Caller supplied derived Safe proof fields or policy validation failed | No response body declared |
| <code>401</code> | Authority expansion requires recent interactive reauthentication | No response body declared |
| <code>409</code> | Signed release or exact finalized/reconciled v2 Safe envelope is unavailable | No response body declared |

**<code>201</code> <code>application/json</code> body**

<code>object</code> — Additional properties rejected

| Field | Required at this level | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>data</code> | Yes | Exactly one of: All of: [RecordEnvelope](/api-reference/schemas/record-envelope/); <code>object</code>; <code>object</code> | — |
| <code>data.oneOf&#91;1&#93;.allOf&#91;2&#93;.payload</code> | Yes | [AutonomyPolicy](/api-reference/schemas/autonomy-policy/) | — |
| <code>data.oneOf&#91;2&#93;.policy</code> | Yes | All of: [RecordEnvelope](/api-reference/schemas/record-envelope/); <code>object</code> | — |
| <code>data.oneOf&#91;2&#93;.policy.allOf&#91;2&#93;.payload</code> | Yes | [AutonomyPolicy](/api-reference/schemas/autonomy-policy/) | — |
| <code>data.oneOf&#91;2&#93;.safeAuthorityEvidence</code> | Yes | [OperatingSystemEvent](/api-reference/schemas/operating-system-event/) | — |

Nested required fields apply when their parent object or matching union branch is present. Named types link to their complete schema.

<a id="getAutonomyPolicies"></a>

## Get one autonomy policies aggregate

`GET /autonomy-policies/{id}`

Operation ID: <code>getAutonomyPolicies</code>

**Authentication:** <code>&#95;&#95;Host-klineo&#95;session</code> cookie (<code>sessionCookie</code>)

### Parameters

| Name | Location | Required | Type | Description and constraints |
| --- | --- | --- | --- | --- |
| <code>x-klineo-organization-id</code> | header | Yes | <code>string</code> | — |
| <code>id</code> | path | Yes | <code>string</code> | — |

### Responses

| Status | Description | Content type and schema |
| --- | --- | --- |
| <code>200</code> | Current immutable aggregate version | <code>application/json</code>: <code>object</code> |
| <code>404</code> | Not found | No response body declared |

**<code>200</code> response headers**

| Header | Required | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>ETag</code> | Yes | <code>string</code> | — |

**<code>200</code> <code>application/json</code> body**

<code>object</code> — Additional properties rejected

| Field | Required at this level | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>data</code> | Yes | All of: [RecordEnvelope](/api-reference/schemas/record-envelope/); <code>object</code> | — |
| <code>data.allOf&#91;2&#93;.payload</code> | Yes | [AutonomyPolicy](/api-reference/schemas/autonomy-policy/) | — |

Nested required fields apply when their parent object or matching union branch is present. Named types link to their complete schema.

<a id="supersedeAutonomyPolicies"></a>

## Immediately pause, revoke, or narrow policy authority; expansion uses the typed Safe workflow

`PATCH /autonomy-policies/{id}`

Operation ID: <code>supersedeAutonomyPolicies</code>

**Authentication:** <code>&#95;&#95;Host-klineo&#95;session</code> cookie (<code>sessionCookie</code>)

### Parameters

| Name | Location | Required | Type | Description and constraints |
| --- | --- | --- | --- | --- |
| <code>Idempotency-Key</code> | header | Yes | <code>string</code> | Min length: <code>8</code>; Max length: <code>160</code> |
| <code>x-klineo-organization-id</code> | header | Yes | <code>string</code> | — |
| <code>If-Match</code> | header | Yes | <code>string</code> | — |
| <code>id</code> | path | Yes | <code>string</code> | — |

### Request body

Required: **yes**.

**<code>application/json</code>**

<code>object</code> — Additional properties rejected

| Field | Required at this level | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>payload</code> | No | [AutonomyPolicy](/api-reference/schemas/autonomy-policy/) | — |
| <code>status</code> | No | <code>string</code> | Allowed: <code>ACTIVE</code>, <code>PAUSED</code>, <code>REVOKED</code> |
| <code>evidenceHashes</code> | No | Array of [Hash](/api-reference/schemas/hash/) | Max items: <code>256</code> |
| <code>reason</code> | Yes | <code>string</code> | Min length: <code>3</code>; Max length: <code>500</code> |

Nested required fields apply when their parent object or matching union branch is present. Named types link to their complete schema.

### Responses

| Status | Description | Content type and schema |
| --- | --- | --- |
| <code>200</code> | Append-only bounded supersession accepted with deterministic evidence | <code>application/json</code>: <code>object</code> |
| <code>400</code> | Payload or safety transition is outside this bounded operation | No response body declared |
| <code>409</code> | Typed authority workflow is required | No response body declared |
| <code>412</code> | Strong precondition failed | No response body declared |

**<code>200</code> <code>application/json</code> body**

<code>object</code> — Additional properties rejected

| Field | Required at this level | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>data</code> | Yes | All of: [RecordEnvelope](/api-reference/schemas/record-envelope/); <code>object</code> | — |
| <code>data.allOf&#91;2&#93;.payload</code> | Yes | [AutonomyPolicy](/api-reference/schemas/autonomy-policy/) | — |

Nested required fields apply when their parent object or matching union branch is present. Named types link to their complete schema.

<a id="listPolicyIntentDrafts"></a>

## List natural-language policy drafts

`GET /policy-intent-drafts`

Operation ID: <code>listPolicyIntentDrafts</code>

**Authentication:** <code>&#95;&#95;Host-klineo&#95;session</code> cookie (<code>sessionCookie</code>)

### Parameters

| Name | Location | Required | Type | Description and constraints |
| --- | --- | --- | --- | --- |
| <code>x-klineo-organization-id</code> | header | Yes | <code>string</code> | — |
| <code>cursor</code> | query | No | <code>string</code> | Opaque cursor returned in the previous response metadata. |
| <code>limit</code> | query | No | <code>integer</code> | Default: <code>50</code>; Minimum: <code>1</code>; Maximum: <code>100</code> |

### Responses

| Status | Description | Content type and schema |
| --- | --- | --- |
| <code>200</code> | Latest tenant-isolated aggregate versions | <code>application/json</code>: <code>object</code> |

**<code>200</code> <code>application/json</code> body**

<code>object</code> — Additional properties rejected

| Field | Required at this level | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>data</code> | Yes | Array of All of: [RecordEnvelope](/api-reference/schemas/record-envelope/); <code>object</code> | — |
| <code>data&#91;&#93;.allOf&#91;2&#93;.payload</code> | Yes | [PolicyIntentDraft](/api-reference/schemas/policy-intent-draft/) | — |
| <code>meta</code> | Yes | <code>object</code> | Additional properties rejected |
| <code>meta.count</code> | Yes | <code>integer</code> | Minimum: <code>0</code> |
| <code>meta.hasMore</code> | Yes | <code>boolean</code> | — |
| <code>meta.nextCursor</code> | No | <code>string</code> | — |

Nested required fields apply when their parent object or matching union branch is present. Named types link to their complete schema.

<a id="createPolicyIntentDrafts"></a>

## Create natural-language policy drafts

`POST /policy-intent-drafts`

Operation ID: <code>createPolicyIntentDrafts</code>

**Authentication:** <code>&#95;&#95;Host-klineo&#95;session</code> cookie (<code>sessionCookie</code>) **OR** OAuth bearer token with <code>policies:compile</code> (<code>serviceCredential</code>)

**Service scope:** <code>policies:compile</code>. Session access and workspace roles are evaluated separately.

### Parameters

| Name | Location | Required | Type | Description and constraints |
| --- | --- | --- | --- | --- |
| <code>Idempotency-Key</code> | header | Yes | <code>string</code> | Min length: <code>8</code>; Max length: <code>160</code> |
| <code>x-klineo-organization-id</code> | header | Yes | <code>string</code> | — |

### Request body

Required: **yes**.

**<code>application/json</code>**

[PolicyExtractRequest](/api-reference/schemas/policy-extract-request/)

### Responses

| Status | Description | Content type and schema |
| --- | --- | --- |
| <code>201</code> | Append-only aggregate created | <code>application/json</code>: <code>object</code> |

**<code>201</code> <code>application/json</code> body**

<code>object</code> — Additional properties rejected

| Field | Required at this level | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>data</code> | Yes | [PolicyDraftResult](/api-reference/schemas/policy-draft-result/) | — |

Nested required fields apply when their parent object or matching union branch is present. Named types link to their complete schema.

<a id="getPolicyIntentDrafts"></a>

## Get one natural-language policy drafts aggregate

`GET /policy-intent-drafts/{id}`

Operation ID: <code>getPolicyIntentDrafts</code>

**Authentication:** <code>&#95;&#95;Host-klineo&#95;session</code> cookie (<code>sessionCookie</code>)

### Parameters

| Name | Location | Required | Type | Description and constraints |
| --- | --- | --- | --- | --- |
| <code>x-klineo-organization-id</code> | header | Yes | <code>string</code> | — |
| <code>id</code> | path | Yes | <code>string</code> | — |

### Responses

| Status | Description | Content type and schema |
| --- | --- | --- |
| <code>200</code> | Current immutable aggregate version | <code>application/json</code>: <code>object</code> |
| <code>404</code> | Not found | No response body declared |

**<code>200</code> response headers**

| Header | Required | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>ETag</code> | Yes | <code>string</code> | — |

**<code>200</code> <code>application/json</code> body**

<code>object</code> — Additional properties rejected

| Field | Required at this level | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>data</code> | Yes | All of: [RecordEnvelope](/api-reference/schemas/record-envelope/); <code>object</code> | — |
| <code>data.allOf&#91;2&#93;.payload</code> | Yes | [PolicyIntentDraft](/api-reference/schemas/policy-intent-draft/) | — |

Nested required fields apply when their parent object or matching union branch is present. Named types link to their complete schema.

<a id="compilePolicyIntent"></a>

## Deterministically compile a non-executable policy draft

`POST /policy-intent-drafts/{id}/compile`

Operation ID: <code>compilePolicyIntent</code>

**Authentication:** <code>&#95;&#95;Host-klineo&#95;session</code> cookie (<code>sessionCookie</code>) **OR** OAuth bearer token with <code>policies:compile</code> (<code>serviceCredential</code>)

**Service scope:** <code>policies:compile</code>. Session access and workspace roles are evaluated separately.

### Parameters

| Name | Location | Required | Type | Description and constraints |
| --- | --- | --- | --- | --- |
| <code>Idempotency-Key</code> | header | Yes | <code>string</code> | Min length: <code>8</code>; Max length: <code>160</code> |
| <code>x-klineo-organization-id</code> | header | Yes | <code>string</code> | — |
| <code>id</code> | path | Yes | <code>string</code> | — |
| <code>If-Match</code> | header | Yes | <code>string</code> | Pattern: <code>^"&#91;^"&#92;&#92; &#93;+"$</code> |

### Request body

Required: **yes**.

**<code>application/json</code>**

<code>object</code> — Additional properties rejected

| Field | Required at this level | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>reason</code> | Yes | <code>string</code> | Min length: <code>3</code>; Max length: <code>500</code> |

Nested required fields apply when their parent object or matching union branch is present. Named types link to their complete schema.

### Responses

| Status | Description | Content type and schema |
| --- | --- | --- |
| <code>200</code> | Exact deterministic interpretation | <code>application/json</code>: <code>object</code> |

**<code>200</code> <code>application/json</code> body**

<code>object</code> — Additional properties rejected

| Field | Required at this level | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>data</code> | Yes | [PolicyCompilationResult](/api-reference/schemas/policy-compilation-result/) | — |

Nested required fields apply when their parent object or matching union branch is present. Named types link to their complete schema.

<a id="createStructuredPolicyIntentDraft"></a>

## Create a deterministic typed policy draft without an AI provider

`POST /policy-intent-drafts/structured`

Operation ID: <code>createStructuredPolicyIntentDraft</code>

**Authentication:** <code>&#95;&#95;Host-klineo&#95;session</code> cookie (<code>sessionCookie</code>) **OR** OAuth bearer token with <code>policies:compile</code> (<code>serviceCredential</code>)

**Service scope:** <code>policies:compile</code>. Session access and workspace roles are evaluated separately.

### Parameters

| Name | Location | Required | Type | Description and constraints |
| --- | --- | --- | --- | --- |
| <code>Idempotency-Key</code> | header | Yes | <code>string</code> | Min length: <code>8</code>; Max length: <code>160</code> |
| <code>x-klineo-organization-id</code> | header | Yes | <code>string</code> | — |

### Request body

Required: **yes**.

**<code>application/json</code>**

[StructuredPolicyRequest](/api-reference/schemas/structured-policy-request/)

### Responses

| Status | Description | Content type and schema |
| --- | --- | --- |
| <code>201</code> | Manual structured draft and exact compilation preview | <code>application/json</code>: <code>object</code> |

**<code>201</code> <code>application/json</code> body**

<code>object</code> — Additional properties rejected

| Field | Required at this level | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>data</code> | Yes | [PolicyDraftResult](/api-reference/schemas/policy-draft-result/) | — |

Nested required fields apply when their parent object or matching union branch is present. Named types link to their complete schema.

<a id="checkAutonomyPolicy"></a>

## Validate a manually structured policy and persist non-executable evidence

`POST /policy-checks`

Operation ID: <code>checkAutonomyPolicy</code>

**Authentication:** <code>&#95;&#95;Host-klineo&#95;session</code> cookie (<code>sessionCookie</code>) **OR** OAuth bearer token with <code>policies:check</code> (<code>serviceCredential</code>)

**Service scope:** <code>policies:check</code>. Session access and workspace roles are evaluated separately.

### Parameters

| Name | Location | Required | Type | Description and constraints |
| --- | --- | --- | --- | --- |
| <code>Idempotency-Key</code> | header | Yes | <code>string</code> | Min length: <code>8</code>; Max length: <code>160</code> |
| <code>x-klineo-organization-id</code> | header | Yes | <code>string</code> | — |

### Request body

Required: **yes**.

**<code>application/json</code>**

[PolicyCheckRequest](/api-reference/schemas/policy-check-request/)

### Responses

| Status | Description | Content type and schema |
| --- | --- | --- |
| <code>201</code> | Deterministic policy check and immutable evidence | <code>application/json</code>: <code>object</code> |

**<code>201</code> <code>application/json</code> body**

<code>object</code> — Additional properties rejected

| Field | Required at this level | Type | Description and constraints |
| --- | --- | --- | --- |
| <code>data</code> | Yes | [PolicyCheckResult](/api-reference/schemas/policy-check-result/) | — |

Nested required fields apply when their parent object or matching union branch is present. Named types link to their complete schema.
