> ## Documentation Index
> Fetch the complete documentation index at: https://docs.promptguard.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Provision members with Directory Sync (SCIM)

> Automatically provision and deprovision PromptGuard members from your identity provider

# Directory Sync (SCIM)

Directory Sync adds people to your PromptGuard organization from your identity provider (Okta, Microsoft Entra ID, Google Workspace, and more), and removes them when they are deactivated, suspended or deleted in the directory, no manual invites.

> [!NOTE]
>
> Directory Sync comes with SSO, on the Enterprise and Shadow Enterprise plans ([Pricing](https://docs.promptguard.co/pricing.md)), and works best alongside [SSO](https://docs.promptguard.co/platform/sso.md). [Talk to us](mailto:sales@promptguard.co) to enable it.

> [!WARNING]
>
> **Directory Sync is available on [self-hosted installs](https://docs.promptguard.co/production/enterprise-setup.md) only for now.** It is provided by WorkOS, which is not yet configured on the hosted service. Directory groups are not mapped to PromptGuard roles: synced users join as members, and you assign roles in PromptGuard.

## Why use it

* **Automatic onboarding**: a new hire in your directory becomes a PromptGuard member without an invite.
* **Automatic offboarding**: deactivating, suspending or deleting a user in your directory removes them from your PromptGuard organization and revokes their credentials there at once.
* **One source of truth**: your directory, not a separate PromptGuard member list.

## Prerequisites

* An organization on a plan that includes SSO: Enterprise or Shadow Enterprise.
* The **Owner** or **Admin** role.
* A directory that supports SCIM 2.0 (most major IdPs do).
* [SSO](https://docs.promptguard.co/platform/sso.md) configured (recommended, so synced users sign in seamlessly).

## Set up Directory Sync

**1. Open the SSO settings**

In the dashboard, go to [**Settings → SSO**](https://app.promptguard.co/dashboard/settings?section=sso) and click **Configure Directory Sync**. PromptGuard opens the secure, hosted setup portal for your organization.

**2. Connect your directory**

In the portal, choose your IdP and follow its guided steps to connect your directory. The portal gives you the SCIM endpoint URL and bearer token to paste into your IdP's provisioning settings.

**3. Assign users or groups**

In your IdP, assign the users (or groups) who should have PromptGuard access to the connected application. Your IdP pushes them to PromptGuard.

**4. Verify**

Back in [**Organization → Team**](https://app.promptguard.co/dashboard/settings/team), confirm the assigned users now appear as members.

## What gets synced

| Directory event | Effect in PromptGuard |
| - | - |
| User created or updated, **active** | If they are not a member, an account is created for their primary email if none exists, and added to your organization as a **Member**. If they are already a member, their name is updated, and their email too when [both addresses are on a verified domain](#email-changes) |
| User created or updated, **not active** (deactivated, suspended, or any other state) | Removed from your organization, exactly as for a deletion. Someone who is not a member is not added, however often the event repeats |
| User deleted (`dsync.user.deleted`) | Removed from your organization, exactly as an admin's **Remove** in **Organization → Team**: their API keys in your organization stop working and their Shadow AI devices are revoked. The owner is never removed this way; resolve that by hand |

Removal affects only the organization connected to the directory. The person's account, their personal organization and any other organization they belong to are untouched.

### Email changes

A PromptGuard account can belong to several organizations, so its sign-in email is not any one directory's to change. When your IdP changes someone's email, PromptGuard updates the account's email only if both the old and the new address are on a domain PromptGuard has [verified for your organization](https://docs.promptguard.co/platform/sso.md), and no other account already uses the new address. Otherwise the account keeps its email; PromptGuard still recognises the person by their directory identity, so later updates and offboarding apply to them as normal.

> [!NOTE]
>
> Synced users join as **Members**. Promote anyone who needs elevated access to **Admin** or **Owner** in **Organization → Team**, or grant project-specific roles in [project access settings](https://docs.promptguard.co/platform/organizations.md#project-level-access). Role changes you make in PromptGuard are preserved across syncs while the person stays active. Someone who is deactivated and later reactivated rejoins as a **Member**.

## Security

> [!WARNING]
>
> Directory Sync events are accepted only when they carry a valid signature from your provisioning connection. PromptGuard rejects unsigned or tampered requests, so a forged event can't add or remove members.

* Deprovisioning is **immediate**, when your IdP reports a user as deactivated, suspended or deleted, the member's access to your organization and their credentials in it end right away.
* Events can reach PromptGuard late, twice or out of order. Each time a user is created or updated, PromptGuard reads that user's current record from your directory and applies it, so a delayed event cannot undo a newer change, such as re-adding someone you have since deactivated.
* Directory Sync covers organization membership. It does not delete the user's historical audit-log entries, which are retained for compliance.

## Troubleshooting

> [accordion] Assigned users aren't appearing
>
> Confirm the users (or their group) are assigned to the application in your IdP, and that provisioning/push is enabled there. It can take a minute for the first sync to propagate.

> [accordion] A removed user still has access
>
> Check that your IdP is still pushing to the connected application: PromptGuard acts only on events it receives. A user who is the organization's **Owner** is never removed by Directory Sync; transfer ownership first. Otherwise remove them manually in **Organization → Team**.

## Next steps

> [card] [Single Sign-On (SSO)](https://docs.promptguard.co/platform/sso.md)
>
> Let synced users sign in with your identity provider.

> [card] [Organizations & Teams](https://docs.promptguard.co/platform/organizations.md)
>
> Roles, members, and project-level access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.