Approvals with Operations
The Operations extension (version 3) answers one question: how does a Company know the user agreed to this exact change, when the request comes from an agent? Instead of performing the change, the Company answers with its exact terms and waits for an approval of them.
The life of an operation
Advertising the extension
A Company lists the extension in poppy.json:
"extensions": { "operations": [{ "version": "3" }] }
and an agent that supports it declares it on each request:
Poppy-Extensions: "operations";v="3"
A change attempted without it is refused with
403 {"error": "extension_required", "extension": "operations"}, so an agent
that can't show the user an approval can't trigger a change. An agent declares
the extension only where it can show one.
What an operation holds
{ "operation_id": "op_xs9hiC1D6rgUPCI-CV-jEARy", "revision": "1795602001-9J3BYg4QmZBKbSiM", "summary": "Refund 1 × Pork gyoza (6) (USD 8.00) missing from order ord_LNB0907, …", "terms": { "order_id": "ord_LNB0907", "dish_id": "pork-gyoza", "quantity": 1, "refund_cents": 800, "currency": "USD" }, "expires_at": "2026-11-25T10:30:01.660Z"}
operation_idis the action. It stays the same when the terms change.revisionis these terms. Any change to the terms or the expiry means a new revision.summaryis the terms in plain language, optional: bold, italics and lists, never links or images.termsis everything that affects the action, as data the agent can check and show.expires_atis the last moment an approval of this revision counts.
The Company performs only what the approved revision describes, so anything
missing from terms isn't part of the deal.
The same operation in every interface
Every interface carries the same operation (Operations §4):
| Interface | The Company asks with | The agent approves with |
|---|---|---|
| API | 403 {"error": "approval_required", "operation": {…}} (example) | the identical request with a Poppy-Approval header |
| MCP | an error tool result (isError), with the operation in structuredContent | the identical tool call with the approval in _meta under personalagentprotocol.org/approval |
| Conversation | a Company message with extensions.operations.operation (example) | a message with extensions.operations.approval |
| Website | 403 with a Poppy-Operation header naming the Session and a reference | a request to the extension's endpoint, never through the browser; then the browser repeats the action |
Who approves
Approval comes in two kinds (Operations §5):
- User approved. The agent shows the user the Company's name and the terms, and takes the answer through its own interface; in Iris, a card with the Company's verified domain and a button. A Company message saying "the user agreed" is never an approval; neither is the model deciding the user would agree.
- Agent approved. The agent approves on an instruction the user gave it, such as "any exchange under $20 is fine". The instruction must come from the user, not from anything the agent read. When the agent can't tell whether the terms fit, or the Company returns a new revision, the user decides.
Either way, the agent checks that terms agree with what was asked for and
with the summary. The Company writes both, so a summary could describe
something the terms don't.
In Iris, an agent approval comes from a standing instruction for one Company.
Code, never the model, checks it against the exact terms: an amount over the
limit (fees included), a refund, another currency or a disagreeing summary goes
to the user. The server checks again with its own copy of the operation and
holds its own limits, five approvals an hour and three times the limit in
total, so a tampered browser can't stretch a rule. The approval goes out as
approver="agent", without input_type, and its reference is an entry in a
ledger the user sees next to the instruction.
What an approval carries
At an API, the approval is a header on the identical request:
Poppy-Approval: operation_id="op_xs9hiC1D6rgUPCI-CV-jEARy", revision="1795602001-9J3BYg4QmZBKbSiM", approver="user", approved_at=1795600000, input_type="tap", reference="apr_01JD8ZK3Q9"
| Member | Meaning |
|---|---|
approver | user or agent |
approved_at | When it was given, in seconds |
input_type | For a user approval, how, such as tap |
reference | The agent's own record, for the Company's support staff |
The agent keeps the approval with the operation. The Company records
approver, input_type and reference with the change, and can stop
accepting a misbehaving agent.
What the Company checks
After the usual Session and token checks, the Company checks that:
- the Session can approve this operation;
- it hasn't been performed already, and if it has, it answers with the original result;
- the revision is one it issued, hasn't expired, and the request asks for exactly what that revision describes.
If the third check fails, it performs nothing and returns the operation with a revision for what the request asks now, never the one the approval named, so the agent can't loop on a stale approval.
Declines
A Company may refuse a valid approval for its own reasons. It answers
403 {"error": "approval_declined"} with the operation ID and revision, an
optional reason in plain language and an optional alternative, such as a page
where the user can do it themselves. The
extension has no reason codes: an agent does the same whatever the reason, and
codes would reveal the Company's risk rules.
A decline is final for that approval. The agent shows it to the user and doesn't resend it.
The lab's bank, Harborline, declines every agent approval that moves money: "Harborline moves money only when you approve it yourself." The user can then approve the same revision themselves, and Harborline performs it. A decline lets a Company accept agents for some actions and insist on the person for others.
Retries and at most once
Networks fail after the work is done. The agent resends the identical request with the identical approval, and the Company answers with the original result instead of acting twice (Operations §7). For that to hold:
- the Company records the result before replying;
- the agent never proposes the change again to "check" whether it happened.
It must also hold across a failure: when the connection is cut after an order is saved and the Company is rebuilt from its store, the resent approval still gets the original response and the store holds one order.
What an approval proves, and what it doesn't
An approval proves that a specific agent, in a specific Session, and with an access token for the account when signed in, stated that a specific revision was approved, by the user or on their instruction. It doesn't prove what happened on the user's screen: the Company relies on the agent for that.
A Company that must see the user confirm for itself, as when closing an account, can skip operations and have the user confirm on its website or app, signed in.
Go deeper
- Watch it happen: Changing an order, Moving money, Letting the agent approve for you and When something goes wrong.
- As HTTP: One task.
- Apply it: Build a Company and Build a Personal Agent.
- In the lab:
approvals.ts,runtime.ts(userApproval,sendApproval) andoperation-review.tsx.