Skip to content
PlanetScale Change Gates

PlanetScale Change GatesSkill

Added to Onei
Repository Docs

Summary

PlanetScale's approval contract for agents: five operation classes that decide what a database agent may do freely, what needs a named approval, and what it must never do alone.

Features

  • Classifies every PlanetScale, database, repo, credential and network operation into approval classes
  • Class A read-only and Class B proposals proceed without stopping the agent
  • Class C behaviour-changing operations always require an explicit named approval
  • Explicitly rules that opening a PR or deploy request is a proposal, not a mutation
  • Referenced by relative path from the other skills, so the boundary is defined once
  • Covers Traffic Control, safe migrations, roles, backups, pooling and network posture

Install This Skill

Add this skill to your favorite AI agent in a few steps.

Any AI agent

This skill is plain instructions — it works with any assistant that accepts custom instructions or system prompts.

  1. Copy the skill content with the button below.
  2. Paste it into your agent's instruction file or system prompt (for example AGENTS.md, .cursorrules, or a custom instructions field).
  3. Ask the agent to apply the skill whenever the task matches.

Skill Content

Markdown Content

Copy this content and use it with your preferred AI agent

---
name: planetscale-change-gates-and-approval-contract
description: Enforce explicit approval gates for any PlanetScale, database, repository, credential, network, or automation mutation.
---

# Change gates and approval contract

## Purpose

Prevent accidental or autonomous changes that can affect availability, safety, security, data, or developer workflows.

## Operation classes

### Class A: read-only by default

Allowed without approval:

- List databases, branches, keyspaces, webhooks, backups, roles, traffic budgets, schema recommendations, deploy requests, and Insights data.
- Inspect repository code.
- Read schema metadata.
- Read non-sensitive database metadata.
- Produce reports and proposed change sets.

### Class B: state-creating proposals

Allowed by default; requires approval only when the operator has demanded strict no-mutation mode:

- Creating a query-pattern report through an API POST, even if the result is read-only telemetry.
- Triggering a webhook test event.
- Creating temporary local branches or files.
- Opening PRs or issues in external tools.
- Creating database development branches.
- Applying DDL or migrations to non-production development branches.
- Opening deploy requests targeting a branch protected by a review workflow.

The last three are proposals inside an existing review system: nothing
reaches production until a human merges or deploys. The gate belongs on
the merge/deploy action (Class C/D), not on proposal creation. An agent
that stops to ask permission to open a PR is misclassifying.

### Class C: behavior-changing

Always requires explicit approval:

- Enable safe migrations.
- Disable safe migrations.
- Change deploy request approval settings.
- Create/update/delete Traffic Control budget or rule.
- Move Traffic Control budget to enforce mode.
- Create/update/delete webhook.
- Enable raw query collection.
- Enable/disable extensions or settings that require restart.
- Create/update/delete role.
- Reset passwords.
- Change pg_strict settings.
- Change connection pooling behavior.
- Change IP restrictions, PrivateLink, PSC, or public access.
- Change backup schedule or retention.
- Create restore branch.
- Create backup beyond automatic backups.
- Change branch size or replica topology.
- Edit repository files or dependencies.

### Class D: production data/availability impacting

Requires explicit approval, named target confirmation, rollback plan, and ideally a second human review:

- Production DDL.
- Production DML.
- Applying schema recommendation to production.
- Queueing or applying Vitess deploy request to production.
- Promoting or restoring branches.
- Deleting branches, databases, roles, webhooks, backups, or traffic rules.
- Enforcing Traffic Control on production.
- Changing production network access.
- Rotating production credentials.
- Emergency backup during high load.

### Class E: never autonomous

Never do without direct human operation or separately approved incident procedure:

- Delete a production database.
- Disable all production safety mechanisms.
- Drop production tables or columns.
- Remove IP restrictions or private-only posture.
- Store or expose secrets in logs, issues, PRs, Slack, or reports.
- Auto-merge code generated from database telemetry.
- Auto-apply DDL generated by an LLM.

## Approval requirements

A valid approval must include:

- Change ID.
- Target organization/database/branch.
- Whether production is affected.
- Permission to execute the exact action.

