Give an AI agent one task.
And nothing more.
TaskMandate is an open protocol and developer toolkit for delegating a single task on a single website to an AI agent. The mandate carries exactly what is allowed — one origin, one task, one time window, one action budget — and the website verifies it on every request, by itself, without calling anyone.
Why
An agent should inherit a task, not an account.
When software acts for a person today, it does so with a credential that was never scoped to the job: an API key that opens every endpoint, an OAuth token with broad scopes and a long life, or a browser session that is simply the whole account. The person hands over more authority than the task needs, and the website has no way to tell what the agent was actually hired to do.
Account-level authority
- One key or token for every endpoint and every task
- Valid until someone remembers to revoke it
- No limit on how many times the agent acts
- The site either trusts the caller fully, or blocks it
Task-level authority
- Bound to one site origin and one task type
- Expires on its own — chunks of minutes, renewed while the task runs
- Optional action budget, e.g.
maxActions: 1 - The site refuses out-of-scope requests with a reason code
How it works
A signed permission, checked on the receiving side.
The person signs a mandate with their own key. The agent signs each request with its own key and sends the mandate alongside it. The website verifies both signatures, the audience, the task, the time window and the action count — then allows the request or returns one reason code.
A compact SD-JWT VC naming the agent's public key, the site, the task, the expiry and an optional action limit.
HTTP Message Signatures (RFC 9421, Web Bot Auth tag) over the actual request, with the mandate in an Agent-Mandate header.
Checks signatures, audience, task, clock and counters against its own store. No issuer call, no network check.
// 1. Issue a mandate for one task, on one site, for 30 minutes import { issueMandate } from "@task-mandate/core"; const mandate = await issueMandate({ principalKey: principal.priv, agentPublicKey: agent.pub, audience: "https://court.example", task: { type: "reserve", resource: "court-3" }, limits: { maxActions: 1 }, durationSec: 1800, }); // 2. Sign the request as the agent const signed = await signRequest(reserve(), { mandate, agentKey: agent.priv }); // 3. Verify on the website, offline const decision = await verifyRequest( signed, { origin: "https://court.example" }, { requireTask: { type: "reserve", resource: "court-3" } }, memoryStore(), ); if (decision.decision !== "allow") throw new Error(decision.code);
The public demo runs a voice-delegation flow against a mock civil-service counter. It exists to show the headers, the verification and the refusal codes end to end.
Enforcement
What the website can actually check.
Every check is local and deterministic. A failed check returns one code, so the agent can be told why it was refused without exposing anything else.
| Check | Enforced by the site | Reason code |
|---|---|---|
| Audience | The mandate is for this origin and no other | AUD_MISMATCH |
| Task | Type and resource match the route that requires them | TASK_NOT_ALLOWED |
| Time window | Not before, not expired, not longer than the site allows | NOT_YET_VALID · EXPIRED · LIFETIME_TOO_LONG |
| Action budget | No more than maxActions; refunded when the handler fails | LIMIT_EXCEEDED |
| Request signature | Signed by the key the mandate names | SIG_MISSING · SIG_INVALID · KEY_MISMATCH |
| Replay | Each signature nonce is used once | REPLAY |
| Issuer trust | Only mandates from issuers the site lists | ISSUER_NOT_TRUSTED |
| Person attestation | Optional binding of a person to the principal key | PERSON_REQUIRED · PERSON_INVALID |
| One active task | One live task per person, when the site asks for it | SUPERSEDED |
Built on what already exists
A profile, not another identity stack.
TaskMandate does not invent a new token format or a new handshake. It adds one header and a few claims to standards a website can already implement and an auditor can already read.
SD-JWT VC
The mandate is a verifiable credential the person signs. Claims are plain JSON; the signature is checked with the principal's own key.
RFC 9421 · Web Bot Auth
Each request carries an HTTP Message Signature using the Web Bot Auth tag, so the signature covers the request that was actually sent.
Ed25519 & JWK thumbprints
Keys are Ed25519 JWKs. Identifiers are RFC 7638 SHA-256 thumbprints, so nothing has to be registered anywhere to be named.
Packages
Small, separate, and usable on their own.
Six packages on npm at version 0.3.0. The core runs on WebCrypto alone with no I/O; the agent side runs in browsers, Cloudflare Workers and Node.js.
| Package | What is in it |
|---|---|
@task-mandate/core | Issuing and verifying mandates, person attestations, renewal planning, the Store interface and an in-memory store. WebCrypto only. |
@task-mandate/agent | signRequest, mandatedFetch and the long-task Renewer. |
@task-mandate/hono | The taskMandate middleware for Hono, including action refunds on failure. |
@task-mandate/cli | The tm command: keys, issuing, inspecting and renewing. |
@task-mandate/store-conformance | A Vitest suite for checking your own Store implementation. |
@task-mandate/store-pg | PostgreSQL Store and the pilot online store. |
On the website
import { taskMandate, memoryStore } from "@task-mandate/hono"; const guard = taskMandate({ origin: "https://court.example", store: memoryStore() }); app.post("/reserve", guard({ requireTask: { type: "reserve" } }), handler);
On the agent
import { mandatedFetch } from "@task-mandate/agent"; // checks audience and expiry before it signs and sends await mandatedFetch("https://court.example/reserve", init, { mandate, agentKey });
Status
Research preview, stated plainly.
TaskMandate is experimental code at version 0.3, published so the protocol can be read, tested and argued with. It is not a finished product, and we would rather say so than let a website deploy it believing otherwise.
What it does today
- Offline mandate and request verification
- Hard time windows and action budgets
- Replay protection and optional one-task-per-person
- Long tasks through renewed short mandates
What it deliberately leaves out
- Real identity enrolment and payments
- No online revocation in v0 — a stopped delegation stays usable until it expires
- General browser automation
- Automated review only; no independent security audit yet
Action limits and task checks apply only on routes that set requireTask, and trustedIssuers is empty by default. Read Before you deploy in the repository before putting this in front of real users.
국문 요약
한 과업, 한 사이트, 정해진 시간과 횟수.
TaskMandate는 사람이 AI 에이전트에게 하나의 과업만 맡기도록 만드는 오픈소스 프로토콜입니다. 위임장에는 사이트 주소, 과업 종류, 만료 시각, 최대 실행 횟수가 함께 서명되어 담기고, 웹사이트는 요청이 올 때마다 그 위임장을 스스로 검증합니다. 발급자에게 다시 물어보지 않습니다.
계정 권한(API 키, OAuth 토큰, 브라우저 세션)을 통째로 넘기는 대신, 필요한 만큼만 정해진 기간 동안 넘깁니다. 표준(SD-JWT VC, RFC 9421 HTTP Message Signatures · Web Bot Auth, Ed25519)을 그대로 쓰고, 그 위에 헤더 하나와 몇 개의 클레임만 더했습니다. 코드는 Apache-2.0 라이선스로 공개되어 있습니다.
현재 버전 0.3은 연구용 미리보기이며, 실제 신원 확인·결제·온라인 철회는 아직 포함하지 않습니다.
Read the spec, run the demo, break it.
Source, specification, integration guide and security policy are in the repository. We are glad to hear about a case the profile gets wrong.