Skip to main content

Operations

Operations — loading the slides…

An operation is an action a company performs only once the user approves its exact terms: a payment, an exchange, a cancellation. The Operations extension (version 3) makes the approval exact, and the action happen at most once. The paired examples get Ada's approval of Northwind Bank's payments.

The walkthrough:

  1. Negotiation. operations_negotiated() is true only when the company lists operations version 3 and the Session declares it in Poppy-Extensions (§3.4). Without it, a company handles approval itself or answers with extension_required.
  2. The user decides. ask_user() goes through the host's own approval surface, naming the company and showing its terms, and makes a user approval. A chat message never approves anything. An agent may also approve on an instruction the user gave it (approve_as_agent(), an agent approval): see the Operations guide.
  3. New terms. An approval of a revision the company can't accept performs nothing, and the company returns a new revision, never the one named. ask_user(replaces=...) shows what changed before asking again.
  4. At most once. send() keeps the same approval after a failure or a timeout. The company performs the action once, and a repeat gets the original response; while it is being performed, 503 and Retry-After.

The wire depends on where the company asks. At an API, the first request answers 403 with approval_required and the operation, and the retry is the same request with a Poppy-Approval header naming the operation_id and the revision. At an MCP server, the tool returns an error result with the operation, and the retry carries the approval in _meta. In a conversation, as here, a company message carries the operation and the agent's message carries the approval. Operations have no endpoint and no state of their own: the same request, with the approval, is all there is.

The model sees revisions, changed term paths, error codes, and what the company says it came to, as written. Tokens stay host-only, and the decision to approve stays with the user in the host's own interface.