# Hosted Model Onboarding

> Canonical path: `specs/billing/hosted-model-onboarding.md`
> Status: living implementation contract
> Scope: organization-admin onboarding for AgentTeam-hosted model inventory,
> MaaS default-open availability, optional explicit hosted entitlement facts,
> hosted credit balance, workspace authorization, selectable model composition,
> and MaaS runtime admission.

Related canonical specs:

- [Hosted Credits Payment Flow](./hosted-credits-payment.md)
- [Organization Seat Purchases](./organization-seat-purchases.md)
- [agentteam-maas Integration Boundary](../maas/agentteam-maas-integration.md)
- [Organization Specs](../organization/README.md)
- `agentteam-maas/specs/maas/hosted-product-configuration-apply.md`
- `agentteam-maas/specs/maas/messages-feature-support.md`

## Purpose

AgentTeam-hosted models must be available through an organization-admin flow that is
short for the default case and explicit for later governance:

1. For default-open hosted inventory introduced by `agentteam-maas` #14, MaaS
   hosted availability is the source of truth. AgentTeam consumes MaaS availability
   and does not bootstrap entitlement grants for new organizations.
2. MaaS may still store hosted entitlement as an explicit organization fact for
   non-default-open or policy-gated inventory. AgentTeam may request idempotent
   grants only when an explicit AgentTeam eligibility policy and MaaS entitlement
   target are configured.
3. AgentTeam bootstraps desired hosted access for the organization's initial default
   workspace, and organization owners/admins can configure hosted access before
   or after the first recharge.
4. Hosted credit recharge adds usable hosted balance.
5. Workspaces are authorized to use the full active hosted inventory by
   default; organization owners/admins use per-model selection or revocation
   only when they need tighter control.
6. Workspace users select available hosted models through the unified
   selectable model API when creating or configuring agents.

The organization admin must not need to configure provider credentials,
upstream routes, route groups, catalog policy handles, pricing versions, or
runtime MaaS internals. Bring-your-own provider and route management remains a
separate organization model settings feature.

## Product Goals

- Default-open hosted model availability is authoritative in `agentteam-maas`. AgentTeam
  consumes the MaaS availability result for the organization and must not
  create default hosted entitlement grants during new-organization bootstrap.
- Explicit hosted entitlement remains MaaS state for non-default-open or
  policy-gated inventory. Automated AgentTeam-initiated grants require an explicit
  AgentTeam eligibility policy and MaaS entitlement target, and are never derived
  from payment history.
- New default organizations do not call the internal MaaS
  `/hosted-entitlements/grants/` write path as part of default-open hosted
  onboarding. AgentTeam bootstrap is limited to AgentTeam-owned organization, default
  workspace, and workspace hosted authorization state.
- Hosted credit recharge affects balance only. It does not create, remove, or
  prove hosted entitlement.
- Organization admins grant hosted model access to workspaces through a hosted
  access surface, not through provider, route, or route-group setup.
- Organization onboarding enables all-active hosted authorization by default for
  the initial workspace and future workspaces, while preserving admin controls
  to narrow or revoke access later.
- Per-model workspace authorization is available for organizations that need to
  narrow access after onboarding.
- Workspace users see hosted and BYOK model options through one selectable
  model API, with disabled or hidden hosted entries governed by organization
  policy.
- Entitlement, balance, workspace authorization, feature support, daemon
  support, and runtime admission have distinct states so UI copy and support
  tooling can explain the required action.

## Non-goals

- Browser product management for hosted catalog, pricing, upstream routes, or
  platform credentials.
- Direct AgentTeam writes into `agentteam-maas` catalog, pricing, payment, ledger,
  entitlement, reservation, usage, or settlement tables.
- Runtime entitlement decisions derived from payment history queries.
- Requiring organization admins to understand or manage provider resources,
  routes, route groups, policy handles, upstream credentials, or pricing
  versions.
- Replacing bring-your-own organization provider settings. Custom providers and
  BYOK route concepts remain part of the existing organization model settings
  surface.
- Retroactively broadening existing workspaces after an admin narrows or revokes
  them. Auto-authorization applies to new workspaces and the no-row all-active
  fallback; explicit workspace overrides remain authoritative.
