# 34.6 Approval at two levels (/affordable-self-improving-ai-workers/workers-delegate-workflows-execute/approval-at-two-levels)

---
type: Document
title: "34.6 Approval at two levels"
description: "Approving one tool call belongs to the conversation; approving a report inside a process belongs to the process. Where each approval waits, and the checks trusted code makes in both."
status: stable
order: 434.06
ksor:
  owner: team:panaversity
  audience: [ public ]
  approval:
    by: process:panaversity
    at: 2026-11-30T08:18:55Z
chapter: "34"
part: IV
expert_status: manager
concepts: [ "34.6" ]
last_verified: 2026-11-29
sources:
  - id: paper
    title: "Building Affordable, Self-Improving AI Workers (Panaversity, 29 November 2026), section 7.6"
    resource: "Panaversity paper, version 1.0, 29 November 2026 (not yet published)"
generated:
  at: 2026-11-30T08:18:55Z
  by: human:zia
trust_tier: unverified
build_id: sha256:d6ce3f28a2cf8e492a60bae1b426b7cc6466e35e83d70c3b9763db2c55009f4b
dirty: true
ksor_version: 0.0.60
---

**In everyday life.** A shop assistant asks the manager, "Can I give this customer a 10% discount?" and waits a minute for a yes. The monthly accounts are different: they are signed off by the finance director, as one stage of closing the month, and nobody waits at the till for that.

**What you will learn.** The two levels at which a person approves an AI worker's work, where each approval waits, and the five checks that make any approval trustworthy.

**Why it matters.** Put every approval in a Workflow and simple questions become slow processes. Put every approval in the conversation and a month's report depends on one chat staying healthy.

### Which approval belongs where

| What is approved | Where it waits | Example |
| --- | --- | --- |
| One tool call the worker wants to make | In the conversation: a Pi Durable tool that waits for a person | Pay invoice 1043 for $1,250 |
| An answer the conversation needs to go on | In the conversation: a wait for the next message | "Which cost centre should this go to?" |
| A result inside a business process | In the Workflow: a step that waits for a review event | Approve November's exception report |
| Permission for a process to carry on | In the Workflow: a step that waits for an outside event | "Supplier confirmed; continue the payment run" |
| A change to the worker itself | In the governance process | Approve a new skill the worker learned |

The deciding question is **who owns the thing being approved**. A payment the worker wants to make now belongs to the conversation. A report that is one stage of a month-end process belongs to that process. The length of the wait does not decide it: both kinds can wait days without anything staying awake. The last row comes later in this part.

### The review step in the Workflow

Step 8 of the reconciliation waits for a review event:

```ts
const review = await step.waitForEvent("wait for review",
  { type: "report-review", timeout: "7 days" });
```

The review page sends the event to the Workflow instance named by the process ID. If no event arrives in time, `waitForEvent` fails with a timeout, and the run takes its escalation path. While it waits, the Workflow is not running.

### What trusted code checks, at both levels

An event or signal arriving is **not proof** that the right person approved the right thing. On both levels, your own code checks five things before the approval counts:

1. **Who.** The approver is named in a token your Worker signed, as in Chapter 33, or comes from a signed-in session. Never from the body of the request.
2. **Allowed.** That person may approve this kind of thing, for this client, at this amount. The rules come from the role contract, not from the code of the step.
3. **Exactly what.** The approval names the exact item: the report's hash, or the invoice's ID and amount. If the report changed after the link was sent, the approval does not apply to the new report.
4. **Still valid.** The token has not expired and has not been used.
5. **Not revoked.** The worker has not been stopped since the approval was asked for (34.7).

In the Workflow, these checks go in a step after the wait:

```ts
const ok = await step.do("check the review", () =>
  checkApproval(this.env, review.payload, { processId, reportHash: report.hash }));
if (!ok.approved) {
  await step.do("record rejection", () => recordOutcome(this.env, processId, "rejected", ok.reason));
  await step.do("tell the worker", () => notifyWorker(this.env, processId, "rejected", ok.reason));
  return;
}
```

A rejection ends the run cleanly, with a reason, and the worker can tell Ana what the reviewer said. Nothing is published.

> Step 5. Build the review: a signed single-use review link naming the reviewer and the report hash; a POST /review endpoint that sends the report-review event to the Workflow; a check-the-review step that makes the five checks; and the rejection and timeout paths. Write tests 3, 4 and 6 from spec-reconcile.md first.

**What to check.** Does the check happen inside a `step.do` after the wait, and not only in the endpoint? The endpoint can be called by anything that can reach it. The step is the last place before publishing. Is the report hash compared? Is the revocation flag read at that moment, not when the run started?

> **The invariant.** An approval counts only when trusted code has checked who, what, whether they may, whether it is still valid, and whether the worker is still allowed to act.

**Check yourself.** The Workflow asks Ana to review November's report on Monday. On Tuesday the worker is revoked because of a fault. On Wednesday Ana approves. Does it publish? *(No. The check-the-review step reads the revocation flag when the approval arrives. Ana's approval is genuine, but the worker is no longer allowed to act.)*
