All docsEnterprise demoValidationSIEM streamingChangelogTOKENLOCK

Enterprise access controls

Zero-trust access for teams, vendors and AI agents: registered signing keys, scoped permissions, revocation checked on every verify, and a decision log of the events listed below, streamed to your SIEM if you want. Current release: npm SDK 0.5.3, published as @tokenlock/sdk (0.5.3 is a rename only, same API as 0.5.2; 0.5.0 was the security release). PHP drop-in: see the table below. 0.4.4 was a prior security correction (input validation and policy-expiry checks on every code path, including self-verify evaluate() and local policies; 0.4.3 and 0.4.2 are deprecated). Security: advisory 2026-11-18.

One grant, then revocation

Registered keys get one route. When the key is revoked, the next hosted check is denied.

Policy01

Narrowed to one route

Registered keys

You grant a key specific routes, methods, and environments. Everything else is denied. Missing policy means no access.

Authorization rule →
Revoke02

Enforced on the next check

Hosted, strict mode

In strict mode with registered keys, the hosted API reads revocation live: the next verify is denied. The hosted check does not reuse a cached yes. Allowed answers still include cache_max_s: 5, a client hint to reuse that allowed result for at most five seconds (denied answers use cache_max_s: 0).

Timing →
ComponentCurrent releaseNotes
npm @tokenlock/sdk0.5.30.5.3 is the current release on npm, published under the new name @tokenlock/sdk (a rename only: same API as 0.5.2; 0.5.0 was the security release). 0.4.4 (security correction, no new features; 0.4.3 deprecated): self-verify evaluate() validates the request before any mode branch (token-mode policy + resource = policy_required; identity explicit; held must be a list); every policy's validity window is enforced wherever it is used (policy_expired / policy_invalid); verifyLocalPass needs a 32+ character pass secret (bad_secret) and never answers valid: true before the pass is verified; starters on ^0.4.4 (advisory). 0.4.3 (deprecated; security correction, breaking: explicit identity-only, no new features): one strict schema for every authorization call (unknown fields or options, path without method, empty, whitespace-only, padded, null or non-string values: bad_resource; non-canonical paths: bad_path); identity-only needs { identityOnly: true }. 0.4.2 (deprecated; security hardening, breaking: removed options): failOpen, checkResource and strict: false are configuration errors; unknown or mistyped middleware options and malformed secret keys are refused at startup; malformed, oversized, non-JSON and contradictory answers deny; self-verify rejects malformed policies. 0.4.1: documentation only. 0.4.0 (breaking, advisory 2026-11-18): no path, method or environment is authorized unless a route policy permits it; a resource check with no applicable policy answers policy_required, and token-only sites using the middleware set tokenOnly: true. 0.3.3 fixed findings from an external review: self-verify now refuses a resource check with no policy (policy_required), signed-policy refresh backs off after a failure, revocation timing is split into key, permission and holdings changes, and verifyPass errors are fully documented. Strict mode is always on (0.4.2). Path rules v1.1. See the release history.
PHP drop-in0.4.40.4.4: security correction, same fixes as the SDK (tokenlock_sv_evaluate() needs array('identity_only' => true) or a resource; policy expiry enforced everywhere; pass_secret checked). 0.4.3: security correction, same schema as the SDK (bad_resource; identity-only needs 'identity_only' => true). 0.4.2: security hardening, same changes as the SDK (fail_open, check_resource and 'strict' => false removed: locked pages answer 500 bad_config; configuration and early-block validation; strict answer checks). Same policy_required rules as the SDK (hosted checks and self-verify.php); token-only sites set 'token_only' => true. Same path rules, early block, and self-verify.php. Download from the TOKENLOCK page.
Hosted verification APILiveChallenge, sign-in, verify, access admin, policy bundles, decision log, decision-log streaming (preview).
Self-verifySDK 0.3.0 and laterShipped. Your server verifies sign-ins, holdings and (optionally) a signed policy bundle without calling us on every request.

