SDK changelog: TenancyEngine.Sdk 2.0.2 to 2.18.0, @tenancyengine/sdk 0.5.0 to 0.9.0
The first part applies to the TenancyEngine.Sdk NuGet package (it targets net8.0, net9.0 and, since 2.11.0, net10.0). As of 2026-11-02, versions 2.0.2 to 2.3.0 are on nuget.org; a check of its index on 2026-10-19 listed exactly 2.0.2, 2.1.0, 2.2.0 and 2.3.0, so 2.4.0 to 2.18.0 are in the repository but not on nuget.org yet. Public release is a human-confirmed dispatch of the publish workflow (tenancyengine#1195); a nightly check fails when nuget.org trails the source version by more than 14 days. Until then, stay on 2.3.0 from nuget.org, or take a newer version from the private feed (nuget.cyntrix.ca; it needs a feed credential and answers 401 without one). The history of the JavaScript package @tenancyengine/sdk is at the end of this page.
All changes in this range are additive. No public type, method or constructor was removed or had its signature changed, and code compiled against 2.0.2 keeps working. New data on existing records is added as init properties rather than constructor parameters for that reason.
| Version | Date | What changed | Issues |
|---|---|---|---|
| 2.18.0 (unreleased) | not yet published | Private structured inference: IPlatformStructuredInferenceClient / TenancyEngineClient.StructuredInferAsync(PlatformStructuredInferenceInput) calls POST .../ai/structured with an application-level key holding the exact ai.structured scope (never inside admin, ai.extract or ai.chat). For work on a person's data where the app owns prompts, schema and rules and holds no provider key: SubjectConsentAttested is required and audited, the schema (inline or a catalog key) is validated against a strict subset (no $ref, combinators or pattern; size, depth and node caps), instructions rank platform rules, then the app's fenced AppInstructions, then the data, which is never treated as instructions, and the model's answer is validated against the schema before it is returned (TenancyEngineStructuredOutputInvalidException, HTTP 502 ai_output_invalid, nothing returned, the call is billed). Nothing is stored beyond one audit row of metadata; spend goes through the extraction allowance and the AI credit ledger (402 ai_allowance_exceeded, ai_structured_not_included, ai_credit_exhausted). A 502 ai_output_invalid is billed and a retry bills again. Requires a client bound to the application GUID. Additive; ExtractAsync is unchanged. | #1623, #1576 |
| 2.17.0 (unreleased) | not yet published | Scheduled jobs: AddTenancyEngineScheduledJobs(o => ...) (namespace TenancyEngine.Sdk.Scheduling) registers the platform scheduler for an app, with AddJob<T>() / AddJob(name, schedule, delegate) and the SDK's own ITenancyEngineScheduledJob, so an app references only TenancyEngine.Sdk (the scheduler, TenancyEngine.Scheduling 1.1.1, and TenancyEngine.ReliableDelivery are transitive). One execution per tick across replicas through a mandatory lock provider (UsePostgresAdvisoryLock, UseRedisLock, UseLock, or UseSingleReplicaInProcessLock for single-replica use; registration throws without one), run history (Postgres or memory), per-job timeout with a hard stop after a grace period, jitter, exponential backoff, exception isolation, cancellation on shutdown, and MapTenancyEngineScheduledJobsDiagnostics(policy) whose authorization policy is a required argument. Private-feed build only: the nuget.org package cannot depend on private packages, so the public pack drops the Scheduling folder and its two references and its API is unchanged. Restore impact for every private-feed user, not only apps that use jobs: the Microsoft.Extensions.* floor of the private-feed net8.0/net9.0 assets rises from 9.0.0 to 9.0.19 (the scheduler's own floor). An app that pins Microsoft.Extensions.Logging.Abstractions, Configuration.Abstractions, Configuration or Caching.Memory between 9.0.0 and 9.0.18 gets NU1605 on restore and must raise the pin. Depends on TenancyEngine.Scheduling 1.2.0 (adds an ensureSchema overload to the Postgres history store; default behaviour unchanged). AppName is required with every lock but the in-process one and prefixes the lock keys. Skipped ticks are counted, not stored; stored error text is redacted and capped, stack traces are not stored. Additive. Guide and compiled sample: Scheduled jobs. | #1576, #1840 |
| 2.16.0 (unreleased) | not yet published | Web app access-token check: TenancyEngineWebAppAuthority (namespace TenancyEngine.Sdk.Oidc, registered with AddTenancyEngineWebAppAuthority) for an ASP.NET Core app with an OIDC cookie session. AuthorizeAsync(HttpContext, ...) reads the SAVED ACCESS token (SaveTokens = true), verifies it locally (typ at+jwt, RS256, signature by the issuer's own JWKS on the issuer's origin, issuer, lifetime, exactly one audience equal to your resource; a sender-constrained token is refused), builds TenancyEngineVerifiedClaims from that verified token only (never the ID token or the cookie principal), then calls the current-authority check. Typed results (TenancyEngineWebAppAuthorityError), fail closed. One issuer value drives the iss check, discovery, JWKS and the introspection endpoint; no separate introspection base, no redirects. Written answer on resource audiences and the sample: Web app access-token check. Additive. | #1830, #1576 |
| 2.15.0 (unreleased) | not yet published | Private AI chat: IPlatformAiChatClient / TenancyEngineClient.ChatAsync(PlatformAiChatInput) calls POST .../ai/chat with an application-level key holding the exact ai.chat scope instead of the public widget chat key. The platform rules come first, your AppInstructions next, the conversation last; no tools, no knowledge base, nothing stored; SubjectConsentAttested must be true and ActorRef is an opaque id. Requires a client bound to the application GUID (a slug-bound client throws InvalidOperationException). The route shares the ai/extract burst limit per key, so chat and extraction calls count against one bucket (TenancyEngineRateLimitedException). A tenant over its own message allowance returns HTTP 402 ai_tenant_allowance_exceeded, not 503. Additive. | #1622, #1576 |
| 2.14.0 (unreleased) | not yet published | Current-authority checker hardening: concurrent identical cold checks share one introspection call (singleflight), a late older answer can no longer overwrite a later revocation (eviction sequence numbers), an eviction also drops any in-flight call so no later caller joins a pre-revocation answer, metrics (meter TenancyEngine.Sdk.CurrentAuthority) and fixed-word logging. Behaviour change: with AnyScope = true, a token the platform introspects with an empty scope is now InsufficientScope (it was accepted before); an app that relied on scope-less tokens passing must grant a scope. | #1737 |
| 2.13.0 (unreleased) | not yet published | Web search (first-party pilot): QueryAsync, TryQueryAsync, GetSearchStatusAsync and GetSearchUsageAsync with typed results, the licence object (LlmUse unknown until the provider answers, attribution suggested not required) and TenancyEngineSearchUnavailableException for a 503 carrying search_disabled or search_unavailable (TryQueryAsync returns null for any 503). Additive in the SDK. Wire note: the licence field of GET .../search/status changed from a string to an object (llmUse, attribution, required); no SDK, console or other-repo consumer of the old string was found, and the search pilot has no external callers yet. | #1114 |
| 2.12.0 (unreleased) | not yet published | .NET current-authority helper: asks POST /api/v1/runtime/oauth/introspect whether a verified token is still honoured (revocation, membership, workspace). Fails closed with typed results; the HTTP client must not follow redirects; a required scope is mandatory unless AnyScope is set on purpose; short positive-only cache. Needs an application-level key with the oauth.introspect scope. Additive. | #1661, #1576 |
| 2.11.0 (unreleased) | not yet published | .NET 10 support: the package now ships a net10.0 asset next to net8.0 and net9.0. A .NET 10 app picks the net10.0 asset automatically (before, NuGet fell back to the net9.0 asset). The net10.0 asset uses Microsoft.AspNetCore.Authentication.JwtBearer 10.0.13 and the Microsoft.Extensions.* assemblies of the ASP.NET Core 10 shared framework. No public type, member or signature changed (compared against 2.10.0). | .NET 10 migration |
| 2.10.0 | 2026-10-19 | Lane contract review round (TE-LANES-01 1a-ii): base-URI handling and the hint fallback aligned with the other server SDKs, typed refusals, nullable-flow fix in the credential duplicate check. No new public API beyond 2.9.0. | TE-LANES-01 |
| 2.9.0 | 2026-10-18 | Lane contract review fixes (TE-LANES-01 1a-i): padded raw API keys, client key exposure, hardening of lane-bound credentials. | TE-LANES-01 |
| 2.8.0 | 2026-10-18 | MCP resource trust is never permissive by omission (an issuer is always checked against the lane table); the original AddTenancyEngineMcpResource overloads are restored; the discovery document's jwks_uri is pinned to the issuer's origin; bare lab and stage hosts are classified. The MCP resource helper takes its issuer from TenancyEngineEnvironmentSwitch when you give none. | #868, TE-LANES-01 |
| 2.7.0 | 2026-10-18 | Entitlement cache: EntitlementCache (namespace TenancyEngine.Sdk.Entitlements) answers feature checks from memory or a shared store, serves stale answers while it refreshes, and applies a per-feature outage policy (FailClosed, FailOpen, UseLastKnown). Standard Webhooks: WebhookSignatureVerifier.VerifyStandard verifies the webhook-id, webhook-timestamp and webhook-signature headers; ToStandardWebhooksSecret builds the whsec_ form. Runtime context carries featureDecisions with a stable reason, source and allowance per feature. Additive. | #995, #996, #1000 |
| 2.6.0 | 2026-10-17 | App chat accepts an optional per-request reference context (TenancyEngineAppChatClient). Additive. | #839 |
| 2.5.0 | 2026-10-17 | Overnight feature wave. MCP resource servers: TenancyEngineMcpResource in TenancyEngine.Sdk.Oidc builds RFC 9728 protected resource metadata, the 401 WWW-Authenticate pointer and an exact audience check, and AddTenancyEngineMcpResource adds a JWT bearer scheme bound to your resource. Plan and usage widget: CreateUsageWidgetTokenAsync(app, tenant, environment, upgradeUrl) mints a read-only, tenant-scoped, 15 minute token for the @tenancyengine/react PlanUsageWidget or the hosted frame. Also new client partials for API keys and the inbox. Additive. | #868, #884, #911 |
| 2.4.0 | 2026-10-17 | TenancyEngineAppChatClient with ChatAsync and ChatStreamAsync for the app assistant. Additive. | #838 |
| 2.3.0 | 2026-10-16 | Webhook secret rotation overlap: WebhookSignatureVerifier.Verify accepts the v1_previous signature as well as v1. New overload RotateWebhookSecretAsync(applicationId, webhookId, graceHours, ct). ApplicationWebhookEndpoint and RotateWebhookSecretResult gain PreviousSecretPrefix and PreviousSecretExpiresAtUtc. | #770 (shipped in the same release train as the scope catalog #771 and plan-upgrade environments #769, which are platform-side) |
| 2.2.0 | 2026-10-16 | Effective entitlements: RuntimeContext.Entitlement (RuntimeEntitlementSnapshot) with IsUsableAt, UsableFor, HasEntitlement. CreateTenantRequest.OfferingSlug starts a new tenant on a free offering with an API key. | #662 (entitlement contract), #768 (free offering by API key) |
| 2.1.0 | 2026-10-16 | Customer machine access: new namespace TenancyEngine.Sdk.MachineAccess. AddTenancyEngineMachineAccess and RequireTenancyEngineMachineScope to verify customer tokens in your API; GetTenancyEngineMachinePrincipalAsync; TenancyEngineMachineTokenClient and AddTenancyEngineMachineToken for the customer's worker. Adds a dependency on Microsoft.AspNetCore.Authentication.JwtBearer. | #661 (machine caller), #766 |
| 2.0.2 | 2026-10-09 | Baseline for this changelog. Amended Cyntrix SDK License texts (EN and FR) in the package. No API change. | #670 |
Machine caller: 2.1.0 (#661)
For when your customers call your API from their own servers. Guide: Customer machine access.
- Your API:
AddTenancyEngineMachineAccess(section, platform)validates signature, issuer, the exact audienceurn:tenancyengine:application:{applicationId}:environment:{environmentId}, token type, lifetime and claim shape, with no per-request call to TenancyEngine.GetTenancyEngineMachinePrincipalAsync()returns the caller (TenantId,ApplicationId,EnvironmentId,ClientId,Scopes);RequireTenancyEngineMachineScope("yourapp.x.read")builds a policy. - The customer's worker:
TenancyEngineMachineTokenClientcaches one token per credential, refreshes it 60 seconds before expiry, shares one request between concurrent callers, and accepts a rotated secret throughUpdateCredentials. Failures areTenancyEngineMachineTokenExceptionwithRejectedCredentials,IssuerUnavailableorInvalidResponse; secrets and tokens are redacted fromToString()and exception text. - Tokens live at most 300 seconds, which is also the revocation latency.
Effective entitlements: 2.2.0 (#662, #768)
For when your backend needs to know what a customer tenant has paid for. Guide: Tenant entitlements.
GetRuntimeContextAsync(app, environment, tenantId)returnsEntitlement(schema version 1).nullmeans you passed notenantIdor the tenant is not in this application.IsUsableAt(now)fails closed on an unknown schema version, a missing receive time or an expired snapshot. A snapshot is never usable for more thanmaxStaleSeconds(at most 300) after you received it.new CreateTenantRequest("Acme", "acme", Environment: "Production") { OfferingSlug = "free" }creates the tenant on a free offering. A paid offering is rejected with 400 and no tenant is created.
Webhook secret overlap: 2.3.0 (#770)
After a rotation the platform signs deliveries with both secrets for the overlap (default 24 hours, 0 to 720; graceHours: 0 cuts over at once, use it when the old secret leaked). The X-TE-Signature header then carries v1 and v1_previous. WebhookSignatureVerifier.Verify accepts either, so a receiver keeps working whether or not it has deployed the new secret. A custom verifier that reads a single v1 keeps working with the current secret only.
Migration from 2.0.2
- Change the version:
dotnet add package TenancyEngine.Sdk --version 2.3.0 --source https://api.nuget.org/v3/index.json. - Rebuild. No source changes are required.
- If you verify webhooks yourself instead of calling
WebhookSignatureVerifier, also accept thev1_previousvalue inX-TE-Signatureand accept a match on either. A verifier that only readsv1checks the new secret, so a receiver that has not yet deployed the new secret rejects deliveries during the overlap. - If you call
RotateWebhookSecretAsync(applicationId, webhookId)with no grace argument, the platform default of 24 hours now applies. PassgraceHours: 0to keep an immediate cut-over. - Optional: read
RuntimeContext.Entitlementinstead of caching plan data yourself, and use machine access instead of issuing your own API keys to customers. - Upgrading from 2.0.2 adds
Microsoft.AspNetCore.Authentication.JwtBearerto your dependency graph.
What the platform covers for secrets, jobs and cache
| Need | Exists | Does not exist |
|---|---|---|
| Secrets | Per application environment: versioned, encrypted, audited secrets you read with secrets.read (GetSecretsAsync, GetSecretAsync, the AddTenancyEngineSecrets configuration provider), rotation with overlap, and sharing one secret between your applications by grant. See Secrets and app config. | No per-end-user or per-tenant-user credential vault. Secrets belong to your application environment, not to a person. Do not store your customers' own passwords or third-party tokens there; keep those encrypted in your own database. |
| Jobs | The platform runs its own internal scheduled work (for example secret rotation). Since 2.17.0 your app registers its own recurring jobs with AddTenancyEngineScheduledJobs (Scheduled jobs): leader election across replicas, history, timeouts, protected diagnostics. Private-feed build only: on the nuget.org package the facade does not exist (the TenancyEngine.Sdk.Scheduling namespace is missing, so code using it fails to compile). | Fixed-interval, at-least-once jobs only (checked 2026-11-04). Jobs must be idempotent: a hung job can be abandoned and overlap the next run, and a dropped lock connection releases the lock mid-run. No cron, no per-entity due dates, no replay of a missed tick, and not available in the nuget.org build (private feed only). The durable-automation control plane (/api/v1/runtime/applications/{slug}/automation/tenants/{tenantId}/...) is dark by default (AutomationRuntime is disabled in every lane until its gates close) and TenancyEngine.Automation is still 0.1.0-alpha, so do not plan on it. Make jobs idempotent: a run can be cancelled midway. |
| Cache | Opt-in, platform-provisioned Upstash Redis per organization, application and optional tenant (cache.manage, cache.read), billed at cost plus markup, plus SDK cache clients (CacheBackendFactory) that degrade instead of failing when the backend is down. See Platform caching. | TenancyEngine is not in the hot path and does not proxy cache calls; your app talks to the cache directly. |
If one of these gaps blocks you, tell us so it can be prioritised. Do not assume a missing piece is about to ship.
@tenancyengine/sdk (npm)
| Version | Status | What changed |
|---|---|---|
| 0.9.0 | source, not published yet | Object view counts. trackEvent page-view events accept optional objectType and objectId; getObjectViews reads zero-filled daily page-view event counts per object from GET /api/v1/runtime/analytics/object-views (needs an organization key with the new analytics:read scope, not an environment-bound or environment-kind-restricted key). Counts are events, not distinct visitors, and are advisory. Object ids must not be personal data. Additive. Publishing is the owner's release flow (#909). |
| 0.8.0 | on npm (published 2026-10-20) | Client allowlist. verifyAccessToken accepts allowedClientIds (skipped only when absent; an empty list or blank entry throws; a token with neither client_id nor azp, or with two that differ, is denied with client_not_allowed). AccessTokenClaims gains optional client_id, azp, tenant_id, oi_au_id. Current authority. createCurrentAuthorityChecker, checkCurrentAuthority and verifyAccessTokenWithAuthority ask POST /api/v1/runtime/oauth/introspect whether a verified token is still honoured (revocation, membership, workspace): fail closed with typed results, 3 second timeout, 5 second positive-only cache (15 at most), no token or key in any result. Additive; needs the platform introspection route and an application-level key with the oauth.introspect scope. |
| 0.7.0 | on npm (published 2026-10-19) | Local sign-in. createOidcLogin accepts http://127.0.0.1:<port>/... and http://[::1]:<port>/... redirect URIs, only in a process that is positively at the local development tier; localhost and every other http URL stay refused, and staging and production are https only. Refusals are OidcRedirectUriError (redirect_uri_invalid, redirect_uri_insecure, redirect_uri_loopback_refused); resolveOidcRedirectUri is exported. One-time transaction. handleCallback spends the login transaction before the token exchange (always-on in-process guard, new transaction_replayed code, optional consumeTransaction hook for several instances). Maintained crypto. Signature verification and JWK import now run on jose 5.10.0, which is the package's one runtime dependency (exact pin, MIT, no dependencies of its own); every existing verification rule is unchanged. Additive; the new runtime dependency is the only install-time difference. An https redirect URI with userinfo is now refused. Resource indicator. createOidcLogin accepts an optional resource (one https identifier, RFC 8707) sent on the authorization request and the code exchange, stored in the transaction; a callback for a transaction started for a different resource is refused with resource_mismatch, a malformed value with resource_invalid. Absent keeps the old behaviour. |
| 0.6.0 | on npm | Lane contract: resolveLane, laneApiKey, fakeLane, allowNonProductionIssuer, same-origin jwksUri rule. See the upgrade notes in the package README. |
| 0.5.0 | on npm | verifyAccessToken, createOidcLogin, buildProtectedResourceMetadata. |