Approvals
For adapter authors
Obligations
An agent that needs permission before it acts produces an approval obligation, a state event of type robotelos.obligation:
| Field | Meaning |
|---|---|
kind | approval |
version | Increases on each change. An answer must name the version it saw. |
status | open until answered, then answered |
responders | Participants allowed to answer: the owner of the agent |
prompt | Text shown to the responder |
target.operation_ref | Which operation is being approved |
target.effective_digest | The digest of what will run |
expires_at | After 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:
- The sender is one of the
responders. - The obligation is
openandexpected_versionequals itsversion. - The obligation has not expired.
request_digestequalstarget.effective_digest.
| Outcome | When | Effect |
|---|---|---|
ACCEPTED | All checks pass on the first valid answer | The obligation is answered; the agent resumes with the answer |
STALE | The obligation was already answered, or the version moved | Nothing changes |
REJECTED (expired) | The answer came after expires_at | Nothing changes |
| Error | The sender is not a responder, or the digest differs | Nothing 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
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.