- Making disabled hosted-model visibility configurable per workspace. The
  disabled-entry visibility policy is organization-wide.

## Terms

- **Global hosted inventory**: The active AgentTeam-hosted model products, display
  metadata, pricing, feature metadata, and upstream route bindings operated in
  `agentteam-maas`.
- **Hosted model reference**: The public MaaS-owned model identity used by AgentTeam
  and browsers. The v1 format is `agentteam/<stable-slug>`, for example
  `agentteam/deepseek-v4-pro` or `agentteam/deepseek-v4-flash`. References are stable and
  must not be reused for a different hosted product.
- **Default-open hosted availability**: MaaS-owned availability for hosted
  inventory that is open to organizations by default. For this inventory, AgentTeam
  reads MaaS availability and does not create an explicit organization
  entitlement grant during organization bootstrap.
- **Eligible organization**: An organization that AgentTeam policy says may receive
  hosted model entitlement. Eligibility is AgentTeam-owned and is not inferred from
  recharge or payment history.
- **Hosted entitlement**: A `agentteam-maas`-owned durable grant that says an
  organization may use a hosted inventory bundle or catalog policy. Entitlement
  remains explicit when AgentTeam initiates it under a configured eligibility
  policy.
- **Hosted availability resolution**: AgentTeam's browser-facing composition of
  MaaS inventory, MaaS entitlement and balance status, AgentTeam workspace
  authorization, organization visibility policy, runtime feature requirements,
  and daemon support.
- **Workspace hosted authorization**: An AgentTeam-owned organization-admin decision
  that a workspace may use hosted models. It is stored separately from BYOK
  provider, route, and route-group grants.
- **Picker visibility policy**: The organization-wide policy that decides
  whether disabled hosted entries remain visible in workspace model pickers.
  It does not hide enabled hosted models and does not apply to billing or
  hosted model management pages.
- **Auto-authorization policy**: The organization-wide hosted authorization
  default, enabled for new organizations, that applies a template to future
  workspaces and to workspaces without an explicit authorization record. The
  default template authorizes all active hosted inventory.
- **Selectable model**: A model option that the agent creation and settings UI
  can present for the current workspace.
- **AgentTeam-hosted binding**: Agent configuration with stored
  `llm_mode = agentteam_hosted` and browser/API `llmMode = agentteam_hosted`, with
  `model` set to a public hosted model reference. BYOK proxy-backed models
  remain `llm_mode = agentteam_proxy` / `llmMode = agentteam_proxy`.

## Ownership

| Concern | Owner | Rule |
| --- | --- | --- |
| Global hosted catalog, pricing, product policy, upstream routes, platform credential metadata, feature metadata, and hosted model references | `agentteam-maas` operators and `agentteam-maas` | AgentTeam reads MaaS facts and must not expose upstream handles to organization admins. |
| Default-open hosted availability and organization hosted entitlement facts | `agentteam-maas` | MaaS availability is authoritative for default-open inventory, and AgentTeam must not create bootstrap grants for it. Explicit entitlement is MaaS state for policy-gated inventory; AgentTeam may request idempotent grants or revokes only when an AgentTeam eligibility policy and entitlement target are configured. |
| Organization eligibility decision | AgentTeam Server | AgentTeam-owned policy decides which organizations should receive automated explicit hosted entitlement when that policy is enabled; default-open availability is MaaS-owned. |
| Payment order, payment event, hosted credit grant, hosted credit batch, and ledger | `agentteam-maas` | AgentTeam exposes browser APIs and verifies Alipay callbacks, but does not write ledger facts. |
| Hosted credit balance presentation and recharge entry points | AgentTeam Server plus `agentteam-maas` billing APIs | Recharge creates credit balance only. It does not create entitlement or workspace authorization. |
| Hosted access settings, workspace authorization, picker visibility policy, and auto-authorization policy | AgentTeam Server | Organization owners/admins manage these through hosted access APIs, not BYOK provider APIs. |
| Selectable model composition | AgentTeam Server | AgentTeam combines BYOK options with hosted availability resolution for the current workspace. |
| Runtime admission and metering | `agentteam-maas` | `agentteam-maas` remains authoritative for request admission, usage metering, reservation, and settlement. |
| Runtime authority and MaaS capability issue | AgentTeam Server | AgentTeam issues short-lived direct MaaS capabilities for `agentteam_hosted` agents after validating AgentTeam and MaaS prerequisites. |

