17. Grants and approvals
Status: partly implemented. Core permission matching and
#authoritybypass-immune member approval policy (`openagents/core/permissions.coax`, `openagents/core/perm_match.coax`, `openagents/core/members.coax`,#14057), Desktop interactive permission cards (`apps/openagents-desktop/page/permit.coax`), and HTTP protobuf agent grants (`coax/web/api/agent-policy.coax`, `coax/web/api/agent-wire.coax`) pass oncpu. Remaining: unified NIP-CAP/NIP-POL protobuf schemas and mobile/web approval sheet parity (openagents/agent/grants.coax).
Premise
The front can now choose a member. This chapter says what that member may do. A description grants nothing, a grant is its own record, and any effect on the world waits for your approval.
Draft
The broader an agent is, the harder it is to say what it may do. This is the sixth pressure, authority, and a composition answers it by making permission as specific as its members.
Three things stay separate. A description says what a member can do. A grant says that this member may do it, here, for you. An approval is your yes to one action. Describing a member grants nothing. Installing one grants nothing. A plan that needs a grant you haven't given stops and asks.
Effects are sorted by what they touch. Reading your files, writing to them, running a command, sending a message in your name and moving money each need their own grant. Money always needs an approval for the specific payment (chapter 33).
The person who owns a computer sets its policy. A paired phone can ask that computer to do something, but it can't widen what the owner allowed. Keys stay on the device that holds them.
An agent that acts for you has its own key and a grant you approve: scopes, spend caps in sats and an expiry. An agent can never widen its own grant. That grant is the first record in this book whose schema is in use (chapter 5).
Episode 250 is the reason for this chapter. Agents invented commands and reported the wrong model, and the fix was typed capabilities and controls backed by evidence. The Coder book builds the sandbox and approval prompt for a coding session. This chapter uses the same pieces for every member.
What we build
A plan for what this chapter ships once the draft is approved:
- Grant records, kept apart from member descriptions.
- An approval step that every surface draws the same way: what will happen, to what, and what it costs.
- A refusal as a normal result with a reason, for a plan that asks for more than it was given.
It builds on what exists today:
- `openagents/core/permissions.coax`, `openagents/core/perm_match.coax`, and `openagents/core/members.coax` (
#authoritybypass-immune grants forWalletPay, vault secrets, and Nostr signing,#14057) - `apps/openagents-desktop/page/permit.coax` (interactive Desktop approval cards & Full Auto mode,
#14063) - `coax/web/api/agent-policy.coax` and `coax/web/api/agent-wire.coax`
- `coder/tui/approvals.coax`
- `coder/tui/host_grants.coax`
- `coax/lib/nostr/cap`
- `coax/lib/nostr/nipkeys.coax`
On the protocol (chapter 65):
| Record | Schema | Carriage | Today |
|---|---|---|---|
| A member's grant | openagents.capability.v1 Grant (spec 19.3) | Nostr: a private record in a kind 3188 envelope (NIP-CAP) | Spec sketch; no .proto file. coax/lib/nostr/cap handles the NIP's JSON |
| Approval of one action | openagents.policy.v1 ApprovalRequest, ApprovalDecision (spec 19.2) | Nostr: a private record in a kind 3188 envelope (NIP-POL) | Spec sketch; no .proto file |
| What an agent may do in its owner's name | openagents.account.v1alpha1 GrantRequest, Grant (`agents.proto`) | HTTP, as binary protobuf | In use: the generated codec coax/web/api/agent-wire.coax (chapter 5) |
The chapter's check
- Source: the grant records in
openagents/agent/grants.coaxand the shared approval step, with a fake member whose one effect writes a file. - Trace: installing the member leaves
state grantsempty. A plan that needs the write opens the approval step, andtreeshows what will happen, to what file and the cost.tap approval.approvelets the member write the file once, andlogsrecords the grant and the approval as separate lines. - Refusal: a plan that asks for more than the grant gives returns a refusal result with its reason, such as `refused: no grant for files.write`, and the file is not written. A paired phone that asks to widen the owner's policy gets the same kind of refusal.
- Independent check: chapter 5's existing checks on the agent grant codec,
coax/web/api/agent-wire.coax, show an agent can't widen its own grant. The approval step's text intreeis the same on web and on the iPhone simulator.
Planned paths: openagents/agent/grants.coax.
Sources
- Episodes:
- Episode 250, *Ready the Fleet*: typed capabilities after invented commands
- Episode 235, *Agents Earn Bitcoin Tips*: bounded agent spending
- Episode 207, *Your Keys, Your Coins, Your Identity*: your keys, your identity
- Episode 204, *DO NOT BREAK USERSPACE*: platform changes that break workflows
- Old code at
coder-v1.0.0, crates:capability,coder-access,coder-boundary,oa-seal,secret-screen - NIPs: NIP-CAP, NIP-KEYS, NIP-POL
- Also:
- Coder book, chapter 5: A sandbox and approvals
- The Return of the General Agent (
git show coder-v1.0.0:docs/essays/2026-10-01-the-return-of-the-general-agent.md), pressure F - Promises covered (audit): P8, P14
Open questions for the owner
- Which grants can a person give once and keep, and which ask every time?