# kindgi gate-policies

> Gate policies: what a promotion of an agent must show before a version goes live for a scope (list / show / versions / publish / unregister / reinstate)

## `kindgi gate-policies`

**Synopsis**

```sh signature
kindgi gate-policies <command>
```

Gate policies: what a promotion of an agent must show before a version goes live for a scope (list / show / versions / publish / unregister / reinstate).

**Commands**

| Command                                                                                                                            | Description                                                                                                                                                         |
| ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`kindgi gate-policies list`](https://docs.kindgi.com/v0.1.9/reference/cli/gate-policies.md#kindgi-gate-policies-list)             | List gate policies (each one's latest active version), for an agent or a scope.                                                                                     |
| [`kindgi gate-policies show`](https://docs.kindgi.com/v0.1.9/reference/cli/gate-policies.md#kindgi-gate-policies-show)             | Show a gate policy's latest active version, or one version.                                                                                                         |
| [`kindgi gate-policies versions`](https://docs.kindgi.com/v0.1.9/reference/cli/gate-policies.md#kindgi-gate-policies-versions)     | List a gate policy's versions, unregistered ones too.                                                                                                               |
| [`kindgi gate-policies publish`](https://docs.kindgi.com/v0.1.9/reference/cli/gate-policies.md#kindgi-gate-policies-publish)       | Publish a gate policy, or a new version of one: what a promotion of the agent for the scope must show (the spec: comparison, evidence, metrics, replay, approvals). |
| [`kindgi gate-policies unregister`](https://docs.kindgi.com/v0.1.9/reference/cli/gate-policies.md#kindgi-gate-policies-unregister) | Unregister a gate policy version: the policy's latest remaining active version applies, or the scope above's policy.                                                |
| [`kindgi gate-policies reinstate`](https://docs.kindgi.com/v0.1.9/reference/cli/gate-policies.md#kindgi-gate-policies-reinstate)   | Reinstate an unregistered gate policy version.                                                                                                                      |

**See also**

- [Release an agent version](https://docs.kindgi.com/v0.1.9/guides/evals/release-an-agent-version.md)

### `kindgi gate-policies list`

**Synopsis**

```sh signature
kindgi gate-policies list [--agent=<agent-id>] [(--tenant | --org=<org-id> | --project=<project-id> [--segment=<key:value>]…)] [--limit=<n>] [--cursor=<cursor>] [--table]
```

List gate policies (each one's latest active version), for an agent or a scope.

**Options**

| Option              | Default              | Description                                                                                                                         |
| ------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `--agent <value>`   | none                 | Only the policies gating this agent.                                                                                                |
| `--cursor <value>`  | none                 | The next page, from `nextCursor`.                                                                                                   |
| `--limit <value>`   | `25` (at most `100`) | Page size.                                                                                                                          |
| `--org <value>`     | none                 | An org, by id.                                                                                                                      |
| `--project <value>` | none                 | A project, by id; with `--segment`, a segment in it.                                                                                |
| `--segment <value>` | none                 | One step of the segment path, `key:value` (e.g. `company:acme`); repeat it in order, coarse to fine. Needs `--project`. Repeatable. |
| `--tenant`          | off                  | The whole tenant.                                                                                                                   |

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

List the gate policies of one agent.

```sh
kindgi gate-policies list --agent=acme.order-desk --table
```

List the policies set for the whole tenant.

```sh
kindgi gate-policies list --tenant
```

**See also**

- [Release an agent version](https://docs.kindgi.com/v0.1.9/guides/evals/release-an-agent-version.md)
- [`kindgi gate-policies`](https://docs.kindgi.com/v0.1.9/reference/cli/gate-policies.md#kindgi-gate-policies)

### `kindgi gate-policies show`

**Synopsis**

```sh signature
kindgi gate-policies show <policy-id> [<version>]
```

Show a gate policy's latest active version, or one version.

**Options**

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

Show a policy's latest active version.

```sh
kindgi gate-policies show acme.order-desk-release
```

Show one version of a policy.

```sh
kindgi gate-policies show acme.order-desk-release 1.0.0
```

**See also**

- [Release an agent version](https://docs.kindgi.com/v0.1.9/guides/evals/release-an-agent-version.md)
- [`kindgi gate-policies`](https://docs.kindgi.com/v0.1.9/reference/cli/gate-policies.md#kindgi-gate-policies)

### `kindgi gate-policies versions`

**Synopsis**

```sh signature
kindgi gate-policies versions <policy-id> [--table]
```

List a gate policy's versions, unregistered ones too.

**Options**

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

List a policy's versions, unregistered ones too.

```sh
kindgi gate-policies versions acme.order-desk-release --table
```

**See also**

- [Release an agent version](https://docs.kindgi.com/v0.1.9/guides/evals/release-an-agent-version.md)
- [`kindgi gate-policies`](https://docs.kindgi.com/v0.1.9/reference/cli/gate-policies.md#kindgi-gate-policies)

### `kindgi gate-policies publish`

**Synopsis**

```sh signature
kindgi gate-policies publish <policy-id> --policy-version=<semver> --agent=<agent-id> (--tenant | --org=<org-id> | --project=<project-id> [--segment=<key:value>]…) --spec='<json>'|@<file> [--description=<text>]
```

Publish a gate policy, or a new version of one: what a promotion of the agent for the scope must show (the spec: comparison, evidence, metrics, replay, approvals). Needs admin on the tenant.

**Options**

| Option                     | Default                                           | Description                                                                                                                         |
| -------------------------- | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `--agent <value>`          | required                                          | The agent the policy gates.                                                                                                         |
| `--description <value>`    | none                                              | What the policy is for.                                                                                                             |
| `--org <value>`            | required: one of `--tenant`, `--org`, `--project` | An org, by id.                                                                                                                      |
| `--policy-version <value>` | required                                          | The version to publish (semver).                                                                                                    |
| `--project <value>`        | required: one of `--tenant`, `--org`, `--project` | A project, by id; with `--segment`, a segment in it.                                                                                |
| `--segment <value>`        | none                                              | One step of the segment path, `key:value` (e.g. `company:acme`); repeat it in order, coarse to fine. Needs `--project`. Repeatable. |
| `--spec <value>`           | required                                          | The checks, as JSON, inline or `@<file>`.                                                                                           |
| `--tenant`                 | required: one of `--tenant`, `--org`, `--project` | The whole tenant.                                                                                                                   |

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

From [Release an agent version](https://docs.kindgi.com/v0.1.9/guides/evals/release-an-agent-version.md):

```sh
pnpm exec kindgi gate-policies publish acme.order-desk-release --policy-version=1.0.0 --agent=acme.order-desk --tenant --spec=@gate.json --description="What a release of the order desk must show"
```

**See also**

- [Release an agent version](https://docs.kindgi.com/v0.1.9/guides/evals/release-an-agent-version.md)
- [`kindgi gate-policies`](https://docs.kindgi.com/v0.1.9/reference/cli/gate-policies.md#kindgi-gate-policies)

### `kindgi gate-policies unregister`

**Synopsis**

```sh signature
kindgi gate-policies unregister <policy-id> <version>
```

Unregister a gate policy version: the policy's latest remaining active version applies, or the scope above's policy.

**Options**

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

Unregister a gate policy version.

```sh
kindgi gate-policies unregister acme.order-desk-release 1.0.0
```

**See also**

- [Release an agent version](https://docs.kindgi.com/v0.1.9/guides/evals/release-an-agent-version.md)
- [`kindgi gate-policies`](https://docs.kindgi.com/v0.1.9/reference/cli/gate-policies.md#kindgi-gate-policies)

### `kindgi gate-policies reinstate`

**Synopsis**

```sh signature
kindgi gate-policies reinstate <policy-id> <version>
```

Reinstate an unregistered gate policy version.

**Options**

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

Reinstate an unregistered gate policy version.

```sh
kindgi gate-policies reinstate acme.order-desk-release 1.0.0
```

**See also**

- [Release an agent version](https://docs.kindgi.com/v0.1.9/guides/evals/release-an-agent-version.md)
- [`kindgi gate-policies`](https://docs.kindgi.com/v0.1.9/reference/cli/gate-policies.md#kindgi-gate-policies)
