Skip to main content

What tenants are

A tenant represents an organization or workspace that shares one KavachOS deployment. Each tenant has its own agents, audit log, and policy settings. Data is isolated by tenantId: agents in one tenant cannot be seen or authorized against by another. This is useful for SaaS products where each customer gets their own isolated agent environment without you running a separate database per customer.
tenantId is nullable everywhere it appears. Existing agents, policies, and audit entries created before you enable multi-tenancy continue to work without modification.

Data model

string
Stable identifier with a tnt_ prefix, e.g. tnt_acme.
string
Display name for the tenant.
string
URL-safe identifier. Lowercase letters, numbers, and hyphens only. Must be unique.
TenantSettings
Per-tenant configuration overrides.
'active' | 'suspended'
Suspended tenants cannot authorize requests.
Date
When the tenant was created.
Date
When the tenant was last modified.

TenantSettings

number
default:"undefined (uses global limit)"
Maximum active agents allowed in this tenant. Overrides the global default.
number
default:"undefined"
How deep delegation chains can go. Defaults to the global setting.
number
default:"undefined (no automatic pruning)"
How long audit entries are kept for this tenant, in days.
string[]
default:"undefined (all types allowed)"
Restrict which agent types can be created. E.g. [‘autonomous’] to disallow delegated agents.

Creating a tenant

Slugs must be unique and match ^[a-z0-9]+(?:-[a-z0-9]+)*$. KavachOS rejects duplicate slugs at creation time.

Creating an agent inside a tenant

Pass tenantId when creating an agent. The agent is then scoped to that tenant.
Authorization checks respect the tenant boundary: an agent in tnt_acme cannot be authorized against resources in tnt_other.

Listing agents by tenant

Fetching and updating a tenant

Settings are merged, not replaced. Fields you omit in the update keep their existing values.

Listing all tenants

Useful for admin dashboards. Returns all tenants regardless of status.

Suspending and reactivating

When a tenant is suspended, all authorize() calls for agents in that tenant return allowed: false. Existing tokens are not revoked; they fail authorization until the tenant is reactivated.

Budget policies per tenant

Attach a budget policy to a tenant to apply spending limits across all agents in it. See Budget policies for the full policy reference.

Next steps

Budget policies

Apply cost limits at the tenant, agent, or user level.

Agent identity

Create agents scoped to a tenant.

Audit log

Filter the audit trail by tenant.
Last modified on April 18, 2026