Isolate customer orgs, Base stores, and entitlements

Isolate customer organizations, Base datastores, and runtime plan entitlements via /v1/iam/organizations, /v1/base/bases/{org}, and /v1/entitlement/orgs/{org}.

Ship enterprise-grade multi-tenancy on day one. Every customer organization gets its own IAM identity boundary, Base store, KMS namespace, and plan entitlement resolution.

Architecture & contract

Resolve tenant entitlements server-side from IAM-verified org claims (GET /v1/entitlement/orgs/{org}) before opening Base queries (/v1/base/bases/{org}) or routing into paid model tiers.

Primary endpoint: GET /v1/entitlement/orgs/{org} · Status: shipped · Level: architect

Run it across all four surfaces

hanzo iam organizations list
hanzo plan list
hanzo entitlement orgs get acme-corp
import { Configuration, PlanApi, EntitlementApi, BaseApi } from 'hanzoai';

const cfg = new Configuration({ accessToken: process.env.HANZO_API_KEY });
const [plans, ent, base] = await Promise.all([
  new PlanApi(cfg).getPlan(),
  new EntitlementApi(cfg).getEntitlementOrgsByOrg('acme-corp'),
  new BaseApi(cfg).getBaseBasesByOrg('acme-corp'),
]);
console.log({ plans: plans.data, ent: ent.data, base: base.data });
import os
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import PlanApi, EntitlementApi, BaseApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
print(PlanApi(client).get_plan())
print(EntitlementApi(client).get_entitlement_orgs_by_org("acme-corp"))
print(BaseApi(client).get_base_bases_by_org("acme-corp"))
curl -s https://api.hanzo.ai/v1/plan \
  -H "Authorization: Bearer $HANZO_API_KEY" | jq '.'

curl -s https://api.hanzo.ai/v1/entitlement/orgs/acme-corp \
  -H "Authorization: Bearer $HANZO_API_KEY" | jq '.'

curl -s https://api.hanzo.ai/v1/base/bases/acme-corp \
  -H "Authorization: Bearer $HANZO_API_KEY" | jq '.'
curl -s -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "entitlement",
      "arguments": {"op": "get_entitlement", "input": {}}
    }
  }'

Verify the outcome

  • Assert a tenant on a free plan is gated cleanly from enterprise-only model tiers via resolved entitlements.

Production guardrails

  • Never trust client-supplied org headers without verifying the authenticated IAM token's org membership.

Next steps & Hanzo University

Was this page useful?
Broken link or missing step? Drop it in #docs on Discord or open a PR.
Last updated Nov 25, 2026