Skip to main content
Creating an app, creating a deployment, approving a manifest, and every other TVC operation is a Turnkey activity. That means the same policies and root quorum 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.
See the policy overview for how policies are evaluated and the policy language reference 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. 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

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.

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.
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.

Example policies

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

Allow a user to create operators and Quorum Keys

Allow a user to create deployments for a specific app

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.

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.

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.

Allow operators to approve deployment manifests

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

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.

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.

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.

Deny deleting apps and deployments for users with a specific tag

Deny deleting a specific app

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