# Workspaces

A **workspace** subdivides an organization. Every agent lives in exactly one, and the workspace named in the URL decides which agents an operator is currently looking at. With managed services the [tenant switcher](https://docs.polyant.ai/admin-panel/overview#the-tenant-switcher) at the top of the sidebar picks it.

Workspaces exist as a structural container on every deployment. Using them to *scope permissions* is available with managed services.

## The workspace switcher

The active workspace is part of the URL: admin-panel routes are tenant-scoped, so the organization and the workspace being acted in are carried by the path rather than by hidden state. The panel also sends the pair as the `X-Org-Slug` and `X-Workspace-Slug` headers on every call, and the engine **validates the workspace header on every route** - a mistyped workspace is refused rather than quietly answering from another one.

`GET /api/me` returns the caller's tenancy - **every organization they hold**, each with the workspaces they can actually reach inside it (not every workspace the organization owns), plus the workspace they last worked in and their own role in each - and the panel builds and validates its tenant URLs from it. The panel reads it without the workspace named in the address, so a mistyped workspace slug shows a "not found" page rather than an account that belongs to nothing. `GET /api/me/access` adds the caller's own role in the addressed organization and workspace (`orgRole`, `workspaceRole`), which the panel shows in the user menu. It requires **only that you are signed in** - no RBAC permission at all. That is deliberate: the caller who most needs this route is the one with no binding yet, a fresh invitee or an account a platform admin just created, and gating it on a permission answered them 403 instead of an empty tenancy. A caller who belongs to nothing gets a `200` with no organizations, which is what lets the panel say so instead of looking broken.

`PUT /api/workspaces/active` records the preference by workspace slug (permission `org:read`) so a returning operator resumes where they left off. The preference is honoured only while it is still reachable **and still in the organization it was recorded in** - otherwise the panel falls back to that organization's default workspace, then to the first reachable one. Two workspaces in different organizations can share a slug, so a bare preference would otherwise pick the wrong one.

Switching workspace is a navigation, not a stored mode: it **keeps the page you are on**, and a detail page truncates to its list. There is no active-workspace cookie - a second notion of "the current workspace" is how a URL and a request come to name different ones.

Which workspaces appear depends on the deployment:

| | Who sees every workspace in the organization | Who sees a subset |
|---|---|---|
| **Without workspace-scoped RBAC** | any organization member (and platform admins) | - |
| **With workspace-scoped RBAC** | platform admins, and anyone whose organization role is level 30 or above | everyone else sees only the workspaces they hold a workspace binding for |

The test is the **role level**, not the role key: a [custom role](https://docs.polyant.ai/admin-panel/roles) at level 30 or above sees every workspace too. Comparing keys instead would have silently excluded every custom role from a rule that is about seniority.

An operator with no binding and no membership sees none.

## Managing workspaces

> **Managed services.** Creating and deleting workspaces, and their API, require the workspace-scoped-RBAC feature.

Workspaces have no list page of their own. **Add**, at the foot of the [tenant switcher](https://docs.polyant.ai/admin-panel/overview#the-tenant-switcher), creates a workspace in the organization you are in and opens it; the workspace is renamed, described and deleted on its own [General page](#the-workspaces-general-page). Both need **`workspace:write`** on a deployment where the feature is licensed, and the routes are `POST`, `PATCH` and `DELETE /api/organizations/{orgSlug}/workspaces[/{workspaceId}]`. The old `…/settings/organization/workspaces` address opens the organization's General page.

That permission exists because creating or deleting a workspace edits the organization's *structure*, not its *people*. It used to be gated on `org.member:manage` - so creating a workspace was governed by a permission literally named "manage members", and "may create workspaces but not administer people" could not be expressed by a custom role at all. The three concerns are now separable:

| Permission | Governs |
|---|---|
| `org.member:manage` | who belongs to the organization |
| `workspace:write` | which workspaces exist |
| `workspace.member:manage` | who is placed in a workspace |

All three are held by Admin and above, so nothing changed for the built-in roles - the split is what makes a [custom role](https://docs.polyant.ai/admin-panel/roles) able to hold one without the others.

Create a workspace by giving it a **name**: the **slug** is made from the name as you type, until you edit the slug yourself. The name can be changed later; the slug cannot, because it is in every address, saved link and `X-Workspace-Slug` header, and the update route refuses it. Slugs are URL path segments: lowercase alphanumerics separated by single dashes, and unique within the organization - a collision is refused rather than silently suffixed.

Deleting asks for confirmation and then opens the default workspace. Two deletions are refused rather than cascaded: the organization's **default** workspace can never be deleted (its General page offers no such action), and a workspace that still owns agents returns a conflict - move or delete its agents first.

Every route also rejects a caller from a different organization, even one holding `org.member:manage` in their own.

## Workspace-scoped bindings

> **Managed services.**

A user can hold a role **on a workspace** in addition to their organization role, and in that workspace the binding decides their workspace-tier permissions, granting and revoking: a Member given Viewer on `finance` can only read there. An organization role at Admin rank or above (Owner, Admin, or a custom role ranked at that level) is the exception: it keeps its workspace-tier permissions in every workspace and a binding only adds to it, so an Admin given Viewer on `finance` keeps the Admin's rights there. The role the panel shows for a workspace follows the same rule.

That makes the common case expressible from the other side: someone who should write agents in one workspace and only read in the others gets a lower organization role plus a higher binding on the one workspace.

Which workspaces a person reaches is a separate rule, [above](#the-workspace-switcher): a Member or Viewer reaches only the workspaces where they hold a binding, while level 30 and above reach them all. A binding decides what the person may do in a workspace they reach.

Assign and remove workspace roles from the person's drawer on [Members & roles](https://docs.polyant.ai/admin-panel/members#workspace-roles), which needs `workspace.member:manage`. Both mutations land in the [authorization audit](https://docs.polyant.ai/admin-panel/authz-audit).

For the full resolution order, including the platform-admin bypass, see [Roles and permissions](https://docs.polyant.ai/reference/roles#how-a-decision-is-made).

## The workspace's General page

> **Managed services.**

The **General** entry, last in the [workspace's sidebar](https://docs.polyant.ai/admin-panel/overview#the-workspaces-sidebar) (the one the **Workspace** entry at the foot of the home sidebar opens), opens the workspace's own settings at `/organizations/{org}/workspaces/{ws}/settings`. It holds the workspace's name and description (`workspace:write`), its slug (shown, never changed), the workspace's [dev-mode](https://docs.polyant.ai/admin-panel/dev-mode) switch where the organization has been granted dev mode (`workspace.assignment:manage`), and, for any workspace but the default, **Delete**. The entry is shown to someone who holds either permission.

The description is optional; saving it empty clears it.

The workspace's governance settings are entries of the workspace sidebar's **Governance** group, each its own page:

| Entry | Address (under `…/settings`) | What it holds | Needs |
|---|---|---|---|
| **Policies** | `/policy` | the governance policies applied to every agent of the workspace, and which of them the agents cannot turn off (**Locked**) | `org.governance:read` to read, `org.governance:write` to change |
| **Data retention** | `/retention` | how long the workspace's agents keep conversations, unless an agent sets its own; read-only under an organization lock | `conversation:read` to read, `conversation:delete` to change |
| **Spend cap** | `/budget` | the default cap each agent follows and the total all of them may spend; read-only under an organization lock | `agent:read` to read, `agent.governance:write` to change |

They were tabs of this page, once named Configuration; their old `?tab=` links forward here. See [Retention](https://docs.polyant.ai/admin-panel/retention) and [Spend cap](https://docs.polyant.ai/admin-panel/spend-cap) for how the workspace's values sit between the organization's and each agent's.

## What a workspace may draw on

A workspace does not automatically get everything its organization holds. **A skill, a plugin or an AI provider reaches an agent only when both boundaries agree**: the organization must hold it - its own skill, a granted platform skill, an installed or granted plugin, an admitted provider - *and* the agent's workspace must have it assigned. Either one missing and the agent never sees it.

The screens that edit the workspace half are under **Resources** in the workspace's sidebar, and all need `workspace.assignment:manage` (Admin and above) to change anything:

| Screen | Address |
|---|---|
| **Skills** | `/organizations/{org}/workspaces/{ws}/settings/skills` |
| **Integrations** | `/organizations/{org}/workspaces/{ws}/settings/plugins` |
| **Providers** | `/organizations/{org}/workspaces/{ws}/settings/providers` |
| **Connections** (managed services; also readable with `agent:write`) | `/organizations/{org}/workspaces/{ws}/settings/connections` |

Skills, Integrations and Providers each list only what the organization holds, with one switch per row, and open the organization's own drawer for a skill or a plugin, read-only apart from the switch. The Skills page lists the organization's catalogue; the Integrations page lists the plugins the organization has installed or been granted; the Providers page lists the providers the organization is admitted to. A plugin or provider the organization does not hold is absent, not shown as disabled: what other tenants of the installation run is not disclosed. A plugin the engine cannot run is flagged separately; enabling it there has no effect either way.

### Three consequences worth knowing before you rely on it

- **A new workspace starts empty.** There is no inheritance and no snapshot at creation, so an agent moved into a fresh workspace has no skills and no plugin tools until someone assigns them. This reads like a bug the first time it happens; it is the fail-closed direction, chosen deliberately.
- **A new grant at organization level reaches no workspace.** Granting a platform skill or a plugin to the organization, or installing a plugin there, makes it *assignable*; it does not assign it. The workspace pass is a second, manual step.
- **Revoking assigns nothing away permanently.** Revoking touches only the workspace allow-list - each agent's own skill rows survive, so re-assigning restores every agent's configuration exactly. This is the same rule that governs an organization-level revoke.

The **Providers** page is the same shape. With managed services, the **Connections** page beside it lists the [provider connections](https://docs.polyant.ai/admin-panel/provider-connections) the workspace's agents can choose: the workspace's own and those the organization lends it. A workspace's own connection, created there with **New workspace connection**, is usable by that workspace's agents alone; an organization connection is lent with **From the organization…** and withdrawn with **Remove from this workspace**. Lending is what lets an agent in the workspace bind that credential to a role by name, and withdrawing it is the everyday revoke - agents bound to that connection stop at their next call rather than quietly falling back onto another key. An organization set to accept only its own connections refuses workspace connections, at creation and at every call. A workspace's shared library is embedded with the organization's library connection only where that connection is lent to the workspace. Switching a single model off here is a veto that the organization cannot undo, and the reverse holds too; see [AI Gateway](https://docs.polyant.ai/concepts/ai-gateway#which-providers-and-models-a-tenant-may-run). The assignment binds every call an agent makes to a provider: chat, and also the embeddings behind memories, knowledge documents and search queries, and speech-to-text. A connection or key on a provider this workspace has not assigned is refused for all of them.

The one automatic assignment is an agent creating a skill at runtime: `createSkill` assigns the new skill to that agent's own workspace, because a skill an agent just wrote and cannot then use would be committed and dead.

### Where an operator meets the allow-list

The allow-list filters reads as well as writes, so a gap shows up as an explanation rather than a silently shorter list:

- An agent's **Tools** and **Skills** tabs report how many of the things configured on that agent the workspace does not carry - a count, never the names, because the names are organization-tier information and these tabs are reachable with workspace-tier permissions.
- The agent's [Status](https://docs.polyant.ai/admin-panel/instances#status) section reports the same gaps as checks, and says where to fix them.

### On upgrade

The migration that introduced the allow-list **backfills every workspace that existed at the time with everything its organization held**, so an upgrade changes nothing for a running deployment. The empty-by-default rule applies only to workspaces created afterwards.

Providers were introduced the same way and with one deliberate difference: a **new** workspace admits every provider its organization holds, and a new organization is admitted every provider the catalogue knows. An empty plugin allow-list is an agent with fewer tools; an empty provider allow-list is an agent that cannot answer at all, so starting empty would mean every organization created after the feature shipped was born dead.

The list is read **at creation and not followed afterwards**: a provider the platform gives the organization later is a decision its admins take again, workspace by workspace. That is the tier split the feature exists to keep.

## See also

- [Organizations](https://docs.polyant.ai/admin-panel/organizations) - the tenant a workspace belongs to.
- [Skills](https://docs.polyant.ai/admin-panel/skills) - the catalogue the workspace allow-list draws from.
- [Tools](https://docs.polyant.ai/admin-panel/tools#plugins-are-installed-per-organization) - the plugin half of the same rule.
- [Members and roles](https://docs.polyant.ai/admin-panel/members) - assigning organization and workspace roles.
- [Agents (General)](https://docs.polyant.ai/admin-panel/instances) - the objects a workspace contains.