## User Flow

### Hosted access setup

1. An organization owner/admin opens the hosted model management surface and
   sees the active hosted inventory, pricing, entitlement status, balance
   status, and workspace authorization status.
2. AgentTeam shows MaaS entitlement status. If an automated eligibility policy is
   configured and the organization is eligible but MaaS entitlement is missing
   or pending, AgentTeam may start or retry a bounded org-scoped entitlement grant
   repair.
3. Workspaces are authorized by default with `all_active_hosted_inventory`.
   An admin may narrow a workspace to `selected_hosted_models` or revoke access
   when needed.
4. If the organization has no usable hosted credit balance, the access settings
   are still saved as desired access. Hosted models remain disabled for runtime
   use until balance exists.

### First recharge

1. An organization owner/admin starts a hosted credit recharge from billing or
   hosted model management.
2. After the payment provider settles the order, `agentteam-maas` posts the hosted
   credit grant and ledger facts exactly once.
3. Settlement does not create hosted entitlement and does not write per-workspace
   authorization rows.
4. With the default all-active workspace authorization, a positive balance makes
   authorized hosted models selectable once entitlement exists. Otherwise, AgentTeam
   shows the missing entitlement action.

### Later recharges

Later hosted credit recharges add credit balance and must not duplicate
entitlements or workspace authorization. Settlement repair remains scoped to
the payment order and MaaS billing facts.

### Workspace changes

New workspaces are auto-authorized by default with the organization hosted
authorization template, which starts as `all_active_hosted_inventory`.
Workspaces without an explicit workspace hosted authorization record inherit the
current organization template, so agent creation can offer hosted models for any
workspace in the organization as soon as MaaS entitlement, balance, and runtime
prerequisites are satisfied under the default policy.

The initial organization default workspace may still persist the all-active
authorization as an explicit row for admin visibility. Future workspaces may
receive an explicit row from the organization-wide auto-authorization policy, but
the read-time fallback remains the same all-active policy.

Auto-authorization is enabled by default. When an admin changes the template:

- the policy stores a default workspace authorization template:
  `all_active_hosted_inventory` or `selected_hosted_models`;
- future workspaces receive the current template automatically as an explicit
  authorization row;
- changing the template affects future workspaces by default;
- existing workspaces change only when an owner/admin updates each workspace
  authorization explicitly.

## State Model

Hosted onboarding is not a single linear state. AgentTeam derives browser outcomes
from independent dimensions.

| Dimension | Values | Owner | Meaning |
| --- | --- | --- | --- |
| Hosted inventory | `active_inventory`, `model_retired`, `inventory_unavailable` | `agentteam-maas` | Whether the public hosted model reference exists and is active for browser selection. |
| Organization eligibility and entitlement | `eligible_entitled`, `entitlement_pending`, `not_entitled`, `entitlement_suspended` | AgentTeam eligibility plus MaaS entitlement | Whether MaaS has an explicit entitlement grant for the organization. |
| Hosted balance | `positive_balance`, `zero_balance`, `balance_unavailable` | `agentteam-maas` | Whether the organization has usable hosted credit balance. |
| Workspace authorization | `all_active_hosted_inventory`, `selected_hosted_models`, `workspace_not_authorized` | AgentTeam Server | Whether the workspace is allowed to use hosted models and at what granularity. |
| Picker visibility | `show_disabled_when_unavailable`, `hide_disabled_when_unavailable` | AgentTeam Server | Whether disabled hosted entries are visible in workspace pickers. |
| Runtime and feature support | `runtime_supported`, `feature_unsupported`, `daemon_upgrade_required`, `runtime_unavailable` | MaaS metadata plus AgentTeam daemon context | Whether the selected runtime path can execute the hosted model and requested features. |

Derived picker outcomes:

- A hosted model is **enabled** when inventory is active, the organization is
  entitled, the workspace authorization covers the model, balance is positive,
  required features are supported, and the daemon/runtime path can use direct
  MaaS.
- A hosted model is **disabled** when it is visible but one or more
  prerequisites are missing.
