Approvals
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
| Field | Meaning |
|---|---|
kind | approval |
version | Increases when the obligation changes; an answer must name the version it saw |
status | Open or answered |
responders | The participants allowed to answer: the owner of the agent |
prompt | Text shown to the responder |
target | The operation being approved: its operation_ref and effective_digest |
expires_at | After 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:
- the sender is one of the responders;
- the obligation is open and the
expected_versionmatches; - the obligation has not expired;
- the
request_digestequals 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
REJECTEDwith the reasonexpired.
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.
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
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.