This guide explains the role management system, including how prompts are assigned to users and teams, and the different types of access levels available.

Basic Concepts

Prompt

A custom system prompt that the AI assistant will use when communicating with the large-language model. Prompts define how the AI behaves and responds to users.

Organization

The overarching bucket for all related users, teams, and prompts. Organizations serve as the top-level container for managing access and permissions.

Team

A group of users within an organization. There can be multiple teams in an organization, and a user can be a member of multiple teams simultaneously.

Team Manager

A special team member that has additional privileges on that team, including:
  • Adding and removing team members
  • Creating team-scoped prompts
  • Assigning team-scoped prompts to members

Org Admin

A special god-level user that has access to do almost anything in an organization, including managing all teams, users, and prompts.

Team-Scoped Prompt

A prompt that is scoped to a specific team. Only team managers (and org admins) have access to view prompts for a team. Team managers cannot view prompts from other teams that they are not managing. Team-scoped prompts can only be assigned to members of that team.

Org-Scoped Prompt

A prompt that does not belong to a team. These prompts can only be managed by org admins and can be assigned to any org member, regardless of team membership.

Manual Prompt Assignments

Each user can only be assigned exactly one prompt. Assigning a prompt to a user will remove the previous prompt assignment, if there is one. In cases where a user is a member of multiple teams, team managers are unable to tell when a team member is assigned to a prompt from another team. They will simply show up as “Unassigned” in the current team’s page.

Example Scenario

TechCorp has two sales teams: Enterprise Sales and SMB Sales. Sarah is a manager of both teams, whereas Mike is only a manager of SMB Sales. Scenario 1:
  • Jennifer is a member of both Enterprise Sales and SMB Sales
  • Sarah assigns the “Enterprise Lead Qualification” prompt to Jennifer on the Enterprise Sales team
  • On the SMB Sales page, Jennifer will show up as unassigned, because Jennifer is assigned an Enterprise Sales prompt
Scenario 2:
  • David is a member of SMB Sales only
  • Mike assigns the “SMB Discovery Call” prompt to David
  • On the Enterprise Sales page, David won’t even show up because David is not part of Enterprise Sales

Automatic Prompt Assignments

When a user logs in and they have a user-role (e.g., sales_rep, account_manager, sales_manager, or sales_director), the system automatically:
  1. Adds them to the default team for that role
  2. Assigns them the default prompt for that team
This only happens if the user is not already a member of the team. If the user is already a member of that team, it’s a no-op.

Role to Team Mapping

const USER_ROLE_TO_TEAM_MAPPING: Record<string, string> = {
  sales_rep: "77798734-150d-4f1a-94ee-0758d0563acd",
  account_manager: "18dd09a7-be14-45c6-93dc-54717fb7e480",
  sales_manager: "0b1b1225-1250-47a9-83e5-70296ee35c51",
  sales_director: "7724642c-46dd-476b-a4d5-e008417ec19b",
};

Important Bug Note

There was a bug where the system assigned the team’s default prompt to the user, even if the user already had an assigned prompt. This was particularly problematic when the sales_director role and team were recently added. When users with the sales_director role started logging in, they were automatically added to the sales_director team and given the default sales_director team prompt, which may have unassigned any prompt previously assigned to these users.

Example of the Bug

Jennifer was previously assigned the “Enterprise Lead Qualification” prompt on the Enterprise Sales team. She was just given the sales_director role. When Jennifer logs in, she is automatically added to the sales_director team and assigned the sales_director team’s default prompt, removing the “Enterprise Lead Qualification” prompt. Now on the Enterprise Sales page, Jennifer will show up as Unassigned, because she is assigned a sales_director team prompt.