- A hosted model is **hidden** only when the organization-wide picker
  visibility policy hides disabled hosted entries. Enabled hosted models remain
  visible.
- BYOK selectable models are not disabled or hidden because MaaS hosted
  availability is unavailable.

Failure reasons are role-sensitive:

- Organization owners/admins may receive specific reasons such as
  `not_entitled`, `entitlement_pending`, `workspace_not_authorized`,
  `zero_balance`, `feature_unsupported`, `daemon_upgrade_required`, and
  `runtime_unavailable`.
- Workspace users who cannot act on the underlying state receive non-sensitive
  reasons such as `admin_action_required` or `temporarily_unavailable`.

## Backend Contracts

### Automated Eligibility And Entitlement Sync

- For default-open hosted inventory introduced by `agentteam-maas` #14, MaaS
  availability is the source of truth. AgentTeam reads MaaS availability and does
  not apply a separate AgentTeam eligibility decision for those models.
- New-organization bootstrap must not call the internal MaaS
  `/hosted-entitlements/grants/` write path for default-open hosted models.
  Organization creation may write only AgentTeam-owned organization, default
  workspace, and workspace hosted authorization state.
- AgentTeam determines hosted eligibility for each organization according to an
  explicit AgentTeam-owned policy only when automated explicit entitlement is
  enabled.
- AgentTeam-initiated automated grants use an idempotent internal MaaS entitlement
  grant API only for explicit entitlement-gated inventory. The grant targets a
  MaaS hosted model id, catalog policy, or hosted inventory bundle, not public
  model references.
- MaaS stores entitlement as explicit durable state, for example in
  `organization_hosted_entitlement_grants`.
- Operator-applied MaaS entitlement remains valid for manual, bulk, and repair
  workflows.
- Hosted credit recharge and payment settlement must not create, revoke, or
  prove hosted entitlement.
- Losing eligibility or MaaS entitlement disables hosted use but must not
  delete AgentTeam workspace desired access. If entitlement is restored, previously
  saved workspace authorization becomes usable again when other prerequisites
  are satisfied.
- AgentTeam may run org-scoped background sync when eligibility changes, but only
  for explicit entitlement-gated inventory after the eligibility policy and
  MaaS entitlement target are configured.
- Hosted model management may trigger a bounded org-scoped entitlement repair
  when automated explicit entitlement is configured.
- Read paths for billing first paint and agent model selection must not scan
  payment history or perform broad entitlement repair writes.

### Hosted availability reads

- MaaS must provide an internal hosted availability API, or equivalent internal
  projection, that returns all active hosted inventory plus per-organization
  availability facts needed by AgentTeam.
- For default-open hosted inventory from `agentteam-maas` #14, the availability API
  is the authoritative signal that a new organization can see and use the model
  without an explicit `/hosted-entitlements/grants/` write.
- The availability payload must include public hosted model references, display
  metadata, pricing metadata needed by browser surfaces, feature metadata,
  entitlement status, balance status, and safe runtime availability reasons.
- The runtime data-plane `GET /maas/v1/models` endpoint is not sufficient for
  AgentTeam browser availability because it returns executable models for entitled
  orgs and omits disabled inventory that the picker may need to show.
- Retired or disabled hosted models are excluded from ordinary picker results
  by default. Admin or support APIs may include them with an explicit
  `include_retired=true` style option.
- AgentTeam must not expose upstream provider names, platform credential handles,
  internal route handles, or MaaS catalog policy handles to organization
  admins or workspace users.

### Workspace authorization

- Hosted workspace authorization has its own AgentTeam source of truth and API. It
  must not use BYOK provider, route, or route-group grants as the canonical
  state.
- Organization owners/admins can authorize a workspace using:
  - `all_active_hosted_inventory`, which dynamically includes future active
    hosted models; or
  - `selected_hosted_models`, which includes only the listed public hosted
    model references.
- The default onboarding action authorizes workspaces with
  `all_active_hosted_inventory`.
- Organization creation should bootstrap the initial default workspace with
  `all_active_hosted_inventory`. Later workspaces are authorized by default
  through organization-wide auto-authorization or the no-row organization
  default fallback.
