Tenant and security model
Draft 0.1 — for review
Tenant model and mastering
The tenant registry is the authoritative control-plane record of each organization allowed to use the platform. It is not inferred from an email suffix, display name, repository name, or request parameter.
Each tenant record should contain:
- Immutable Entra tenant GUID and verified organization label.
- Lifecycle state:
requested,verification-pending,approved,active,suspended, orretired. - Approved identity issuers and explicitly provisioned user/group memberships.
- Allowed repository IDs and exact Azure scopes (subscription/resource group/namespace) with delegation status and expiry.
- Data classification, region, retention policy, policy version, and onboarding/approval audit references.
- Optional verified domains for onboarding and display only; domains are never sufficient authorization.
Tenant onboarding requires an authorized administrator, an out-of-band verification step, an explicit scope proposal, and a separate approval. Tenant IDs and resource IDs are read from verified identity/provider data, not accepted as authoritative client input. Registry changes are audited and privileged changes require two-person review.
Authentication and authorization
Human operators
- Current phase: the operator uses the interactive Copilot agent console with their own signed-in Azure CLI session. The console is not a multi-tenant web application. Do not print, copy, or pass Azure access tokens into prompts, files, logs or the site. Review each cloud write before the CLI command runs.
- Use Microsoft Entra ID sign-in with MFA and Conditional Access enforced by the workforce tenant.
- Validate issuer, audience, signature, expiry, nonce and token version. Initially allow only the platform operator workforce tenant; later add customer access through an explicit onboarding and consent model.
- Use
(issuer, tid, oid)as the stable identity key. Do not use email or UPN as an authorization key. Record a guest user's home-tenant identity separately if required for audit. - Resolve roles and tenant membership server-side. Apply least privilege and short-lived role grants:
Developer,Reviewer,Operator, andTenantAdminshould be distinct. - Re-authenticate or require step-up MFA for high-risk actions such as approving a deployment or changing tenant scopes.
Agent and platform services
- Current phase: no hosted agent service identity is deployed for build/deploy operations; Azure CLI actions run under the signed-in operator identity. Avoid creating a broad unattended identity until a reviewed design defines its exact purpose and scope.
- Use AKS Workload Identity with a dedicated user-assigned managed identity per service. Bind each federated credential to the exact AKS OIDC issuer, namespace, service account, and audience.
- Grant only the resource actions that component needs. The chat and code-agent identities receive no Azure write access. The deployment executor has only approved demo-scope rights.
- Prefer short-lived tokens from managed identity. Never put Azure client secrets, Copilot tokens, GitHub PATs, kubeconfigs, or deployment keys in source, images, logs, prompts, or browser storage.
- Do not share a service identity between the chat API, code worker, validator and deployment executor.
Model and source-control access
- The initial model interface is the current Copilot agent console, not a new Copilot SDK server. The SDK service is a later option for multi-user or unattended operation and must be reviewed before deployment.
- The Copilot SDK runs in
mode: "empty"with explicit, reviewed tools. A token broker should mint short-lived GitHub App installation tokens with only Copilot Requests permission; alternatively use an approved managed-identity-backed model endpoint. - If a token must be mounted for a demo, mount it read-only from a secret manager, scope it to the runtime, rotate it, and ensure the runtime never returns it through tools, logs, errors or prompts. Replace this bridge with a token broker before multi-user use.
- Source control access is through a repository-scoped GitHub App or GitHub Actions OIDC. The agent cannot create arbitrary repositories, change org settings, or access unrelated repositories.
Customer tenant access
No customer tenant access is enabled for the current demo. If later approved, use Azure Lighthouse or a customer-operated deployment runner, with customer consent and narrowly delegated roles at an agreed resource-group scope. Avoid storing customer credentials in the platform. Do not request directory-wide admin consent for routine deployments.
Customer users may authenticate through a verified, explicitly provisioned Entra tenant. The platform must bind each authenticated identity to a registry tenant before any data access. A valid token from an arbitrary Entra tenant does not create membership.
Data isolation and "tenant mastering"
Treat tenant context as a server-owned security label that follows a request through the API, queue, agent session, storage, logs and deployment job. Every data access is filtered by the resolved tenant ID; missing or ambiguous tenant context fails closed.
- Database rows use tenant keys and enforced row-level authorization; queries cannot omit tenant scope.
- Objects use per-tenant prefixes and authorization checks, with separate keys or containers where risk requires.
- Conversation history, prompt context, files, vector indexes, caches and temporary workspaces are tenant-specific. No shared retrieval index or cross-tenant agent memory.
- Queue messages carry an authenticated tenant reference and are revalidated by consumers; never trust a tenant identifier solely because it appears in a message.
- Audit events record actor, tenant, action, scope, decision, artifact digest and outcome, but exclude bearer tokens and secret values. Minimize or redact prompt text.
- Tenant suspension immediately blocks new sessions and deployment approvals, revokes delegated grants, and starts the documented retention/deletion workflow.
Model/tool threat controls
Assume prompt injection, malicious repository content, compromised dependencies and unsafe model output. Use typed tool inputs, path normalization, per-session workspace isolation, dependency and IaC scans, outbound-network restrictions, request/time/resource limits, immutable artifacts and human approval. A human approval must identify the exact digest and target scope; it is not blanket permission for future plans.
The model must not be able to:
- Execute arbitrary commands or obtain an interactive cloud shell.
- Read Kubernetes secrets, host files, another tenant's workspace, or the token broker's credentials.
- Choose or alter its effective tenant, role, deployment identity, target subscription or allowed scope.
- Self-approve, bypass deterministic policy, or deploy directly.
Public documentation site
The architecture site is intentionally public and static. It must be generated only from sanitized Markdown and static diagrams. It has no secret-bearing configuration, API, forms, analytics, external scripts or customer data. Publish manually from the agent console using a deployment token retrieved at runtime; never write the token to source, logs or generated files. Review the build output and scan for credential patterns before publishing.
Incident response
Provide kill switches to disable new sessions, revoke model/source tokens, suspend a tenant, disable the deployment identity and stop pending jobs. Preserve immutable audit metadata, rotate affected credentials, identify exposed tenant scopes, and notify the responsible operator. Recovery procedures must not restore a suspended tenant's access automatically.