Skip to Content
caffeine docs

The inbox: propose, approve, apply

Proposed actions, approve and reject, claude.ai connectors.

For work outside the repos (mail, tickets, docs, accounting…), or anything you want to validate first, agents don't act: they propose. caffeine keeps the proposals in an inbox, and nothing happens until you approve.

agent writes .agent/ACTIONS.json → check → inbox #12 → caffeine approve 12 → apply steps

1. The agent proposes

A step writes .agent/ACTIONS.json:

{
  "summary": "Sort 14 new emails, draft 2 replies",
  "actions": [
    { "id": "a1", "kind": "label",       "title": "Label 9 newsletters", "detail": "…", "data": { "ids": ["…"] } },
    { "id": "a2", "kind": "draft_reply", "title": "Reply to the accountant", "detail": "…", "data": { "thread": "…", "body": "…" } }
  ]
}
FieldRequiredMeaning
summarynoOne line, shown in the inbox.
actions[].idyesUnique. Used by approve --only.
actions[].kindyesWhat the action does. Must be listed in the pipeline's actions.allowed.
actions[].titleyesOne line, shown in the inbox.
actions[].detailnoWhy, shown by caffeine inbox <id>.
actions[].datanoAnything your apply steps need.

2. A check enforces the rules

claude_connectors: true             # your claude.ai connectors, see below
actions:
  allowed: [label, draft_reply]     # anything else is refused
  max: 20

steps:
  - name: 01-triage
    prompt: prompts/mail/triage.md
    allowed_tools: [Write, ToolSearch, mcp__claude_ai_Gmail__search_threads, mcp__claude_ai_Gmail__get_thread]
    verify: caffeine check actions

caffeine check actions fails when the file is not valid JSON, misses an id, kind or title, reuses an id, uses a kind that is not allowed, or proposes more than max. Give the proposing agent read-only tools: it has no reason to write anywhere but .agent/.

3. The run lands in the inbox

When a run succeeds (and is not a dry run), it creates an inbox item if:

  • it left a non-empty .agent/ACTIONS.json, or
  • it opened a pull request that it did not merge (caffeine pr without --auto-merge).
caffeine inbox                 # what waits for a decision
caffeine inbox 12              # one item: the actions, the report, the logs
caffeine inbox --all           # decided items too

4. You decide

caffeine approve 12                 # apply everything
caffeine approve 12 --only a1,a3    # apply only these actions
caffeine reject 12 already done by hand
  • A pull request: approve squash-merges it and deletes the branch. reject closes it with your reason as a comment.
  • Actions: approve runs the pipeline's apply: steps on the same target, with the approved actions in .agent/ACTIONS.json. If the apply run fails, the item stays pending. reject only records your decision and the reason.
apply:
  - name: apply
    prompt: prompts/mail/apply.md        # or a script, when the actions are mechanical
    allowed_tools: [Read, mcp__claude_ai_Gmail__label_thread, mcp__claude_ai_Gmail__create_draft]
    verify: caffeine check actions

Apply steps are steps like any other: verify, guard and logs apply. Their run is logged under <pipeline>.apply, and it neither moves {{last_run}} nor creates inbox items. A pipeline without apply: can still propose. You then apply by hand and reject the item with a note.

claude.ai connectors

The claude runner normally loads only the pipeline's MCP servers. With claude_connectors: true at the pipeline level, it also loads the connectors of your claude.ai account (Gmail, Notion, Google Drive…), the ones you use on claude.ai. You don't manage any token.

claude_connectors: true
steps:
  - name: 01-labels
    prompt: prompts/mail/labels.md
    allowed_tools: [Write, ToolSearch, mcp__claude_ai_Gmail__list_labels]

The agent sees the connectors' tools, but can only call those listed in allowed_tools. Any other call is refused, and a tool that ran without being listed fails the step. ToolSearch loads a tool's schema: list it so the agent can reach the connector tools. To find the exact tool names, run a step that asks the agent to list them with ToolSearch without calling them.

Rules worth keeping

  • Propose with read tools, apply with write tools. The proposing step never needs to change anything outside .agent/.
  • Keep irreversible actions out of apply. Sending an email, paying, deleting, publishing: draft them, and do the last click yourself in the tool.
  • Make kind narrow. draft_reply is reviewable, do_anything is not.
  • Prefer scripts in apply when data holds everything needed. A script does exactly what was approved.

On this page