A host app is a product that serves many of its own customers (tenants) and wants each of them to use IVD through it. Instead of registering a key per tenant, the host and the server share one secret, and the host derives each tenant’s key on demand. The server recomputes the key to check it: there is no provisioning step and nothing to sync.
A tenant key can list and call three content-only tools:
| Tool | Input |
|---|---|
ivd_validate |
artifact_yaml, optional artifact_type |
ivd_review_intent |
artifact_yaml |
canon_check |
text or document |
tools/list shows only these three.project_root and workspace_root are refused on every call. They name
paths on the server’s disk, which every caller of a shared server shares.ivd_validate runs no disk check for a tenant. A test path named in the YAML
is never opened, and the result carries test_paths_checked: false. The
tenant’s own test files are not on the server, so run them on your side.ivd_search (a paid embedding call) and the Judgment tools (they write to
the server’s disk) are not offered.key = "ivd_" + tenant + "_" + base64url_nopad( HMAC-SHA256(SECRET, "ivd:" + VERSION + ":" + tenant) )
tenant must match ^[a-z0-9][a-z0-9-]{0,55}$ (lowercase only).VERSION is one of the versions the server accepts (default v1).ivd_ and the last 44 characters. Do not split the key on _:
base64url can contain _.Python:
import base64, hashlib, hmac
def ivd_tenant_key(secret: str, tenant: str, version: str = "v1") -> str:
mac = hmac.new(secret.encode(), f"ivd:{version}:{tenant}".encode(), hashlib.sha256).digest()
return f"ivd_{tenant}_" + base64.urlsafe_b64encode(mac).rstrip(b"=").decode()
Test vector, to check your implementation:
| Secret | Version | Tenant | Key |
|---|---|---|---|
test-secret-do-not-use |
v1 |
acme |
ivd_acme_lapHGNV1gUE0w05P_i0KVkw8RF5Y5R_9-vngns5EZ50 |
Send it as Authorization: Bearer <key> on every request (Streamable HTTP at
/mcp, or legacy SSE at /sse + /messages).
Open one MCP session per tenant. A session is bound to the key that opened it: a message on that session with another tenant’s key, or an operator key, is answered as if the session did not exist (404). Reusing one session for two tenants does not work, by design.
| Variable | Meaning | Default |
|---|---|---|
IVD_TENANT_KEY_SECRET |
Shared secret. Not set: tenant keys are off and nothing changes | not set |
IVD_TENANT_KEY_VERSIONS |
Comma-separated versions accepted | v1 |
IVD_REVOKED_TENANTS |
Comma-separated tenants whose keys are refused | empty |
IVD_API_KEYS keep the full tool set, as before.IVD_API_KEYS is empty.v1,v2), move the host to v2, then drop v1.ivd:, so a key made for another product that
uses the same scheme is not valid here even with the same secret. Use a
different secret per server anyway.tenant:<id>, never the key.COMPLYEDGE_API_KEY, every call’s arguments and result,
tenant calls included, are sent to ComplyEdge for screening, and a block
replaces the tool’s answer. Tell your tenants their text goes there.