How to prove a person, not their agent, approved an action
An agent can click Approve as easily as you can. Here is what it can't do.
On this page
- Why “approved by alice” proves nothing
- What proof of human approval needs
- Why checkboxes, codes, and labels fall short
- Put the action in the challenge
- Human approval for agents in Go with tensile-auth
- Step-up when the person acts themselves
- Verify an approval later
- What this proof doesn’t cover
- FAQ
- Key takeaways
Why “approved by alice” proves nothing
Your coding agent wants to send a payout of 4,200 EUR. Your app asks for a human in the loop, so it shows an “Approve” button, and the click writes a log line: payout approved by alice.
Ask what that line proves. The button sends an HTTP request with alice’s session. An agent that drives her browser, or holds a token for her account, sends the same request. The log line is a row in a database. Anyone who can write to that database can write the same row, with any name, after the fact. Nothing in the record separates alice from software acting for her.
This post is about the missing piece: proof of human approval. That is evidence, which someone else can check later, that a specific person, and not their agent, approved one specific action. Agents make it urgent, because an agent acts with its person’s identity and can reach every screen its person can.
What proof of human approval needs
Proof needs five properties. Each one closes a gap that the others leave open.
- A person who is present and verified. WebAuthn separates two checks. User presence means someone touched the authenticator. User verification means the authenticator itself checked who it was, “through a touch plus pin code, password entry, or biometric recognition” (WebAuthn Level 3, the W3C Recommendation of 25 August 2026). The authenticator reports the result in bit 2 of the flags in its authenticator data, the UV bit. When the server asks for user verification, it must check that bit.
- Bound to the exact action. The proof must cover what happens, its amount or scope, and who asked for it. Payments regulation has required this for years. The EU’s rules for strong customer authentication call it dynamic linking: the authentication code must be specific to the amount and the payee, and any change to either must make the code invalid (Commission Delegated Regulation (EU) 2018/389, Article 5; the EBA’s Q&A 2019_4556 quotes paragraph 1).
- Used once. A proof that works twice is a proof for an action nobody approved. WebAuthn’s challenges exist for this: the server makes them at random, “at least 16 bytes long”, and accepts each response only for the challenge it issued (WebAuthn Level 3, section 13.4.3).
- Recorded where edits show. The approval goes into a log in which changing, deleting, or reordering an entry is detectable. The classic design is a hash chain, in which each entry’s hash covers the entry before it (Schneier and Kelsey, 1999).
- Checkable by someone else. The check uses only public data: the signed response, the passkey’s public key, and the site’s identity. An auditor can repeat it without trusting your server’s word.
Why checkboxes, codes, and labels fall short
Most approval flows meet none of the five. Compare them by what an agent can do on its own.
| Approach | Can an agent produce it? | Bound to the action? | Checkable later? |
|---|---|---|---|
| An “Approve” button | Yes, if it drives the browser or holds the session | No | No: a log line |
| A one-time code by SMS, email, or an authenticator app | Yes, if it reads the inbox or the person types the code into the agent’s page | No: a code works for whatever is pending | No |
A label or trailer, such as Approved-by: alice |
Yes: it’s text the agent writes | No | No |
| A passkey signature with user verification over the action | No: it needs the person’s authenticator and their fingerprint, face, or PIN | Yes | Yes |
One-time codes deserve a closer look, because they feel like a second factor. NIST’s SP 800-63B-4 says plainly that “OTP authentication is not phishing-resistant”, and that an authenticator whose output a person types in by hand is never phishing-resistant, because nothing binds the code to the session it’s typed into. The same gap lets an agent relay a code. A passkey’s signature is bound to the site’s origin and to the challenge, so it can’t be relayed to another site or reused for another action.
Put the action in the challenge
The way to bind a passkey signature to an action is to make the challenge depend on the action. A WebAuthn authenticator signs its authenticator data followed by the SHA-256 hash of the client data, and the client data contains the challenge (WebAuthn Level 3, section 7.2). If the challenge is a hash of the action, the signature covers the action.
tensile-auth builds the challenge in two steps:
- The action’s digest.
auth.Actionholds aKind, aResource, theParamsthat matter, and theSummarythe person reads.Action.Digestis the SHA-256 of its JSON, with the fields in a fixed order and the params sorted by key. The summary is part of the digest, so the text the person approved is the text that was signed. - The challenge.
auth.ApprovalChallengeis the SHA-256 of a fixed label, the approval’s ID, and the digest. The ID holds 16 random bytes, so no two challenges are the same, even for the same action asked twice.
Change one character of the action and the challenge changes, so the signature no longer matches. Try it: edit the amount or the payee that alice approved.
Send 4200.00 EUR to Acme GmbH
- Action digest
e79ea1dcbe8125d1549cd4cc8f7f157cff8f9b824753760518c58d70191ff3cd- Challenge for this action
cc3e4459cf69ea31cdc9e01b2adf97a0d4ffe5da894512270391820027c5404b- Challenge alice's passkey signed
cc3e4459cf69ea31cdc9e01b2adf97a0d4ffe5da894512270391820027c5404b
Receipt verifiesThe challenge matches, so the signature in alice's receipt covers this exact action.
apr_lf-16B408ZwAJD7CppUG0Q for agent agt_ecdc7f160c4f03fd2da0bc32829c6837. The digest and challenge are computed in your browser, the same way tensile-auth computes them.The figure computes the same bytes that the library does. Its tests check the result against tensile-auth’s own Digest and ApprovalChallenge.
The W3C’s Secure Payment Confirmation specification makes a fair objection to this design. It calls storing payment details in the challenge a misuse of a field meant to defeat replay, and notes that plain WebAuthn has no specified way to show those details to the person. tensile-auth keeps a random part in the challenge for replay protection. The second point stands, and the section on limits covers it.
Human approval for agents in Go with tensile-auth
tensile-auth is an open-source Go library for sign-in where people and their agents both act. Its approvals put the five properties together. An agent’s request gets a refusal that carries an approval. Its person approves with one passkey tap. The agent retries, and the route runs once.
Describe the action
Write a function that describes the action from the request. Put in everything the person must see, including the agent that asked, so the signature covers who asked too:
func payoutAction(r *http.Request) auth.Action {
who, _ := auth.FromContext(r.Context())
amount, payee := r.FormValue("amount"), r.FormValue("payee")
return auth.Action{
Kind: "payout.send",
Resource: "account:" + r.PathValue("account"),
Params: map[string]string{
"amount": amount,
"payee": payee,
"agent": string(who.Agent),
},
Summary: "Send " + amount + " to " + payee,
}
}
The handler must act on the same fields that the description reads, here the parsed form, so what runs is what was signed.
Guard the route
Wrap the route in authhttp.Approvable with the route’s need. A person who meets the need passes. An agent gets a refusal with an approval in it:
var payoutNeed = auth.Need{Action: "payout.send", Assurance: auth.AssuranceMulti, Human: true}
mux.Handle("POST /accounts/{account}/payouts", authhttp.Public,
authhttp.Approvable(payoutNeed, payoutAction)(sendPayout))
With authhttp.WithApprovalURL("/approve/") on the mux, the agent’s first call gets this 403 response:
{
"code": "human_required",
"title": "A person must do this",
"fix": "Ask the person responsible for this agent to approve it, then retry with the Tensile-Approval header.",
"challenge": {
"action": "payout.send", "assurance": "multi", "human": true,
"approval": {
"id": "apr_auL8dghHbk61NIUDzrqhEA",
"url": "/approve/apr_auL8dghHbk61NIUDzrqhEA",
"summary": "Send 4200.00 EUR to Acme GmbH",
"expires_in": 300
}
}
}
The agent shows its person the URL and retries the same request with the header Tensile-Approval: apr_auL8dghHbk61NIUDzrqhEA.
Approve with a passkey
The approval page shows the action from svc.Approval and runs one passkey ceremony. pk.BeginApproval sets the WebAuthn challenge to ApprovalChallenge for this approval and asks for user verification. pk.FinishApproval checks the signed response and returns a proof that holds the receipt, and svc.Approve records it:
// GET /approve/{id}/options: the passkey prompt for one approval.
func approvalOptions(w http.ResponseWriter, r *http.Request) {
human, _ := auth.FromContext(r.Context())
a, err := svc.Approval(r.Context(), human, r.PathValue("id"))
if err != nil {
authhttp.Error(w, r, err)
return
}
opts, err := pk.BeginApproval(r.Context(), human, a)
if err != nil {
authhttp.Error(w, r, err)
return
}
w.Header().Set("Content-Type", "application/json")
w.Write(opts)
}
// POST /approve/{id}: the response from navigator.credentials.get.
func approve(w http.ResponseWriter, r *http.Request) {
human, _ := auth.FromContext(r.Context())
body, err := io.ReadAll(io.LimitReader(r.Body, 64<<10))
if err != nil {
authhttp.Error(w, r, err)
return
}
proof, err := pk.FinishApproval(r.Context(), human, body)
if err != nil {
authhttp.Error(w, r, err)
return
}
if err := svc.Approve(r.Context(), human, r.PathValue("id"), proof); err != nil {
authhttp.Error(w, r, err)
return
}
w.WriteHeader(http.StatusNoContent)
}
Show a.Action.Summary and the agent that asked next to the button, because that’s the text the person signs.
What the library enforces
- Only the person can decide.
svc.Approval,svc.Approve, andsvc.Denyaccept only a human session of the approval’s user. An agent is refused, and another user getsnot found, so they can’t learn the approval exists. - A fresh, verified tap. The passkey ceremony requires user verification. The person must meet the route’s own need, and the tap counts as a fresh multi-factor proof.
- Once, and only for this action. A request waits 5 minutes for its person (
auth.ApprovalTTL), and an approval waits 5 minutes to be used. Approving twice fails.svc.RedeemApprovalspends the approval once, only for the agent that asked, and only for an action with the same digest. A redeem by another agent, or for another action, fails without spending the approval, so nobody can burn an approval they don’t own. - Every step in the audit log. The log records
approval_requested,approval_granted,approval_denied, andapproval_redeemed. Theapproval_grantedevent holds the receipt: the credential ID, the authenticator data, the client data, and the signature.
Step-up when the person acts themselves
Approvals are for actions an agent asks for. When the person does the action themselves, ask them to step up instead. Give the route’s Need a Purpose, such as auth.For("secrets.edit", "repo:acme/api:prod"), and the need passes only after the person confirms with a passkey for that purpose: pk.FinishStepUp returns the proof, and svc.Elevate records it.
The elevation counts only for that purpose, for 10 minutes by default and at most 1 hour (auth.MaxElevation), and the log records session_elevated. It’s a window, not a receipt: it proves the person was there, not that they signed one exact action. When you need the receipt, use an approval.
Verify an approval later
A receipt in the log is worth something only if you can check it. pk.VerifyReceipt checks a receipt against the passkey’s stored public key. It returns passkey.ErrReceiptInvalid unless all of these hold:
- The credential belongs to the user and is still stored.
- The client data is a
webauthn.getresponse from one of your origins, and its challenge equalsApprovalChallengefor the receipt’s approval ID and digest. - The authenticator data is for your relying party ID and has the UV bit set.
- The signature is valid over the authenticator data and the hash of the client data.
To prove that alice approved a given action, recompute its digest, find the receipt for it, check the log’s chain, and check the receipt:
func verifyApproval(ctx context.Context, user auth.UserID, act auth.Action, trusted []auth.ChainHead) error {
if _, err := svc.VerifyAudit(ctx, trusted...); err != nil {
return err // auth.ErrAuditTampered names the first bad position
}
evs, err := svc.Events(ctx, auth.EventFilter{User: user, Kinds: []auth.EventKind{auth.EventApprovalGranted}})
if err != nil {
return err
}
want := act.Digest()
for _, ev := range evs {
var r auth.Receipt
if ev.Pos == 0 || json.Unmarshal([]byte(ev.Detail), &r) != nil || r.Digest != want {
continue // not sealed into the chain yet, or another action
}
return pk.VerifyReceipt(ctx, user, r)
}
return errors.New("no approval for this action")
}
Keep the action itself somewhere you can read it back, for example next to the payout it caused. The log stores the summary and the receipt, and the receipt stores the digest, so the full action is what lets a verifier recompute that digest.
The chain needs one more thing. Someone with write access to the database could rebuild the whole chain, so svc.Checkpoint signs the chain’s head with an Ed25519 key. Store each checkpoint where your database administrators can’t change it, and pass the latest one to VerifyAudit. The security page describes the log.
This is the output of one run of the code in this post, on SQLite. It approves the 4,200 EUR payout, tries a few things an agent might, then edits the summary of the approval request in the database by hand:
redeem while pending: auth: approval pending
approve again: auth: not found
redeem for 42000: auth: approval invalid
redeem for 4200: <nil>
redeem again: auth: approval invalid
verify 4200: <nil>
verify 42000: no approval for this action
forged receipt: passkey: receipt doesn't verify
no UV: passkey: receipt doesn't verify
verify chain after edit: auth: audit log has been tampered with: event at position 5 (seq 5) changed
The forged receipt is the real one with its digest pointed at 42,000 EUR. The “no UV” receipt is the real one with the UV bit cleared. Both fail, because the signature covers both.
What this proof doesn’t cover
Proof of human approval is narrower than it sounds. Know where it stops:
- User verification is the authenticator’s claim. The server trusts the UV bit because it trusts the authenticator. A software authenticator can set it with nobody there: the run above uses one for testing. Count only passkeys that the person registered from their own device, and keep agents away from registering passkeys.
- Verified isn’t identified. WebAuthn notes that user verification “does not give the Relying Party a concrete identification of the user”. Two people who share a device and its PIN look the same.
- The person reads your page, not the authenticator. The signature covers the summary you showed. A page that a script or extension has changed can show other text, and the passkey prompt doesn’t show the action. Secure Payment Confirmation adds a browser-drawn confirmation screen, but only for payments.
- The chain has two gaps. It can’t detect an edit to an event before the event is sealed, and it can’t detect a rebuilt chain unless you keep checkpoints out of the attacker’s reach.
svc.Runseals once a minute, which keeps the first gap short. - A deleted passkey ends the check.
VerifyReceiptreads the public key from the store. If the person deletes that passkey, its receipts no longer verify. Keep public keys with your records when you need proof for years. - Approval isn’t understanding. A signature proves the person approved the text in front of them. Write summaries that a tired person reads correctly.
FAQ
Is this the same as human-in-the-loop?
It’s the part of human-in-the-loop that leaves evidence. A loop that asks a person for a click puts a human in the flow. Proof of human approval lets someone else check, later, that the human was really there and agreed to that exact action.
Why not send a one-time code?
A code isn’t tied to an action or to a site. Whoever holds it, including an agent or a phishing page, can use it for whatever is pending. A passkey signature is tied to your origin and to a challenge built from the action.
Can an agent approve its own request?
No. Only a human session of the approval’s user can view or approve it, and the approval itself needs a passkey tap with user verification. An agent’s session is refused.
Do people need a hardware security key?
No. Any passkey that does user verification works, such as one in the phone’s or computer’s platform authenticator or in a password manager.
What happens when the person says no?
svc.Deny records approval_denied, and the agent’s retry gets approval_denied with the fix “Ask them before trying again.”
Key takeaways
- An approval button and a log line prove nothing about who approved: an agent can produce both.
- Proof of human approval needs a verified person, a binding to the exact action, a single use, a tamper-evident record, and a check that someone else can repeat.
- A passkey assertion with user verification, over a challenge built from the action’s digest, gives you the first three. A hash-chained log with signed checkpoints gives you the fourth.
- In tensile-auth,
authhttp.Approvableturns an agent’s refusal into an approval,svc.Approverecords the signed receipt, andpk.VerifyReceiptandsvc.VerifyAuditcheck it later. The agents page has the overview.
Try it
Give your coding agent this line to add tensile-auth to your Go app, then wrap risky routes in authhttp.Approvable:
Add sign-in with tensile-auth. Read https://auth.tensile.tools/llms.txt and follow it.