- Workspace authorization may exist before entitlement or balance. In that
  state it records desired access and becomes usable when the missing MaaS
  prerequisites are satisfied.
- Revoking workspace authorization prevents new hosted model selection and new
  MaaS capability issue or refresh for affected hosted agents.
- Narrowing a workspace from `all_active_hosted_inventory` to
  `selected_hosted_models` is a revoke for existing `agentteam_hosted` agents whose
  model references are no longer authorized.
- Revoke and narrowing flows must report the affected hosted-agent count before
  applying the change when the admin action can disrupt existing agents.
- Revoke and narrowing flows must prevent new hosted model selection and new
  MaaS capability issue or refresh for affected hosted agents. Existing
  short-lived MaaS capabilities may expire naturally.

### Hosted access management APIs

Hosted access management belongs under organization management, not billing.
Billing surfaces may link to it and show next actions, but they do not own
workspace authorization.

Canonical browser API shapes:

- `GET /api/orgs/:orgId/hosted-models` returns hosted inventory and
  org-scoped availability facts for management pages.
- `GET /api/orgs/:orgId/hosted-model-settings` returns picker visibility and
  auto-authorization policy.
- `PATCH /api/orgs/:orgId/hosted-model-settings` updates picker visibility and
  auto-authorization policy.
- `GET /api/orgs/:orgId/workspaces/:workspaceId/hosted-model-authorization`
  returns desired hosted access for a workspace.
- `POST /api/orgs/:orgId/workspaces/:workspaceId/hosted-model-authorization/preview`
  returns the affected hosted-agent count for a proposed workspace
  authorization change without applying the change.
- `PUT /api/orgs/:orgId/workspaces/:workspaceId/hosted-model-authorization`
  updates desired hosted access for a workspace.

These APIs are owner/admin APIs. Ordinary workspace users learn hosted
availability through the selectable model API.

### Selectable model API

- AgentTeam Server provides the workspace-scoped selectable model API from the
  workspace API domain. It is not a billing API and browsers do not call MaaS
  directly for this data.
- The canonical browser route is `GET /api/v1/workspaces/:workspaceId/selectable-models`.
- The v1 route supports `features` for hosted feature filtering. Future
  versions may add `runtime` or `machineId`.
- If a future `machineId` filter is added, it is used only by AgentTeam to evaluate
  daemon capability such as `agent:maas-direct`. It is not sent to MaaS
  availability APIs and is not part of MaaS capability claims.
- The v1 response includes BYOK organization-provider options and AgentTeam-hosted
  options. User-owned model profiles stay separate under
  `/api/v1/me/model-profiles`.
- Hosted entries include at least `source`, `modelReference`, display name,
  enabled/disabled state, safe reasons, available actions for the caller, and
  runtime requirements such as `requiresMachineCapability`.
- When MaaS pricing facts are available, the response may include hosted token
  price fields and the credit-atom-to-display-credit unit needed for browser
  price labels. These are display facts only; billing administration remains on
  the billing APIs.
- When MaaS applies a hosted pricing override, the response may also include
  effective/base price metadata and optional override metadata so model pickers
  can show a compact discount badge without calling a separate pricing API.
- MaaS hosted availability failures must not prevent BYOK models from being
  returned.
- AgentTeam applies organization picker visibility policy after computing hosted
  enabled/disabled state.

### Agent creation and settings

- Hosted agent configuration uses stored `llm_mode = agentteam_hosted` and
  browser/API `llmMode = agentteam_hosted`.
- The stored `model` value is the public hosted model reference.
- BYOK proxy-backed models continue to use `llm_mode = agentteam_proxy` /
  `llmMode = agentteam_proxy`.
- Agent create, update, and switch-to-hosted operations must synchronously
  validate:
  - the model reference is a public active hosted reference;
  - the workspace hosted authorization covers the model;
  - the organization has hosted entitlement;
  - the organization has usable hosted credit balance;
  - MaaS reports required runtime and feature support;
  - the selected machine or daemon supports direct MaaS when that context is
    known during runtime start or capability issue.
- The selectable model API is not a trust boundary. Backend saves and runtime
  capability issue must re-check the same prerequisites.
- New hosted agent creation and switching an existing agent to hosted must fail
  when hosted balance is zero.
