# Approvals

*Your agent asks before it ships. You approve from the Home Screen.*

**Type: [Decide](types/decide.md).** Your agent asks before it acts. Approve or decline with one tap. This is one good use of it; the same widget serves deploy or merge, spend money, send what your agent wrote, delete or archive and more. Switch the subject when something else matters more.

Template id `approvals` · Asks you · uses nothing on the phone · for: Coding agents (Claude Code, Codex, Cursor) and any agent that deploys, sends or spends.

## Goal

Nothing consequential happens without a tap, and the user never has to watch a terminal.

## When to offer it

The user runs a coding or ops agent that deploys, migrates, sends or spends. Offer it right after they say approvals should go to the phone.

## What the user gets

- Shows what your agent wants to do next, with the exact change
- Approve or hold with one tap
- Keeps a short log of what went out

## What each size shows

- **Small**: metric: Tests = 412/412.
- **Medium**: metric: Tests = 412/412; text (body): "6 commits: checkout fix, pricing"; buttons: Deploy (`approve`), Hold (`hold`).
- **Large**: metric: Tests = 412/412; text (body): "6 commits: checkout fix, pricing"; buttons: Deploy (`approve`), Hold (`hold`); list: Recently (2 rows).
- **Lock Screen**: inline "Ship v2.4? Tap to approve".

## Make it theirs

**Look.** Send `look` instead of `theme` and `accent`; every combination is designed to read well:

- `style`: `glass` (default: see-through, adapts to dark mode), `soft` (a calm pale tint) or `bold` (a vivid gradient with dark buttons).
- `accent`: blue, indigo, purple, pink, red, orange, green, teal, graphite, or a hex.
- `font`: default, rounded, serif or mono.

This template's own accent is **green**. To restyle a widget you already saved, send only the look:

```json
{"slug": "approvals", "look": {"style": "bold", "accent": "green", "font": "rounded"}}
```

Preview a look without saving: `droplet_preview_widget` with the slug and `look`. When the user says "make it greener", "calmer" or "bolder", change the look; keep the content.

**Their choices.** Ask once (droplet_ask) or use what you know:

- What needs approval: deploys, emails, payments, deletes
- Show the last N actions on large

**Search words:** approve, deploy, human in the loop, permission, ok, confirm, release, production, agent.


## Before you build

- You need: Coding agents (Claude Code, Codex, Cursor) and any agent that deploys, sends or spends.
- Ask once: For money use two steps (a button, then droplet_ask with risk high naming the amount). For anything irreversible name the target exactly.

## Fill it with real data

Start from the template (`droplet_library` with `id: "approvals"`), keep the design, and replace each sample value:

| Block | Real value |
|---|---|
| 0 · metric | The strongest evidence it's safe: tests passed / total, or the build state. |
| 1 · text | The exact action in under 35 characters: what and how big. |
| 2 · buttons | Keep ids `approve` and `hold`; the first label names the action ('Deploy', 'Run migration', 'Send'). |
| 3 · list | The last 2-4 consequential actions with when. |

Sources:
- The exact action you're about to take: what, where, how big (commits, files, amount, recipients).
- Evidence that it's safe: tests, build status, a diff summary.

## The widget

Sample values; send it with `droplet_set_widget` on your widget's slug (or a new slug with `new_widget: true` if the user asked for a separate widget). Preview it and fix every warning first.

```json
{
  "slug": "approvals",
  "title": "Ship v2.4?",
  "symbol": "checkmark.shield.fill",
  "accent": "#30D158",
  "blocks": [
    {"type": "metric", "label": "Tests", "value": "412/412", "trend": "up"},
    {"type": "text", "text": "6 commits: checkout fix, pricing", "style": "body"},
    {"type": "buttons", "items": [{"id": "approve", "label": "Deploy", "symbol": "paperplane.fill"}, {"id": "hold", "label": "Hold", "symbol": "pause.fill"}]},
    {"type": "list", "title": "Recently", "items": [{"title": "v2.3 deployed", "detail": "Tue"}, {"title": "Migration 042 run", "detail": "Mon"}]}
  ],
  "sizes": {"medium": [0, 1, 2], "large": [0, 1, 2, 3]},
  "lock": {"inline": "Ship v2.4? Tap to approve", "circular": 0}
}
```

## Keep it fresh

Each time you reach a consequential step. Between steps show the last result.

## Handle the taps

Each tap reaches you once on `droplet_get_events` (keep a waker running, SKILL.md Process C). Answer within seconds by updating the widget.

**Deploy** (`approve`)

```json
{"widget": "approvals", "kind": "button", "target": "approve", "value": {"label": "Deploy"}}
```

Do exactly the action shown, nothing more. Update the widget to 'Deploying…' then the result ('v2.4 is live') with a link button to it.

**Hold** (`hold`)

```json
{"widget": "approvals", "kind": "button", "target": "hold", "value": {"label": "Hold"}}
```

Don't act. Show 'Held. I'll wait for you' and ask in chat or with droplet_ask what to change.

## Ask first

For money use two steps (a button, then droplet_ask with risk high naming the amount). For anything irreversible name the target exactly.

For example:

```json
{"question": "Charge the team card $480 for 12 seats?", "kind": "decision", "options": ["Pay $480", "Don't"], "risk": "high"}
```

## Phone actions

None.

## Edge cases

- Nothing pending: show the last result ('v2.4 is live') and remove the buttons until the next step.
- The plan changed after the tap (new commits): don't deploy; show the new state and ask again.
- Several actions queue up: show the first, with 'Then: 2 more' in the text.

## Never

Never act on an old approval after the action changed; ask again.

## Done when

- [ ] Every sample value is replaced with real data (no "Dr. Lee" on a real widget).
- [ ] `droplet_preview_widget` shows no warnings at the sizes the user placed (`placed` in `droplet_whoami`).
- [ ] Every button has a handler and a waker is running.
- [ ] Refresh is set up as above.
- [ ] You told the user in one line what it does on its own and what it asks first.

## Same widget, other uses

- [OK to spend?](spend-ok.md): Your agent needs to pay for something to keep going. It asks first, with the exact amount.
- [Renewal coming](bill-guard.md): Something renews soon that you barely use. Your agent caught it in time.
- [Reply drafted](mention-reply.md): Someone asked you something in public. Your agent wrote the reply. You tap post.
