Try the demo

Use cases

Read and write, ask before deleting

A person lets an agent read and write notes for a while. Deleting still asks, every time, because the app marks it hard to undo.

The person signs

Write new notes

Kind of approval
Give limited access
Who decides
Anyone with notes
Service
Notes, a 60-line example app
Level
L1
Capability
notes:write
State
Live on the demo
Open it on the demo

A person wants their assistant to keep notes for them, without being asked every time and without giving it the power to destroy anything.

What happens

  1. The assistant adds a note. The app answers with a link, and the person approves "Write new notes".
  2. On the page, the person chooses how much (this request, all notes, or everything of this kind) and how long (one hour to 30 days, as far as the action allows).
  3. For that time, the assistant works without asking again. On the hosted demo an agent without a verified vendor asks again after an hour.
  4. The assistant tries to delete a note. Deleting is classed as hard to undo, so the app asks for a new approval, at level 2, for that note only.

A wide approval never includes payments or deletions. That line comes from the class the app gives each route.

What the app had to write

routes = [
    route("GET", "/notes", "notes:read", level=1, resource="note:*"),
    route("POST", "/notes", "notes:write", cls="write", level=1, resource="note:new"),
    route("DELETE", "/notes/{id}", "notes:delete", cls="write-hard", level=2, resource="note:{id}"),
]

Taking it back

The wallet lists every grant: what it allows, for which app, for which agent, until when. Revoking takes one tap. The app refreshes its revocation list in the background, so the agent is refused shortly after: normally within 6 minutes for reads and reversible writes, and 90 seconds for serious actions.

Next caseOrder within a budget