- If balance later becomes zero, existing `agentteam_hosted` agent configuration is
  preserved, but start, capability refresh, and hosted runtime execution fail
  until usable balance exists.
- Validation must return specific failure reasons when the caller is allowed to
  know the reason. Organization owners/admins should receive links or actions
  to recharge, repair entitlement, update daemon support, or authorize
  workspace access when applicable.

### Runtime credential boundary

- `agentteam_hosted` agents use the direct MaaS credential path already defined in
  [agentteam-maas Integration Boundary](../maas/agentteam-maas-integration.md).
- AgentTeam issues short-lived MaaS capabilities with
  `credentialKind=maas_capability` only after AgentTeam authority, workspace
  authorization, entitlement, balance, runtime feature support, and daemon
  support checks pass.
- Daemons that do not advertise `agent:maas-direct` cannot run
  `agentteam_hosted` agents. Browser and runtime preflight responses must surface a
  daemon upgrade or runtime unavailable state.
- `agentteam_proxy` keeps the existing BYOK proxy semantics and must not be used as
  the hosted runtime binding for new AgentTeam-hosted agent configurations.

## Frontend Surfaces

### Billing center

The billing center shows hosted credit balance, recharge entry points, payment
state, and hosted inventory pricing. It may show the next hosted-model action,
for example configure workspace access or resolve entitlement status, but it
does not own hosted authorization settings.

### Hosted model management

Organization hosted model management must be separate from bring-your-own
provider and route management.

For AgentTeam-hosted models, the management page should show:

- active hosted model inventory;
- organization eligibility and entitlement status;
- hosted credit balance status and recharge action;
- organization-wide picker visibility policy;
- organization-wide auto-authorization policy;
- workspace authorization controls;
- affected hosted-agent counts for disruptive revokes or narrowing changes;
- disabled reasons for models that cannot be used.

The page must not ask organization admins to configure upstream credentials,
route resources, route groups, catalog policy handles, or pricing versions.
Those are MaaS operator concerns.

### Agent creation and settings

Agent creation and agent settings consume `GET /api/v1/workspaces/:workspaceId/selectable-models`.
Authorized hosted models appear as ordinary model options for workspace users.
Unauthorized or otherwise unavailable hosted models are visible but disabled by
default. Organization owners/admins can change the organization-wide policy to
hide disabled hosted entries from all workspace pickers.

New user-facing strings in these surfaces require complete i18n entries.

## Operational Rules

- Hosted inventory must be configured in `agentteam-maas` before AgentTeam offers it in
  billing, hosted management, or selectable model surfaces.
- Automated eligibility sync, entitlement repair, payment settlement,
  workspace authorization, auto-authorization, and runtime authority checks
  must be retryable independently.
- Repair jobs must be bounded by an explicit organization, payment order,
  workspace selection, affected-agent set, or small cursor page. They must not
  scan all organizations or all payment history on normal read paths.
- Read paths for billing first paint and agent model selection must not perform
  broad repair writes. If repair is needed, the read response should expose a
  pending state or enqueue a bounded org-scoped repair action.
- Disabling or retiring a hosted product should disable future selection and
  runtime admission while preserving payment, ledger, pricing, request, and
  audit history.
- MaaS unavailability must not cause AgentTeam to invent local entitlement,
  pricing, balance, runtime feature, or ledger facts.

### Deploy order for default-open availability

1. Deploy `agentteam-maas` #14 first so MaaS availability is already authoritative
   for default-open hosted inventory.
2. Verify MaaS availability returns the default-open hosted LLM for a new or
   grantless organization without requiring an explicit entitlement grant.
3. Deploy AgentTeam #2255 after the MaaS behavior is live. This removes the AgentTeam
   new-organization entitlement bootstrap write while continuing to consume
   MaaS hosted availability.

### Rollback order for default-open availability

1. Roll back AgentTeam #2255 before rolling back `agentteam-maas` #14. This avoids
   running an AgentTeam version that depends on MaaS default-open availability while
   MaaS no longer provides it.
2. Roll back `agentteam-maas` #14 only after AgentTeam has been restored to a version
   whose onboarding behavior matches the MaaS entitlement model in production.

