> ## Documentation Index
> Fetch the complete documentation index at: https://docs.turnkey.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Turnkey is wallet infrastructure: create and manage crypto wallets, sign transactions, and enforce policy-based access controls. Best-fit uses: embedded consumer wallets (email/passkey/social auth, no seed phrases), automated onchain operations with server-side wallets, AI agent wallets with policy-scoped signing, enterprise key management, and verifiable off-chain workloads on Turnkey Verifiable Cloud (TVC).
> Every API call is a JSON POST to https://api.turnkey.com signed with a P-256 API key; create an organization and key self-serve at https://app.turnkey.com.
> Key Turnkey developer resources: API reference (https://docs.turnkey.com/api-reference/overview/intro.md), OpenAPI spec (https://docs.turnkey.com/public_api.swagger.json), authentication (https://docs.turnkey.com/features/authentication/overview.md), webhooks (https://docs.turnkey.com/features/webhooks/overview.md), MCP server for docs search (https://docs.turnkey.com/mcp), skill for building with Turnkey (https://docs.turnkey.com/skill.md), agent skills for operating an organization (https://docs.turnkey.com/get-started/ai-skills.md), CLI (https://docs.turnkey.com/sdks/cli.md), SDK reference (https://docs.turnkey.com/sdks/introduction.md), full docs content (https://docs.turnkey.com/llms-full.txt).

# TVC policies

> Control who can create, deploy, and delete TVC apps with Turnkey policies, and scope policies to a specific app.

Creating an app, creating a deployment, approving a manifest, and every other TVC operation is a Turnkey activity. That means the same [policies](https://docs.turnkey.com/features/policies/overview.md) and [root quorum](https://docs.turnkey.com/features/users/root-quorum.md) that govern the rest of your organization also govern TVC.

This page lists the TVC activities you can target in a policy, shows how to scope a policy to one app, and provides example policies.

## How policies apply to TVC

* A non-root user can run a TVC activity only when a policy allows it.
* A request that meets the root quorum is allowed before policies are evaluated.
* A policy can require consensus, so that a TVC activity needs approval from several users before it runs.
* A policy can be limited to a time window with the optional `time` field. See [Time-based policies](https://docs.turnkey.com/features/policies/time-based-policies.md).

See the [policy overview](https://docs.turnkey.com/features/policies/overview.md) for how policies are evaluated and the [policy language reference](https://docs.turnkey.com/features/policies/language.md) for the full syntax.

## TVC activities

Target a TVC activity with `activity.kind`, or target a group of them with `activity.resource` and `activity.action`.

| Operation | `activity.kind` | `activity.resource` | `activity.action` | Policy parameters |
| :- | :- | :- | :- | :- |
| Create an app | `CREATE_TVC_APP` | `TVC_APP` | `CREATE` | None |
| Direct traffic to a deployment | `UPDATE_TVC_APP_LIVE_DEPLOYMENT` | `TVC_APP` | `UPDATE` | None |
| Delete an app and its deployments | `DELETE_TVC_APP_AND_DEPLOYMENTS` | `TVC_APP` | `DELETE` | `tvc_app_id` |
| Create a deployment | `CREATE_TVC_DEPLOYMENT` | `TVC_DEPLOYMENT` | `CREATE` | `tvc_app_id` |
| Approve a deployment manifest | `CREATE_TVC_MANIFEST_APPROVALS` | `TVC_DEPLOYMENT` | `UPDATE` | None |
| Restore a deployment | `RESTORE_TVC_DEPLOYMENT` | `TVC_DEPLOYMENT` | `UPDATE` | None |
| Post a Quorum Key share | `POST_TVC_QUORUM_KEY_SHARE` | `TVC_DEPLOYMENT` | `UPDATE` | None |
| Delete a deployment | `DELETE_TVC_DEPLOYMENT` | `TVC_DEPLOYMENT` | `DELETE` | None |
| Create an operator | `CREATE_TVC_OPERATOR` | `TVC_OPERATOR` | `CREATE` | None |
| Create a Quorum Key | `CREATE_TVC_QUORUM_KEY` | `TVC_QUORUM_KEY` | `CREATE` | None |
| Re-encrypt a Quorum Key share | `RE_ENCRYPT_TVC_QUORUM_KEY_SHARE` | `TVC_QUORUM_KEY` | `ENCRYPT` | `app_quorum_key`, `operator_encrypt_key`, `operator_sign_key` |

The **Policy parameters** column lists the request fields each activity exposes to policy conditions through `activity.params`. `tvc_app_id` identifies an app, and `app_quorum_key` identifies an app's Quorum Key when re-encrypting a share. See [Scope a policy to a specific app](#scope-a-policy-to-a-specific-app).

## Scope a policy to a specific app

To write a policy that applies to one app, match its ID with `activity.params.tvc_app_id`. This lets a single organization apply different rules to different apps. For example, if you run one app for production and another for testing, you can give the testing app a permissive policy while the production app stays behind stricter policies or consensus.

```json theme={"system"}
{
  "policyName": "Allow deployments for app <APP_UUID>",
  "notes": "",
  "effect": "EFFECT_ALLOW",
  "consensus": "approvers.any(user, user.id == '<USER_ID>')",
  "condition": "activity.kind in ['CREATE_TVC_DEPLOYMENT', 'DELETE_TVC_APP_AND_DEPLOYMENTS'] && activity.params.tvc_app_id == '<APP_UUID>'"
}
```

### Limitations

`tvc_app_id` is available for two activity types only: `ACTIVITY_TYPE_CREATE_TVC_DEPLOYMENT` and `ACTIVITY_TYPE_DELETE_TVC_APP_AND_DEPLOYMENTS`. Activities that act on a deployment or a manifest, such as directing traffic, deleting or restoring a deployment, and approving a manifest, do not expose the app ID, so a policy cannot scope them to one app. If you need every activity separated between two apps today, create them in separate organizations.

> [!WARNING]
>
> Keep app-specific conditions in their own policy. A condition that reads `activity.params.tvc_app_id` causes an evaluation error on any activity that does not expose it, and a policy with an evaluation error is skipped. Because `&&` and `||` do not short-circuit, combining an app-specific clause with another TVC activity in one condition means the policy never applies to that other activity. See [Evaluation errors and short-circuiting](https://docs.turnkey.com/features/policies/language.md#evaluation-errors-and-short-circuiting).

## Example policies

Replace the placeholders with your own user, user tag, app, and key values.

#### Allow a user to create operators and Quorum Keys

```json theme={"system"}
{
  "policyName": "Allow user <USER_ID> to create TVC operators and Quorum Keys",
  "notes": "",
  "effect": "EFFECT_ALLOW",
  "consensus": "approvers.any(user, user.id == '<USER_ID>')",
  "condition": "activity.kind in ['CREATE_TVC_OPERATOR', 'CREATE_TVC_QUORUM_KEY']"
}
```

#### Allow a user to create deployments for a specific app

```json theme={"system"}
{
  "policyName": "Allow user <USER_ID> to create deployments for app <APP_UUID>",
  "notes": "",
  "effect": "EFFECT_ALLOW",
  "consensus": "approvers.any(user, user.id == '<USER_ID>')",
  "condition": "activity.kind == 'CREATE_TVC_DEPLOYMENT' && activity.params.tvc_app_id == '<APP_UUID>'"
}
```

#### Require two approvers to create a deployment for a specific app

This policy allows a new deployment for the app only after two users with the given tag approve it.

```json theme={"system"}
{
  "policyName": "Require two approvers with user_tag <USER_TAG_ID> to create deployments for app <APP_UUID>",
  "notes": "",
  "effect": "EFFECT_ALLOW",
  "consensus": "approvers.filter(user, user.tags.contains('<USER_TAG_ID>')).count() >= 2",
  "condition": "activity.kind == 'CREATE_TVC_DEPLOYMENT' && activity.params.tvc_app_id == '<APP_UUID>'"
}
```

#### Allow creating deployments for a specific app during business hours

The `time` field limits when this policy is active. `CronSpan` opens the window at 9:00 AM Eastern on weekdays and holds it open for 8 hours. Outside the window the policy is skipped.

```json theme={"system"}
{
  "policyName": "Allow user_tag <USER_TAG_ID> to create deployments for app <APP_UUID> during business hours",
  "notes": "",
  "effect": "EFFECT_ALLOW",
  "consensus": "approvers.any(user, user.tags.contains('<USER_TAG_ID>'))",
  "condition": "activity.kind == 'CREATE_TVC_DEPLOYMENT' && activity.params.tvc_app_id == '<APP_UUID>'",
  "time": "CronSpan('0 9 * * 1-5', '8h', 'America/New_York')"
}
```

#### Deny creating deployments for a specific app during a freeze window

This policy stops non-root users from creating deployments for the app between the two timestamps (UTC), even if another policy allows it. The window is start-inclusive and end-exclusive.

```json theme={"system"}
{
  "policyName": "Deny creating deployments for app <APP_UUID> during the freeze window",
  "notes": "",
  "effect": "EFFECT_DENY",
  "condition": "activity.kind == 'CREATE_TVC_DEPLOYMENT' && activity.params.tvc_app_id == '<APP_UUID>'",
  "time": "time.now >= Timestamp('2026-12-24T00:00:00Z') && time.now < Timestamp('2027-01-02T00:00:00Z')"
}
```

#### Allow operators to approve deployment manifests

Manifest approvals do not expose the app ID, so this policy applies to every app in the organization.

```json theme={"system"}
{
  "policyName": "Allow user_tag <USER_TAG_ID> to approve deployment manifests",
  "notes": "",
  "effect": "EFFECT_ALLOW",
  "consensus": "approvers.any(user, user.tags.contains('<USER_TAG_ID>'))",
  "condition": "activity.kind == 'CREATE_TVC_MANIFEST_APPROVALS'"
}
```

#### Allow share re-encryption for one Quorum Key

Re-encrypting a Turnkey-hosted operator's Quorum Key share releases it to a deployment's enclave. This policy limits a user to the Quorum Key of one app. `app_quorum_key` is the app's Quorum Key public key.

```json theme={"system"}
{
  "policyName": "Allow user <USER_ID> to re-encrypt shares of one Quorum Key",
  "notes": "",
  "effect": "EFFECT_ALLOW",
  "consensus": "approvers.any(user, user.id == '<USER_ID>')",
  "condition": "activity.kind == 'RE_ENCRYPT_TVC_QUORUM_KEY_SHARE' && activity.params.app_quorum_key == '<QUORUM_PUBLIC_KEY>'"
}
```

#### Allow share re-encryption for one hosted operator

This policy limits a user to re-encrypting the share held by one Turnkey-hosted operator, identified by the operator's encryption public key.

```json theme={"system"}
{
  "policyName": "Allow user <USER_ID> to re-encrypt shares for one hosted operator",
  "notes": "",
  "effect": "EFFECT_ALLOW",
  "consensus": "approvers.any(user, user.id == '<USER_ID>')",
  "condition": "activity.kind == 'RE_ENCRYPT_TVC_QUORUM_KEY_SHARE' && activity.params.operator_encrypt_key == '<OPERATOR_ENCRYPT_PUBLIC_KEY>'"
}
```

#### Require two approvers to direct traffic to a deployment

Directing traffic does not expose the app ID, so this policy applies to every app in the organization.

```json theme={"system"}
{
  "policyName": "Require two approvers with user_tag <USER_TAG_ID> to direct traffic",
  "notes": "",
  "effect": "EFFECT_ALLOW",
  "consensus": "approvers.filter(user, user.tags.contains('<USER_TAG_ID>')).count() >= 2",
  "condition": "activity.kind == 'UPDATE_TVC_APP_LIVE_DEPLOYMENT'"
}
```

#### Deny deleting apps and deployments for users with a specific tag

```json theme={"system"}
{
  "policyName": "Deny user_tag <USER_TAG_ID> from deleting TVC apps and deployments",
  "notes": "",
  "effect": "EFFECT_DENY",
  "consensus": "approvers.any(user, user.tags.contains('<USER_TAG_ID>'))",
  "condition": "activity.resource in ['TVC_APP', 'TVC_DEPLOYMENT'] && activity.action == 'DELETE'"
}
```

#### Deny deleting a specific app

This policy stops non-root users from deleting the app and its deployments, even if another policy allows it.

```json theme={"system"}
{
  "policyName": "Deny deleting app <APP_UUID>",
  "notes": "",
  "effect": "EFFECT_DENY",
  "condition": "activity.kind == 'DELETE_TVC_APP_AND_DEPLOYMENTS' && activity.params.tvc_app_id == '<APP_UUID>'"
}
```

## Related

* [Policy language reference](https://docs.turnkey.com/features/policies/language.md#activity-parameters): every activity parameter available to policy conditions.
* [Access control examples](https://docs.turnkey.com/features/policies/examples/access-control.md): general policy examples for users, tags, and consensus.
* [Managing TVC apps and deployments](https://docs.turnkey.com/features/verifiable-cloud/managing-apps-and-deployments.md): the operations these policies govern.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.