CSE Roadmap

Core tier · about 4 hours · 12 parts

Part 2 of 12 · 2 min read

A token that names the action is worth more than a flag that names the moment

A boolean "approved" flag says only that a human said yes to something at some point, and the executor has no way to recover what that something was.

Think of a bouncer who stamps a hand once at the door. The stamp proves someone was let in. But it says nothing about which room they are now trying to enter. The stamp does not name a room.

An approval token is a signed record that a named human approved one specific action, and binding is tying that token to the action name, the exact arguments, the session, the approver, an expiry and a nonce. That means the token is useless for anything except the one thing it was issued for.

A worked example. A human approves a refund of 50.0 on ORD-123456. With a plain boolean flag, every one of 4 attacks tried afterward succeeds: the agent executes a refund of 5000.0 instead, or calls delete_order instead, or replays the same approval twice, or adds an unapproved field -- the flag says "approved" and never asks approved-what. With a bound token, all 10 attacks against it fail, including the same changed-amount and different-action attacks, because the token itself carries a hash of the original arguments and the original action name.

The key lines. From code/mini-approvals/approvals.py:

# from code/mini-approvals/approvals.py
def issue(self, action, args, session, requester, approver, now, ttl=300, state_version=None, nonce=None):
    p = {"action": action, "args": args_hash(args), "session": session, "requester": requester, "approver": approver,
         "exp": now + ttl, "nonce": nonce or base64.b16encode(os.urandom(8)).decode(), "ver": state_version}

Read it as: every field in this dictionary is something the executor will later re-check against the live call. The token is not a yes/no bit with some metadata attached. It is a complete description of the one action it covers. Verification is just comparing this description against what is about to run.

Approval token, binding

An approval token is a signed record that a named human approved one specific action. Binding is tying the token to the action, arguments, session, approver, expiry and nonce.

Example: a token issued for refund on ORD-123456 for 50.0 carries action: "refund" and a hash of that exact argument dictionary -- present it against a call for 5000.0, and the hash comparison fails before anything else about the token is even checked.