Approvals

How an agent asks for approval, how the answer is bound to the exact operation, and what happens to late answers.

An agent sometimes needs permission before it acts. Robotelos records that need as an obligation: a state event in the conversation that names who may answer, what is being asked, and when the request expires.

What an obligation contains

FieldMeaning
kindapproval
versionIncreases when the obligation changes; an answer must name the version it saw
statusOpen or answered
respondersThe participants allowed to answer: the owner of the agent
promptText shown to the responder
targetThe operation being approved: its operation_ref and effective_digest
expires_atAfter this time the obligation cannot be answered

The digest

The approval is bound to a digest. protocol.ApprovalDigest is the SHA-256 of the capability ID, the contract version and the effective arguments of the operation. The environment is not part of the digest yet.

The point is that a “yes” approves exactly the operation that was shown. If the agent later proposes different arguments, the digest changes, and an answer to the old digest does not apply.

Answering

A client answers with the robotelos.answer_obligation command. The server checks, in order:

  1. the sender is one of the responders;
  2. the obligation is open and the expected_version matches;
  3. the obligation has not expired;
  4. the request_digest equals the digest of the obligation.

Results:

  • A valid first answer is accepted. It is the canonical answer, and the agent resumes with it.
  • A late or duplicate answer is STALE. Exactly one answer is canonical.
  • An answer after expiry is REJECTED with the reason expired.

Clients take the version and the digest from the obligation in the view, not from the surface. Buttons on a surface carry only the obligation ID and the choice, never the digest.

How an approval is decided An agent proposes an operation, the server opens an obligation, a responder answers, and the server checks the answer: accepted, stale, or rejected as expired. 1Agent proposesoperation + argumentsdigest is computed 2Obligation openversion · digestexpires_at 3Responder answersapprove · expected version+ request digest 4Server checksresponder · versionexpiry · digest ACCEPTEDfirst valid answer;agent resumes STALElate or duplicate answer REJECTEDreason: expired A digest mismatch or a non-responder is refused with an error instead.
The answer is checked against the obligation it was given for. Only the first valid answer is accepted.

Surfaces

A surface is a rendered interface for the obligation. It uses the A2UI v1.0 message format (createSurface, updateComponents) and includes a plain-text fallback, so a client that cannot render A2UI can still show the question and answer it.

Try it

With the mock agent, send a message that starts with run :

run ls -la

The agent creates an approval obligation. Answer it from a client. The Go client guide shows the calls.

Next steps