0.2.x and 0.1.x integrations keep working with registered keys and for identity-only checks. On token-only sites, resource checks from any version now answer policy_required (all versions fail closed against the hosted API since the 18 Nov 2026 9 PM PT deployment), so upgrade token-only middleware to 0.4.4 (0.4.0 or later) with tokenOnly. What fails closed, and the remaining limits: fail-closed guarantee. Differences vs older releases are noted only where behavior changed (strict default, cache, path rules, self-verify, explicit route authorization).

1. A minimal enterprise setup

Turn on registered keys in the dashboard (Business, Enterprise, or a pilot). Lock your API with SDK 0.4.4 or later (current 0.5.3) (strict mode is always on), send an explicit environment, and serve API denials as JSON:

import { tokenlock } from '@tokenlock/sdk/express';

app.use('/api', tokenlock({
  secretKey: process.env.TOKENLOCK_SECRET_KEY, // 32+ chars; never in the browser
  apiPaths: ['/api'],                          // JSON denials instead of a redirect
  environment: 'production',                   // checked against the key's environments
  // Strict mode is always on (since 0.4.2). failOpen, checkResource and strict: false were removed (bad_config).
}));

Requests that accept JSON (or match apiPaths) get a JSON denial instead of a redirect: 401 when there is no pass or it is invalid, 403 when signed in but not allowed, 400 for a rejected path, 503 when our API cannot answer. Body: { error, code, reason, correlation_id }.

One allowed verify, and one denied, from GET|POST /api/v1/gate/verify with the site secret and a resource:

// Allowed: GET /api/reports/q3 for a key granted GET /api/reports/* in production
{
  "valid": true,
  "allowed": true,
  "address": "bc1q…",
  "assets_held": ["TOKENLOCK"],
  "origin": "https://app.example",
  "correlation_id": "a1b2c3…",
  "access": {
    "mode": "registered_keys",
    "allowed": true,
    "reason": "ok",
    "key": { "id": "key_…", "label": "Reports agent", "owner_type": "agent" },
    "permissions": { "routes": ["/api/reports/*"], "methods": ["GET"], "environments": ["production"] },
    "resource": { "path": "/api/reports/q3", "method": "GET", "environment": "production" }
  },
  "resource": { "path": "/api/reports/q3", "method": "GET", "environment": "production" },
  "cache_max_s": 5
}

// Denied: the same key on a route it does not have (API mode returns HTTP 403)
{
  "valid": false,
  "allowed": false,
  "code": "route_not_allowed",
  "reason": "This key is not allowed on this route.",
  "correlation_id": "a1b2c3…",
  "access": { "mode": "registered_keys", "allowed": false, "reason": "route_not_allowed", "key": { "id": "key_…" } },
  "resource": { "path": "/api/admin/users", "method": "GET", "environment": "production" },
  "cache_max_s": 0
}

cache_max_s: 5 on an allowed registered-key answer is a hint for non-strict clients. In strict mode (the default in SDK and PHP drop-in 0.4.0 and later), the SDK and PHP drop-in never cache registered-key answers, so every protected request hits the API.

2. The authorization rule and options

When registered keys are on, every verify checks:

approved organization, when required by site policy, AND registered signing key AND valid entitlement AND permission for this resource AND not revoked

Registered keys are off by default. Sites that don't turn them on keep the token-only rule. Organizations are optional. A key without an organization is allowed unless you turn on require_org. If a key does belong to an organization, that organization must be approved or the request is denied with org_not_approved.

Useful settings (dashboard, or POST /access/settings):

Current limitation: one site secret does everything. The same sk_… verifies passes and manages access, organizations and keys, including export of the decision log. Treat it as a high-privilege credential: keep it on the server, rotate it if it leaks, and don't ship it in a browser, a mobile app or a vendor integration that only needs to check passes. Separate verify-only, admin, and read-only audit-export credentials are on the roadmap, not shipped.

3. Permissions, rotation and revocation

How long a change takes to apply

