Narrowed to one route
Registered keysYou grant a key specific routes, methods, and environments. Everything else is denied. Missing policy means no access.
Authorization rule →All docsEnterprise demoValidationSIEM streamingChangelogTOKENLOCK
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.
Registered keys get one route. When the key is revoked, the next hosted check is denied.
You grant a key specific routes, methods, and environments. Everything else is denied. Missing policy means no access.
Authorization rule →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).
| Component | Current release | Notes |
|---|---|---|
npm @tokenlock/sdk | 0.5.3 | 0.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-in | 0.4.4 | 0.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 API | Live | Challenge, sign-in, verify, access admin, policy bundles, decision log, decision-log streaming (preview). |
| Self-verify | SDK 0.3.0 and later | Shipped. 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).
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.
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.
org, employee, vendor or agent), optional owner name and email, and an optional organization. Owner details stay offchain, in TOKENLOCK only./app/* for a prefix, /reports exact, * for all), methods, environments and an expiry. A key with no routes can sign in but reach nothing.path, method and (optional) environment with verify. Matching is case-insensitive on the canonical path: /Admin and /admin are the same authorization identity, even if your app treats them as different pages.Useful settings (dashboard, or POST /access/settings):
registered_keys — turn the rule on or off.require_org — every key must belong to an approved organization (default off).recheck_holdings_s — how often verify re-checks token holdings (default 300, or 0 to check only at sign-in; otherwise 60–86400).require_fresh_holdings — when the holdings cache has expired and the holdings source is down, deny with lookup_failed instead of using the outage grace period (default off). See outage grace.agent_pass_ttl_s / default_pass_ttl_s — pass lifetimes (seconds).decision_webhook, alert_on_abandoned, hash_addresses — webhook and privacy options (Business and Enterprise).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.
| Event | Hosted verification, strict (default; registered keys never cached) | Hosted verification, strict off | Self-verify (signed policy bundle) |
|---|---|---|---|
| Admin revokes or expires a key, suspends an organization, or revokes a token for the site | Instant 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 date | Instant 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 key | Detected 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. | ||
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:
unregistered_holder). Access starts only after an admin approves that request (POST /access/requests/:id/approve) or registers the key directly.pending_approval) when the transfer is detected (see the timing table). It stays paused until an admin approves it again (POST /access/keys/:id/approve).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.
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).key_expired. A pass never outlives its key.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.pending_approval, access is denied, and an approval request is queued. The wallet that received the token is not registered, so it also gets pending_approval. Nothing is granted until an admin approves.| Hosted verify | Self-verify | |
|---|---|---|
| Who checks the signature and holdings | Our API, on every sign-in; holdings again on verify at most every recheck_holdings_s | Your server, with a holdings source you choose (ours, tokenscan, or any HTTP JSON source; two sources can be required to agree) |
| Registered keys | Checked 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 mode | Up 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: false | Holdings are read at sign-in only; an existing pass works until it expires (pass_ttl_s, 900 s default) |
| Decision log | Written on our side for the events in §5 | Not written to our log. Log locally if you need an audit trail. |
| You still trust | Our API and our reading of the chain | The 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).
The hosted decision log is not a log of every request. Coverage, verified against the production API on 18 Nov 2026:
| Event | What is recorded |
|---|---|
| Successful hosted resource check | Yes. 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 check | Yes. 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 decision | No 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 decision | Not 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 failure | Access 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. |
| Plan | Retention | Monthly row cap | Per-day list cap |
|---|---|---|---|
| Free | 14 days | 500 | 50 |
| Business | 180 days | 25,000 | 2,500 |
| Enterprise | 365 days | 100,000 | 10,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).
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.
| Type | Create with | What 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. |
events (decision, admin_action; both by default) and outcomes (authorized, denied, abandoned; all by default). enabled: false pauses a stream.GET /access/sinks lists streams with delivery health (sent, failed, dropped, last_ok_at, last_error). POST /access/sinks/:id edits (send a new token or api_key to replace it). POST /access/sinks/:id/test sends one tokenlock.test event now and returns the HTTP status. POST /access/sinks/:id/rotate-secret (https only) and POST /access/sinks/:id/delete. Every change is in the admin history.secret_set: true only.hash_addresses on, streams get address_hash and no wallet address, the same as the webhook. Records never contain passes, signatures, secret keys or raw IP addresses (ip_hash only).https:// on a public hostname. Private, loopback and link-local addresses, IP literals in those ranges and internal names are refused. Redirects are not followed.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.
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_ok and journal_ok. The journal is written first and is replayed after a restore, so a revoke is not undone by a stale snapshot as long as that journal write succeeded.access_unavailable) until it can.backup_ok: false as a signal to retry or contact support.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):
pending_approval). If the holdings source is down, the pass is only 5 minutes old, which is less than 10 minutes, so access stays allowed.lookup_failed, until a lookup succeeds or the pass expires.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).
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 down | Token-only sites | Registered 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. | |
| Layer | Status | What it covered |
|---|---|---|
| Local adapter tests | Done | Unit 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-verify | Done, 18 Nov 2026 | End-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 holder | Done, 18 Nov 2026 | Live 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 packages | Done, 18–19 Nov 2026 | Run 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 review | Not done | These 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, 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 | Date (PT) | What changed |
|---|---|---|
| npm SDK 0.5.3 (new package name) | 24 Nov 2026 | The 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 2026 | Corrects 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 2026 | Corrects 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 2026 | Dedicated 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 2026 | Stable 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 2026 | Security 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 2026 | Self-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 PM | Docs-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 PM | Last 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.0 | 18 Nov 2026, 12:42 PM | Self-verify (spec v1): local signature checks, nonce stores, holdings providers, signed policy bundles. PHP early block. |
| Hosted service (preview, this page) | 18 Nov 2026 | Decision-log streaming to HTTPS, Splunk HEC and Datadog; Cloudflare Turnstile on public sign-up and demo forms when enabled. |
| 0.2.2 / 0.2.1 | 18 Nov 2026 | Security: path rules v1.1 (ambiguous paths rejected), cache key fix, open-redirect fix, strict mode on by default. |
Full SDK changelog: npm.
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.
GET /access: settings, organizations, keys, open requests, revoked tokens, recent admin actions.POST /access/settings: registered_keys, require_org, require_fresh_holdings, agent_pass_ttl_s, default_pass_ttl_s, recheck_holdings_s, decision_webhook, alert_on_abandoned, hash_addresses.POST /access/orgs { name } or { id, status: "approved"|"suspended" }.POST /access/keys { address, label, owner_type, owner_name, owner_email, org_id, routes, methods, environments, expires_at, pass_ttl_s } creates an active key immediately (and clears any open request for that address). POST /access/keys/:id to edit; /revoke; /approve (a paused key becomes active immediately); /rotate { new_address, grace_s }.POST /access/requests/:id/approve (queued unregistered holder or re-approval; the key becomes active immediately) or /deny; POST /access/entitlements/revoke or /restore { asset }.GET /access/decisions and GET /access/decisions/export?format=csv|jsonl. The JSON includes retention_days, monthly_cap, daily_cap, monthly_used, today_count and warnings.GET /access/policy?ttl= (Enterprise or pilot): a signed policy bundle for self-verify.GET /access/sinks, POST /access/sinks, POST /access/sinks/:id, /test, /rotate-secret, /delete (Enterprise or pilot): decision-log streaming. See Log streaming to your SIEM.See it end to end in the enterprise demo.