What tenants are
A tenant represents an organization or workspace that shares one theAuth deployment. The tenant module stores tenant records (name, slug, settings, status), and agents and budget policies can carry atenantId.
tenantId is nullable everywhere it appears. Existing agents, policies, and audit entries created before you start using tenants continue to work without modification.Data model
Per-tenant configuration values, stored on the tenant record and not enforced by the SDK (see the note above).
TenantSettings
Intended cap on active agents in this tenant. Not enforced; the cap that applies is
agents.maxPerUser.Intended delegation depth limit. Not enforced; delegation uses the
maxDepth passed to delegate().Intended audit retention for this tenant, in days. Not enforced; call
theauth.audit.cleanup({ retentionDays }) yourself.Creating a tenant
Slugs must be unique and match^[a-z0-9]+(?:-[a-z0-9]+)*$. theAuth rejects duplicate slugs at creation time.
Creating an agent inside a tenant
PasstenantId when creating an agent with theauth.agent.create. The agent stores that tenant ID, and the tenant must already exist (foreign key). The REST endpoint POST /agents ignores tenantId.
Listing agents by tenant
Available ontheauth.agent.list only; GET /agents has no tenantId parameter.
Fetching and updating a tenant
Listing all tenants
Suspending and reactivating
suspend and activate flip the tenant’s status between suspended and active. The SDK does not check that status when authorizing, so suspending a tenant does not stop its agents by itself. To cut off a tenant today, check tenant.status in your own code, or revoke its agents with theauth.agent.revoke.
Budget policies per tenant
Budget policies store atenantId, but checkBudget and recordUsage match policies by agentId only, so a tenant-only policy applies to every agent, not just the tenant’s. See Budget policies for the full reference and how to enforce limits.
Next steps
Budget policies
Per-agent and global cost limits, with the check and enforcement steps you call yourself.
Agent identity
Create agents scoped to a tenant.
Audit log
Query the audit trail by agent or user.