EventHosted verification, strict (default; registered keys never cached)Hosted verification, strict offSelf-verify (signed policy bundle)
Admin revokes or expires a key, suspends an organization, or revokes a token for the siteInstant on the next request: the SDK does not cache registered-key answers (also true with cache: false), and the API reads Redis live.Up to 5 seconds on each server process (the API's cache_max_s).On the next successful policy refresh (every 60 seconds by default). If refreshes fail, the cached bundle is used until it expires (10 minutes by default), then access fails closed.
Admin changes a key's routes, methods, environments or expiry dateInstant on the next request, same as revocation.Up to 5 seconds on each server process.On the next successful policy refresh (60 seconds by default); same outage rule as above.
The token is transferred away from a registered keyDetected on the next holdings re-check, at most recheck_holdings_s (300 seconds by default) after the last successful check. Then the key is paused (pending_approval) until an admin approves it again. cache: false turns off only the SDK's cache; it does not shorten this hosted re-check interval.Same, plus up to 5 seconds of local cache.The bundle lists key status, not live holdings. verifyLocalPass does not re-read holdings, so an existing pass works until it expires (pass_ttl_s, 900 s by default). Re-check holdings yourself (your node or a provider) or use short passes if a transfer must cut access sooner. Our hosted re-check window does not apply.
Token-only sites (registered keys off)Holdings are checked at sign-in. An existing pass stays valid until it expires (15 minutes by default, at most 24 hours). The next sign-in is refused.

Enrollment

When an administrator registers a key (POST /access/keys, or Add key in the dashboard), the key is created as active and can sign in immediately, subject to organization, entitlement and permission checks. It does not wait in an approval queue. Any open request for that address is cleared.

pending_approval applies to other enrollment and pause paths, not to keys the admin just added:

There is no separate setting that delays a key the administrator registers. Approving a queued request or a paused key also sets the key active immediately.

Key rotation and short-lived agent sessions

  1. Add the new key. POST /access/keys/:id/rotate { "new_address": "bc1q…", "grace_s": 3600 } (or Rotate in the dashboard). The new key gets the same owner, organization, permissions and expiry, and works immediately. Both keys link to each other (rotated_from, rotated_to).
  2. Grace period. The old key keeps working until the grace period ends (default 1 hour, 0 to 7 days; 0 ends it now). Its expiry is moved to the end of the grace period, never later than an expiry it already had.
  3. The old key expires. After the grace period, sign-ins and pass checks with the old key are denied with key_expired. A pass never outlives its key.
  4. Agents: short-lived sessions. Agent keys get short passes (15 minutes by default; set agent_pass_ttl_s or per-key pass_ttl_s, from 60 seconds). The wallet signature happens once, at sign-in; the pass is a bearer token, not a fresh signature per request.

Token transfers

4. Hosted verification vs self-verify

Hosted verifySelf-verify
Who checks the signature and holdingsOur API, on every sign-in; holdings again on verify at most every recheck_holdings_sYour server, with a holdings source you choose (ours, tokenscan, or any HTTP JSON source; two sources can be required to agree)
Registered keysChecked live against Redis on every verify (strict clients)Checked against a BIP-340-signed policy bundle you cache (Enterprise or pilot)
Revocation delay (keys and permissions)Instant in strict modeUp to the refresh interval (60 s default), or the bundle expiry (10 min default) if refreshes fail
Token transfer (holdings)Next hosted re-check, up to recheck_holdings_s (300 s default), even with cache: falseHoldings are read at sign-in only; an existing pass works until it expires (pass_ttl_s, 900 s default)
Decision logWritten on our side for the events in §5Not written to our log. Log locally if you need an audit trail.
You still trustOur API and our reading of the chainThe holdings source(s) you configured, and (if you use our bundle) the policy signer

Spec: /docs/self-verify. A complete enterprise example (pinned policy-signing key, signed policy source, path/method/environment, both valid and allowed, expired bundle and holdings outage) is in the SDK README and in examples/self-verify-enterprise.mjs (0.3.1).

5. Logging, retention and failure behavior

What is recorded

The hosted decision log is not a log of every request. Coverage, verified against the production API on 18 Nov 2026:

EventWhat is recorded
Successful hosted resource checkYes. Written as kind: "pass_check", outcome: "authorized", reason: "ok", with the resource (path, method, environment when sent), key, owner, wallet, correlation_id (the sign-in nonce when the pass has one), and timestamps. These rows count toward the plan's monthly decision cap.
Denied hosted resource checkYes. Same pass_check shape: outcome: "denied", the reason code (route_not_allowed, key_revoked, …), reason_text, resource, key, and correlation_id when present. Sign-in denials are a separate kind: "signin" row with the same correlation id. A refused challenge (for example origin_mismatch) and an abandoned challenge are also logged.
Locally cached SDK or PHP decisionNo hosted event. A cache hit never reaches our API. In strict mode, registered-key checks reach the hosted API on every protected request. The service attempts to log each decision, and a logging failure does not block access. If you need a log of cache hits, record them on your server.
Self-verify decisionNot written to the hosted log. There is no onDecision hook in the SDK or PHP drop-in today. If you need an audit trail, record the verifySignIn / verifyLocalPass result on your server (your responsibility today; a hook is planned, not shipped).
Logging failureAccess still proceeds. A Redis error writing the decision is caught and does not fail the verify or sign-in. The decision webhook (Business and Enterprise, opt-in) is one POST, 3 second timeout, no retries. Log streams (Enterprise) send in the background after the decision, with a 2.5 second timeout and bounded retries. Both are best-effort. A failed delivery leaves the row in the Redis export until retention or the cap drops it.

Retention, caps and delivery

PlanRetentionMonthly row capPer-day list cap
Free14 days50050
Business180 days25,0002,500
Enterprise365 days100,00010,000

Redis keys expire one day after the retention window. If a site goes over the per-day list cap, the oldest rows for that day are dropped from the list and from exports; the daily counts stay accurate. The dashboard and the decisions API show this month's use and today's use against the caps, and warn at 80% and at the cap so you can export before truncation.

Export (GET /access/decisions/export?format=csv|jsonl) is a read of whatever is still in Redis for the retention window. It is not a separate durable archive.

Decision webhook (Business and Enterprise, opt-in with decision_webhook): we POST each logged decision once to your HTTPS URL, signed with HMAC-SHA256 in x-tokenlock-signature, with a 3 second timeout. There are no retries. Delivery is best-effort, not at-least-once. If the POST fails, the event is still in the Redis log until retention or the cap drops it. For retries and SIEM delivery, use a log stream (Enterprise).

Log streaming to your SIEM (Enterprise, preview)

Stream every decision record (sign-ins, resource checks, denials, abandoned challenges) and every admin action (approvals, permission changes, revocations, settings) to your security tools. Each site can have up to 5 streams. Configure them with the site secret key (Authorization: Bearer sk_…) or from a signed-in dashboard session, at /api/v1/tokenlock/access/sinks.

TypeCreate withWhat we send
https (generic JSON){ "type": "https", "url": "https://siem.example.com/tokenlock" }. The response includes signing_secret once.One POST per event, the record as JSON. Header x-tokenlock-signature: t=<unix seconds>,v1=<hex>, where v1 = HMAC-SHA256(signing_secret, "<t>.<raw body>"). Reject a t older than 5 minutes. x-tokenlock-event-id is stable across retries, so use it to drop duplicates.
splunk (HTTP Event Collector){ "type": "splunk", "url": "https://splunk.example.com:8088/services/collector/event", "token": "<HEC token>", "index": "security" } (index, source, sourcetype optional)HEC envelope with time, host, source (default tokenlock), sourcetype (tokenlock:decision, or tokenlock:admin for admin actions) and the record as event. Header Authorization: Splunk <token>.
datadog (Logs intake v2){ "type": "datadog", "site": "datadoghq.com", "api_key": "<API key>", "service": "tokenlock", "tags": ["env:prod"] }One log per event to https://http-intake.logs.<site>/api/v2/logs, ddsource:tokenlock, tags for site_id, outcome and reason, status warn for denials. The record is under the tokenlock attribute.

Delivery is best-effort, with bounded retries. A logging failure never blocks access. We send after the decision is written, in the background, with a 2.5 second timeout per attempt. A timeout, network error, 408, 429 or 5xx is retried from a queue after about 1 minute, 5 minutes, 30 minutes and 2 hours (5 attempts in all). Other 4xx answers (bad token, bad index) are not retried and count as dropped. The retry queue holds up to 5,000 events across all sites. When it is full, the oldest event is dropped and counted. Retries run when the site logs new decisions and at least once a day, so a quiet site's retries can wait until the daily run. If our access store (Redis) is down, decisions are not logged and nothing is queued. Delivery is at-least-once only while retries last, and events can arrive out of order (sort on decided_at). Keep the decision export as your system of record.

Decision records: retention, modification and purge

Where records live today:

Deleting a site is a soft delete: the site document is marked deleted with a deleted_at time and is removed from your account list, but the document stays in storage. The site's publishable key, secret key and outstanding passes stop working immediately (the in-memory site and plan caches are cleared as part of the delete). Soft deletion does not purge Redis access state, the encrypted Blob backup or journal, or decision-log keys. Decision-log keys expire with their retention TTL. Access state, the backup and the journal have no automatic expiry.

Who can change or purge these records:

Retention alone is not tamper evidence. Anyone with the credentials above can change or delete stored records. Entries are not hash-chained, and there is no signed or anchored digest.

To request permanent deletion of owner details, backups, journals and residual site records after a soft delete, email hello@tokenlock.ai (also listed on the contact page). Include the site id or the dashboard account address. We will not ask for a recovery phrase or private key.

Backup failure, restore and recovery expectations

Outage grace period (holdings lookups)

This grace applies only when registered keys are on, the holdings cache for that wallet has expired, and the holdings source throws. It does not apply to admin revocation, which is checked in Redis and keeps working while the access store is up. The grace is based on when the pass was issued (issued_at), not on the time of the last successful holdings check.

Default: if the pass is younger than 2 × recheck_holdings_s (600 seconds when re-check is 300), the request is still allowed. If the pass is older, verify is denied with lookup_failed. Turn on require_fresh_holdings to skip the grace and deny as soon as the cache has expired and a lookup fails.

Worked example (defaults: re-check 300 s, grace 600 s, require_fresh_holdings off):

With require_fresh_holdings on, the 12:05 lookup failure would already be lookup_failed. You can also lower recheck_holdings_s (minimum 60, or 0 to check holdings only at sign-in).

Availability and failure behavior

Local reuse of a previous good answer depends on the mode. Strict registered-key clients do not cache; they do not keep serving through an API outage.

What is downToken-only sitesRegistered keys, strict (default)Registered keys, strict off
TOKENLOCK API (your server can't reach us) A good answer already in the local cache may be reused for up to 60 seconds. Otherwise 503 (or fail-open only if you set that, which is not allowed in strict mode). Locked pages fail closed by default in 0.2.0 and later (SDK 0.3.3, PHP 0.3.0); the visitor's cookie is kept. No local cache. Protected requests get 503 until we answer. The cookie is kept. Registered-key answers are never cached by 0.2.1+ in strict mode (always on since 0.4.2), so protected requests answer 503 at once. There is no fail-open option since 0.4.2.
Blockchain data source (we can't read holdings) New sign-ins fail closed (lookup_failed). Passes already issued stay valid until they expire. New sign-ins fail closed (lookup_failed). On verify, see outage grace. Revocation, expiry, organization and permission checks don't need the chain and keep working.
Access store (our Redis) Not used for sign-in or verify, so access is unaffected. Decision-log entries during the outage are not recorded. Fail closed: sign-in and verify answer 503 (kv_unavailable). We never fall back to token-only. If stored access settings are lost, they are restored from the backup and journal before any access is allowed; if that restore cannot be read, we stay failed closed.

6. Test coverage and roadmap

Validation matrix (18 November 2026)

LayerStatusWhat it covered
Local adapter testsDoneUnit and integration tests for the SDK (0.3.0 code; 0.3.1 and 0.3.2 added docs and examples; 0.3.3 added review fixes and 9 regression tests; 0.4.0 added a shared 11-case authorization matrix run by Node, PHP and the hosted API; 0.4.1 is documentation only and added a local fail-closed suite for missing policies, token-only settings and outages; 0.4.2 added regression tests written before the fixes for the removed options, invalid configuration, stale and malformed policies, malformed and contradictory answers and a simultaneous backend failure; 0.4.3 added regression tests written before the fixes for malformed authorization requests, encoded and traversal paths, inconsistent route/method combinations and path patterns without a leading /), PHP drop-in 0.4.3, and hosted API (including Express, Next.js, a PHP router and a Cloudflare worker). These run against a local copy of the API. They do not establish the security of the hosted service or isolation between tenants.
Real-backend self-verifyDone, 18 Nov 2026End-to-end on the 0.3.0 backend (35/35): approve an agent, allow a permitted route, deny another, revoke, confirm the audit trail. Real-site allow and route denials were checked through self-verify against the signed policy bundle, because the test wallets did not hold TOKENLOCK. An internal evidence report of that run is on file; it is not a public document.
Hosted verification with a real TOKENLOCK holderDone, 18 Nov 2026Live production validation passed 25/25 checks using a project-funded token-holding wallet. Audit exports captured allowed access, route and method denials, administrative revocation, and denial of the first request after revocation. The 25/25 figure is that defined hosted test suite only (3:26–3:28 PM PT; npm SDK 0.3.1 was the latest feature release then). A dated export, the test script and the deployed version are kept together for diligence.
Production regression on the published packagesDone, 18–19 Nov 2026Run against production with the packages installed from npm and the production PHP zip, a throwaway test site (deleted afterwards) and the project-funded test wallet: 0.4.1 68/68 (9:29 PM PT); 0.4.2 124/125 (10:23 PM PT; the failure was the malformed-request fail-open corrected in 0.4.3); 0.4.3 239/239 (11:11 PM PT; a first 0.4.3 run at 11:01 PM PT scored 233/235 and found a GET routing issue that failed closed, fixed before the final run); 0.4.4 251/251 (19 Nov, 7:03 AM PT; adds the external reviewer’s cases on the installed npm package and the production PHP zip, and the hosted no-secret-key token check; the 0.4.3 run had not exercised the lower-level exported functions where those issues were). The raw API, npm and PHP gave the same answer for every shared case. Our own results, not an independent review.
Independent security reviewNot doneThese are our reported results. An independent review of the hosted service, the 0.4.x SDK or the PHP drop-in has not been completed.

Roadmap (planned, not shipped)

Roadmap, not available today: hash-chained decision-log entries with a periodic signed or anchored digest; separate verify-only, admin, and read-only audit-export credentials; per-request signing for agent APIs; an independent security review of the hosted service.

Release history

ReleaseDate (PT)What changed
npm SDK 0.5.3 (new package name)24 Nov 2026The SDK is now published as @tokenlock/sdk: npm install @tokenlock/sdk, imports from @tokenlock/sdk/next, /express, /react and /self-verify. No API change from 0.5.2. The previous package name is deprecated; installed copies keep working. 0.5.0 (security release), 0.5.1 (default origin https://tokenlock.ai) and 0.5.2 (MCP docs) are in the SDK changelog.
npm SDK 0.4.4, PHP drop-in 0.4.4, Cloudflare example, hosted API (security correction)19 Nov 2026Corrects two issues from an external review (self-verify evaluate() allowed a resource from its token-mode branch without validating it; an explicitly expired local policy still authorized) and five found by a widened audit that enumerates and fuzzes every exported function (empty self-verify pass secret accepted; valid: true on an early bad_path; held: null skipped holdings; hosted lower-level functions checked partial resources; the hosted accepted-token check ran only with a secret key). Starters fixed. 0.4.3 deprecated. Advisory.
npm SDK 0.4.3, PHP drop-in 0.4.3, Cloudflare example, hosted API (security correction)18 Nov 2026Corrects a fail-open found by the 0.4.2 production regression run: an unknown, mistyped, empty, null or non-string authorization field was dropped and the call became an identity-only check. One strict request schema in the SDK, Next/Express middleware, Cloudflare worker, PHP drop-in, self-verify and /api/v1/gate/verify: malformed requests answer bad_resource / bad_path, never identity-only. Breaking: identity-only checks are explicit ({ identityOnly: true }, 'identity_only' => true, identity_only: true). npm 0.4.2 deprecated. No new features. Advisory update.
npm SDK 0.4.2 (deprecated), PHP drop-in 0.4.2, hosted API (security hardening)18 Nov 2026Dedicated security-hardening release, no new features. Breaking: failOpen / 'fail_open', checkResource / 'check_resource' and strict: false were removed and are configuration errors (Cloudflare worker: the matching variables answer 500). Invalid configuration (unknown or mistyped options, malformed secret keys, an unusable PHP early block) is refused; answers over 64 KiB, non-JSON, malformed or contradictory answers deny; self-verify rejects malformed policies and non-boolean holdings answers; the Cloudflare worker has a fail-closed fetch timeout. Hosted API: a storage error reading a site's settings is a 503 (it could previously combine with a missing Redis access state into a token-only answer for a registered-keys site); malformed access data denies; the legacy compatibility switch was removed. Regression tests were committed before the fixes and fail on 0.4.1. See the advisory update.
npm SDK 0.4.1, PHP drop-in 0.4.1 (documentation only)18 Nov 2026Stable security baseline at the time (superseded by 0.4.2 and 0.4.3). Same code as 0.4.0; only documents and the version string changed. The README (npm and GitHub) now says the hosted API denies resource checks from 0.2.x/0.3.x clients too, and lists the fail-closed guarantee: no policy, legacy clients, tokenOnly on registered-keys sites, API outages and self-verify policy and holdings failures all deny by default. It also lists the explicit opt-outs (failOpen, checkResource: false, the holdings re-check grace window).
npm SDK 0.4.0, PHP drop-in 0.4.0, hosted API (security, breaking)18 Nov 2026Security advisory 2026-11-18. No path, method or environment is authorized unless a route policy permits it: a resource check on a token-only site, or a self-verify resource with no policy or a token-mode policy, answers policy_required (identity_valid reports the pass). New middleware option tokenOnly / PHP token_only. Shared authorization matrix across Node, PHP and the hosted API. Since the 9 PM PT deployment the hosted API denies these checks for every client version, 0.2.x/0.3.x included (the brief transition answer for older clients is off).
npm SDK 0.3.3 (review fixes)18 Nov 2026Self-verify: a resource check without a policy now returns policy_required instead of allowed: true. signedPolicy: retry backoff (5 s doubling, max refreshSeconds) and one shared in-flight load, so an outage no longer adds a fetch to every call. Docs: revocation timing split into key revocation, permission changes and holdings changes; every TokenlockError from verifyPass listed, with a custom-server example.
npm SDK 0.3.2 (docs)18 Nov 2026, 2:41 PMDocs-only patch: corrected strict-mode logging wording. No code change from 0.3.1.
npm SDK 0.3.1 (docs and examples)18 Nov 2026, 2:26 PMLast feature release. Next.js quickstart uses the broad matcher, an enterprise self-verify example (pinned policy key, signed policy, fail-closed bundle expiry), hosted decision-log coverage docs, revocation timing table.
npm SDK 0.3.0 and PHP drop-in 0.3.018 Nov 2026, 12:42 PMSelf-verify (spec v1): local signature checks, nonce stores, holdings providers, signed policy bundles. PHP early block.
Hosted service (preview, this page)18 Nov 2026Decision-log streaming to HTTPS, Splunk HEC and Datadog; Cloudflare Turnstile on public sign-up and demo forms when enabled.
0.2.2 / 0.2.118 Nov 2026Security: path rules v1.1 (ambiguous paths rejected), cache key fix, open-redirect fix, strict mode on by default.

Full SDK changelog: npm.

Admin API

Manage access from the dashboard (Enterprise access & decision log on each site) or from your server with the site's secret key: Authorization: Bearer sk_… on https://tokenlock.ai/api/v1/tokenlock/access…. See the limitation above: this same secret also verifies passes.

See it end to end in the enterprise demo.