Approvals

Obligations, the operation digest, answering rules, the expiry and the surface rendering of an approval.

Obligations

An agent that needs permission before it acts produces an approval obligation, a state event of type robotelos.obligation:

FieldMeaning
kindapproval
versionIncreases on each change. An answer must name the version it saw.
statusopen until answered, then answered
respondersParticipants allowed to answer: the owner of the agent
promptText shown to the responder
target.operation_refWhich operation is being approved
target.effective_digestThe digest of what will run
expires_atAfter this time the obligation cannot be answered

The server keeps an obligation answerable for a limited time. The Go server’s default is 15 minutes.

The digest

The digest of an approval is the SHA-256 of three values: the capability ID, the contract version and the effective arguments of the operation. The execution environment is not part of the digest in version 1.

An approval applies to exactly the operation whose digest the responder saw. If the agent proposes different arguments, the digest changes, and an answer to the old digest is refused.

Answering

A client answers with robotelos.answer_obligation (Commands). The server checks, in this order:

  1. The sender is one of the responders.
  2. The obligation is open and expected_version equals its version.
  3. The obligation has not expired.
  4. request_digest equals target.effective_digest.
OutcomeWhenEffect
ACCEPTEDAll checks pass on the first valid answerThe obligation is answered; the agent resumes with the answer
STALEThe obligation was already answered, or the version movedNothing changes
REJECTED (expired)The answer came after expires_atNothing changes
ErrorThe sender is not a responder, or the digest differsNothing changes; the error says why

Exactly one answer is canonical. A second answer, from any device, is STALE.

A client MUST take the version and the digest from the obligation in its view. It MUST NOT take them from a surface, because a surface can be stale or forged. The Go SDK does this for you.

Surfaces

A surface (robotelos.surface) renders an obligation for people. It carries:

  • messages: A2UI v1.0 messages (createSurface, updateComponents);
  • fallback: the same question as plain text, for clients that cannot render A2UI;
  • obligation_id: the obligation the surface belongs to.

Buttons on a surface carry only the obligation ID and the chosen answer, never the digest. A client that cannot render a surface MUST still show the fallback and let the user answer.

Next steps