Grants, the never list and approvals
The problem: agents act on your behalf, and some actions (deploying, spending money, deleting data) are too costly to leave to an agent's judgement. You want to hand out the right to act in small pieces you can take back, and keep a few actions that only a person can authorise, one at a time.
Interlinked does this with three things, each recorded as a signed entry in the room: grants, the never list and approvals.
The smallest example
alice owns the room. She gives bob the right to deploy.*. bob passes a narrower part,
deploy.staging, to dana. dana deploys to staging. Then alice takes back her grant, and dana can
no longer act, because her right came through bob's. Finally, production is something no grant can
cover: bob asks, alice approves that one action, and bob acts once.
$GRANT below stands for the id of the first grant, which grant give printed.
$ il init alice
{"address": "<alice address>", "home": "$IL_HOME", "launcher": "$IL_HOME/bin/il", "name": "alice", "project": "<project folder>"}
$ il init bob
{"address": "<bob address>", "home": "$IL_HOME", "launcher": "$IL_HOME/bin/il", "name": "bob", "project": "<project folder>"}
$ il init dana
{"address": "<dana address>", "home": "$IL_HOME", "launcher": "$IL_HOME/bin/il", "name": "dana", "project": "<project folder>"}
$ il --as alice room create team
{"direct": false, "e2ee": true, "history": "shared", "invited": {}, "join": "invite", "keys": "MLS epoch 0: up to date (committer alice (<alice:8>))", "link": "il://local/<room link id>?invite=<invite token>", "members": {"alice (<alice:8>)": "owner"}, "name": "team", "room": "<room id>", "warning": "shared history: later joiners and anyone holding a leaked member key can read past messages (no forward secrecy)."}
$ il --as alice room invite team bob
{"direct": false, "e2ee": true, "history": "shared", "invited": {"bob (<bob:8>)": "member"}, "join": "invite", "keys": "MLS epoch 0: up to date (committer alice (<alice:8>))", "members": {"alice (<alice:8>)": "owner"}, "name": "team", "room": "<room id>"}
$ il --as alice room invite team dana
{"direct": false, "e2ee": true, "history": "shared", "invited": {"bob (<bob:8>)": "member", "dana (<dana:8>)": "member"}, "join": "invite", "keys": "MLS epoch 0: up to date (committer alice (<alice:8>))", "members": {"alice (<alice:8>)": "owner"}, "name": "team", "room": "<room id>"}
$ il --as bob join team
{"detail": "joined", "joined": true, "name": "team", "role": "member", "room": "<room id>", "state": "member"}
$ il --as dana join team
{"detail": "joined", "joined": true, "name": "team", "role": "member", "room": "<room id>", "state": "member"}
$ il --room team --as alice grant give bob 'deploy.*' # selected fields only
{"to_name": "bob (<bob:8>)"}
$ il --room team --as bob grant give dana deploy.staging --parent $GRANT # selected fields only
{"granter_name": "bob (<bob:8>)", "to_name": "dana (<dana:8>)"}
$ il --room team --as alice grant check dana deploy.staging # selected fields only
{"ok": true, "reason": "granted", "who_name": "dana (<dana:8>)"}
$ il --room team --as dana act deploy.staging --arg version=1.4 --note 'lobby fix' # selected fields only
{"status": "done", "by": "grant", "provisional": true}
$ il --room team --as alice grant revoke $GRANT # selected fields only
{"revoke": "<id-1>"}
$ il --room team --as dana act deploy.staging # selected fields only
{"status": "refused", "reason": "grant <grant id> was revoked"}
$ il --room team --as alice grant give bob deploy.production
{"refused": "scope deploy.production is a NEVER action (production); no grant can cover it"}
$ il --room team --as bob act deploy.production --arg version=2.0 --why 'ship 2.0 to players' # selected fields only
{"status": "waiting", "reason": "production can never be granted; it needs a principal's own approval for this one action"}
$ il --room team --as alice approvals # selected fields only
[{"consequences": "ship 2.0 to players"}]
$ il --room team --as alice approve --last # selected fields only
{"kind": "once"}
$ il --room team --as bob act deploy.production --arg version=2.0 # selected fields only
{"status": "done", "by": "approval"}
Notice that dana's last attempt is refused with the reason was revoked, and that the
production request ends waiting until alice approves it.
Grants only narrow
A grant gives someone the right to perform a kind of action, named by a scope such as
deploy.staging (one action) or deploy.* (every action under deploy). The holder of a grant can
pass on a part of it, never more.
il act checks the whole chain from dana back to alice. The chain is valid when it starts at a room
owner, every link keeps the scope and the expiry the same or narrower, and none has been revoked.
So taking back bob's grant also ends dana's.
il actrecords which grant covered which action, and refuses with the reason and the command to ask for access when nothing does.il grant check WHO ACTIONanswers "may this agent do this now?" without acting.provisional: truein a result means no witness covers the entry yet. A witness is an entry that records how far each author's chain had got at one moment, so until one exists the time comes from the local clock (Signed entries). It does not change whether the action was allowed.
The never list
Some actions can never be granted, whatever the chain: production (deploy.production), spending
money (money.spend, payment.*), deleting data or repositories (data.delete, repo.delete)
and sending secrets (secret.send). The reason is simple: these are the actions that are hard to
undo, so a person decides each one. Spelling an action differently does not get around the list, and
not even a room owner can put one into a grant, as the refused line in the transcript shows.
If you need to change the list, the setting that does it asks for an explicit confirmation, because it weakens a safety rule.
Approvals
A never-list action needs a principal's own approval for exactly that one action. The principals of a room are its owners and anyone the room names as a principal.
Here alice is the principal. Notice that bob asks first, alice decides, and then bob repeats the same action: the approval is spent by that second request.
An approval is a signed entry. It:
- names the one key that may use it (bob's),
- covers that exact action: a different version needs a new approval,
- is used once, and
- expires (
work.approval.default_expiry_ms).
Identical requests from several agents are merged, so a principal sees one line per decision, and
il approvals lists what is waiting. A principal can refuse a request with a reason
(il approve --refuse REASON). The principal who signed an unused approval, or any current
principal, can cancel it with il approval delete; the cancellation is itself a signed entry. A
person who has no key can approve from a browser or phone through il page serve, which enrols the
browser's own key.
Stopping an agent
il ops stop AGENT stops an agent's wakes (the times il serve calls it because a message arrived),
and il ops resume AGENT lets them run again. They control whether the agent is called, not what it
is allowed to do.
Next
Files, leases and patches covers how agents work in one repository without overwriting each other.