### Smoke checks for default-open availability

- Create a new organization and confirm AgentTeam does not write to the MaaS
  `/hosted-entitlements/grants/` endpoint or create default explicit hosted
  entitlement grants for default-open inventory.
- Confirm the same organization still receives the default-open hosted LLM in
  AgentTeam's hosted model management and selectable-model responses through MaaS
  availability.
- With the normal workspace authorization, balance, feature-support, and daemon
  prerequisites satisfied, confirm the new organization can create or run a
  `agentteam_hosted` agent using the default-open hosted LLM.

## Failure Semantics

- **Automated entitlement pending**: when a configured eligibility policy has
  started an entitlement grant, AgentTeam shows `entitlement_pending` to owner/admin
  callers and retries bounded org-scoped sync or repair.
- **Org not entitled**: hosted entries are disabled or hidden by policy; owners
  and admins receive an entitlement action when one is available.
- **Workspace not authorized**: organization owners/admins can grant access;
  workspace users cannot select hosted models and receive non-sensitive admin
  guidance.
- **Workspace authorized, zero balance**: hosted models are visible but
  disabled by default until recharge creates usable credit balance.
- **Runtime feature unsupported**: the model remains configured only when
  already saved, but new selection or runtime preflight fails for the requested
  feature set.
- **Daemon does not support direct MaaS**: hosted entries are disabled for that
  machine context with `daemon_upgrade_required` or an equivalent safe reason.
- **MaaS availability unavailable**: AgentTeam returns BYOK selectable models and
  disables or hides hosted entries according to organization policy.
- **Runtime admission rejected**: AgentTeam must surface the MaaS runtime reason
  when safe, and must not bypass `agentteam-maas` entitlement, feature, reservation,
  balance, or metering checks.

## Compatibility And Migration

- Existing bring-your-own organization provider settings remain supported.
- Existing explicit hosted entitlements created by operators remain valid when
  compatible with active inventory.
- Default-open hosted inventory introduced by `agentteam-maas` #14 is not backed by
  AgentTeam-created bootstrap entitlement grants. AgentTeam deployments that remove the
  bootstrap write must run only after MaaS default-open availability is live.
- Existing system-managed hosted provider, route, or route-group rows may be
  retained as compatibility-derived state, but they are not the hosted product
  source of truth and must not be exposed as organization-admin hosted setup.
- Existing hosted references must be aligned to MaaS-owned public
  `modelReference` values before they are used by selectable model or
  `agentteam_hosted` agent configuration.
- Migration deployments may allow operator-applied entitlements and configured
  AgentTeam-initiated automated entitlements to coexist. Automated sync must not
  downgrade or remove a broader explicit entitlement.

## Acceptance Criteria

- MaaS can report default-open hosted availability for an organization without
  a recharge or explicit grant, and AgentTeam can consume that availability
  independently from payment history.
- New-organization bootstrap does not write `/hosted-entitlements/grants/` for
  default-open hosted inventory.
- Explicit hosted entitlement remains supported for non-default-open or
  policy-gated inventory independently from payment history.
- A workspace without an explicit hosted authorization row inherits the
  organization hosted authorization default, whose new-organization policy
  authorizes all active hosted inventory.
- An organization owner/admin can view hosted inventory and configure desired
  workspace hosted access before the first recharge.
- A hosted credit recharge adds usable balance without creating duplicate
  credit grants, entitlements, or workspace authorization.
- The organization owner/admin can authorize a workspace for all active hosted
  inventory without configuring providers, routes, credentials, or pricing.
- The organization owner/admin can later narrow a workspace to selected hosted
  model references and see the affected hosted-agent count before applying a
  disruptive change.
- A user in an authorized workspace can select an active hosted model when the
  organization is entitled, has usable hosted credit balance, and the runtime
  path supports the model and requested features.
- A user in an unauthorized workspace cannot select hosted models for new agent
  configuration.
- Disabled hosted entries are visible by default and can be hidden by an
  organization-wide owner/admin policy.
- BYOK selectable models remain available when MaaS hosted availability is
  temporarily unavailable.
- Billing, entitlement, workspace authorization, balance, daemon support,
  feature support, and runtime failures produce distinguishable states for
  browser UI and support tooling.
