Operations
An operation is something a company proposes and performs only once it is confirmed: a payment, an exchange, a cancellation. The Operations extension (version 1) makes the approval exact and durable. The paired examples confirm Northwind Bank's proposed payments; Northwind marks payments as not requiring the user's own approval, so a standing permission may confirm them too.
The walkthrough:
- Negotiation.
operations_endpoint()returns the endpoint only when the company and the agent both listoperationsversion 1. A company answers an agent that does not withextension_required. - Exact approval.
approve(operation)records the revision and a digest of its summary and terms. A confirmation for any other revision is refused locally (approval_mismatch); a chat message never confirms anything. - Changed terms.
terms_changedreturns the new revision and the changed term paths, to show the user before asking again. - Recovery. If a confirm's answer is lost, the SDK reads the same operation back. It is never re-proposed or assumed failed; a retried confirm returns the same record, and the company performs it once.
- Standing permissions. A permission names one company, account, and
action, with limits on term paths (a maximum or allowed values), an expiry,
and optional uses. The Reactor
pap.standingPermissionStorereserves a use only when every limit covers the revision; the use is committed when the company confirms and released when it refuses. A revision that requires the user's approval is never confirmed this way. - Cancel. A proposal becomes
cancelled, and the company'sresult.summarysays nothing was changed.
The model sees states, revisions, changed term paths, error codes, and the
company's result.summary as written. Tokens and proofs stay host-only, and
the decision to approve stays with the user in the host's own interface.
TypeScript: OperationsClient, operationsEndpoint(), and approve()
(asynchronous there, since the digest uses Web Crypto), with standing
permissions contributed at StandingPermissionStores.
- Run the Pydantic AI example.
- Run the Agent Runtimes example.
- Read the Operations guide.