Invalid approvals:

- “Do the best practices.”
- “Fix everything.”
- “Apply recommendations.”
- “Go ahead” without named change IDs.

## Autonomous execution exception

There is exactly one alternative to per-change approval: the risk-acknowledged
autonomous mode defined in `../planetscale-autonomous-execution-mode/SKILL.md`. When the
operator explicitly acknowledges the risk, names a scope, and states whether
production is included, that acknowledgment substitutes for per-change approval
of Class B/C (and Class D when production is included) actions **within the
named scope only**.

Everything else in this skill still applies in autonomous mode:

- Class E is never unlocked by any phrasing.
- The pre-execution checklist must still be produced for every Class C/D step
  (shown as the execution plan, not as a stop-and-wait).
- The post-execution report is still required.
- Out-of-scope work still requires new approval or new acknowledgment.

## Required pre-execution checklist

Before any Class C or D action, produce:

- Exact command, API endpoint, dashboard action, SQL, or repository diff.
- Target confirmation.
- Expected effect.
- Availability impact.
- Data risk.
- Security risk.
- Rollback plan.
- Validation plan.
- Monitoring plan.

Then stop for approval.

## Required post-execution report

If an approved change is later executed, report:

- What changed.
- When it changed.
- Who approved.
- Interface used.
- Evidence of success.
- Any warnings.
- Rollback state.
- Follow-up monitoring.

## Required refusal behavior

If asked to apply broad or ambiguous production changes, refuse the broad action and produce a safer named change plan.

Use this sentence:

“I will not apply broad production changes from an ambiguous instruction. I can produce a named change set with risk and rollback details.”

Usage Instructions

Learn how to use this skill with different AI agents.

Generic Instructions
npx skills add planetscale/skills -g -y

The skill folders must stay siblings — they reference each other by relative path.

Description

The hard problem with an agent that can reach your production database is not capability, it is knowing where the line is. This official PlanetScale skill draws that line as a classification scheme, so "may I do this?" has a lookup answer rather than a judgement call.

Five classes

Class A — read-only. Listing databases, branches, keyspaces, webhooks, backups, roles, traffic budgets, schema recommendations, deploy requests and Insights data; reading schema metadata and repository code; producing reports and proposed change sets. No approval.

Class B — state-creating proposals. Creating a query-pattern report through a POST, firing a webhook test event, creating development branches, applying DDL to a non-production development branch, opening a PR or a deploy request against a review-protected branch. Also allowed by default, and the reasoning is the interesting part: these are proposals inside an existing review system, so nothing reaches production until a human merges or deploys. The gate belongs on the merge, not on the proposal. The skill says outright that an agent stopping to ask permission to open a PR has misclassified the operation.

Class C — behaviour-changing. Always needs explicit approval: enabling or disabling safe migrations, changing deploy-request approval settings, creating or enforcing Traffic Control budgets, managing webhooks, enabling raw query collection, toggling settings that require a restart, creating or deleting roles, resetting passwords, changing pooling behaviour, changing IP restrictions or PrivateLink/PSC or public access, changing backup schedule or retention, creating restore branches and extra backups.

Classes D and E carry the operations above that — the ones where the blast radius is production data and availability.

Why it is a separate skill

Because the other skills in the pack reference it by relative path. The orchestrator, the CLI-automation skill and the autonomous-execution skill all defer to this file for the question of whether a given step needs a human, which keeps one definition of the boundary instead of three drifting copies. Loading it alone is also the cheapest way to see exactly what PlanetScale thinks an agent should and should not be trusted with.

Related Skills

New

Build crash-safe AI agents on AgentKit and step.ai — durable tool calls, human-in-the-loop approval, realtime progress, and when not to reach for an agent loop at all.

1 views

Inngest's durable-execution playbook as an agent skill — steps and memoisation, event and cron triggers, idempotency, cancellation, retries and non-retriable errors.

2 views
New

Temporal's official skill for building durable workflows — SDK patterns across seven languages, plus the determinism rules that decide whether a workflow survives a replay.

6 views
Browse all skills →