Skip to main content
This page covers three rounds of work on @glinr/theauth. The first two aim to make an agent’s actions checkable before and after they run. The third makes revocation reach the tokens an agent already holds. The changes sit in pending changesets in the repository and are merged to main. This page does not name a release number. Check the GitHub releases for what has been published, and the changelog for breaking changes. The pending set now includes major changesets (hooks, the HTTP handler, audit v2, the MCP stores, SAML, cookies and more). Read Upgrading to 2.0 before you upgrade, and the “Behavior changes” list below.

Accountability at runtime (first round)

  • Three way decisions. policy.evaluate returns allow, deny or escalate. Risk tiers map an amount, currency or data class to no approval, human approval or step up. See Agent accountability and Policy engine.
  • Delegation keeps its limits. A delegated permission carries its constraints, narrowed against the parent, and a child that does not overlap the parent now gets a deny instead of the parent’s wider value. See Delegation.
  • Revoking an agent cuts its delegations. agent.revoke() also revokes the chains where the agent is source or target, and everything downstream. See Cascading revocation.
  • Richer audit rows. Rows record the accountable human, the acting agent, the policy version, the approver and the delegation chain. Delegation and approval events join the hash chain. See Tamper evident audit trail.
  • Fail closed fixes. maxCallsPerHour: 0 denies, malformed time windows and IP lists deny, a revoked or suspended agent is denied by evaluate, and an unknown agent id is denied.

Tools, approvals and proofs (second round)

  • Single use approvals. authorize() and policy.evaluate() accept an approvalId. An approval is checked against the agent, action and resource, then spent once. See Approval flows.
  • Tool guard. guardTool and guardTools put the policy engine in front of any tool with an execute function. Walkthroughs for the Vercel AI SDK and the OpenAI Agents SDK, with the shared pieces in Guard agent tools. LangChain appears as a hand wrapped example, not a supported integration.
  • Taint guard. Tool arguments can carry labels for where they came from, and policy decides which labels may reach which tools. The labels are written to the audit row. See Taint aware tool guard.
  • Policy shrink. analyzeUsage, suggestShrink and verifyShrink compare what an agent may do with what it did, and report which recorded decisions would change. They never edit permissions. See Policy shrink.
  • Audit checkpoints and receipts. Signed checkpoints over the audit log, with inclusion and consistency proofs and receipts that verify offline with a public key. See Audit checkpoints and receipts.
  • MCP live delegation check. With delegationStore set, a token’s act chain is re-checked against live links, and resolveActorAgentId maps actors to agent ids. The third round replaces this with a signed binding that needs no config. See MCP OAuth 2.1.
  • Session and audit fixes. Session refresh and maxConcurrent no longer race, a failing audit write no longer makes authorize() throw, and canonicalJson rejects cycles.

Revocation, remote guards and storage (third round)

  • Revocation reaches MCP tokens. Exchanged tokens carry a signed theauth_dlg binding to their delegation links and agents. With auth, revoking a link, an agent, a user’s sessions or a token fails the next request on every instance that shares the database. Modes are live, cached and offline. See MCP token revocation.
  • Introspection. POST /mcp/introspect (RFC 7662) gives resource servers the live answer. Only the token’s client and listed resource servers learn the inactive reason.
  • Client ID metadata documents. A client can use an https URL as its client_id, behind a required consent page, host rules, size and time limits and an admin block list. See Client ID metadata documents.
  • Database backed MCP server. Clients, codes, tokens and refresh families live in the theAuth database, and an OAuth client can be bound to an agent.
  • One HTTP handler. createTheAuthHandler serves every route for every framework adapter, with identical status codes. See the route reference.
  • Explain and policy tests. explain() returns the matched grant, the delegation chain and near misses. @glinr/theauth/testing and theauth policy test run policy suites. See Explain a decision and Policy testing.
  • Remote guards. httpGuard and guardHook put a signed, fail closed external check in beforeAuthorize. See Remote guards.
  • Observability. One typed event per decision, an OpenTelemetry mapping and a logger interface. See Observability.
  • Audit API v2. Explicit order, cursor paging, an event column and decision_code filters.
  • Schema ledger. Every schema change is recorded in theauth_schema_migrations, with theauth db status | up | sql.
  • Typed decision codes and typed permissions. authorize() returns a code, and definePermissions turns resource and action typos into compile errors.
  • Security fixes. Strict SAML signature verification, a signed session cache in @glinr/theauth-nextjs-auth, Secure cookies by default and PBKDF2 at 600000 iterations, and revoked or expired delegators no longer lend permissions.
  • Storage. Postgres works across the instance with epoch second timestamps, and provider: "sqlite" refuses a file URL (use sqlite-native).
  • Tooling. theauth init and theauth doctor are rebuilt, and theauth.user.create replaces hand written inserts.

Behavior changes to check

  • ABAC requireApproval now escalates instead of returning a plain deny. allowed is still false.
  • policy.evaluate writes an audit row on every call, and the row joins the hash chain.
  • A permission with requireApproval: true is denied until the call carries a valid approvalId.
  • Delegated constraints that do not overlap the parent now deny every call.
  • checkLiveDelegation takes an options object as its fourth argument in place of the now date.
  • Rows written before the new audit columns verify as erased history, not as tampered.
  • With auth, MCP validation reads the database on every request by default (live mode). Set revocation.mode: "cached" above roughly a thousand validations per second per instance.
  • Agent tokens start with ta_. Existing kv_ tokens keep working.
The rest, with the action to take for each, is in Upgrading to 2.0.

Tutorials

Limits that still apply

  • input_provenance holds the labels you supply. The SDK does not infer where an input came from.
  • The approver is stored on the approval’s audit row and on the decision that spends it, not on every decision row.
  • CheckpointStore ships with an in memory implementation. There is no database backed store.
  • The MCP adapters do not serve the /mcp/revoke or /mcp/jwks routes that the metadata advertises.
Last modified on October 18, 2026