Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat(ai-gateway): invite new gateway team members with the AI_GATEWAY role (#19514)

Tobias Wochinger3e07d58dcbe9
diff --git a/web/src/__tests__/server/ai-gateway-control-plane.servertest.ts b/web/src/__tests__/server/ai-gateway-control-plane.servertest.ts
index 18b65f37ae..9a4a2bba03 100644
--- a/web/src/__tests__/server/ai-gateway-control-plane.servertest.ts
+++ b/web/src/__tests__/server/ai-gateway-control-plane.servertest.ts
@@ -519,7 +519,7 @@ describe("AI gateway control plane", () => {
where: { orgId: owner.org.id, email: inviteeEmail },
select: { orgRole: true },
}),
- ).resolves.toEqual({ orgRole: Role.MEMBER });
+ ).resolves.toEqual({ orgRole: Role.AI_GATEWAY });
});
it("tells which invitee addresses already belong to the organization and get notified", async () => {
diff --git a/web/src/features/ai-gateway/components/TeamInviteFields/components/ExternalInviteeHint.tsx b/web/src/features/ai-gateway/components/TeamInviteFields/components/ExternalInviteeHint.tsx
index 9bfc52acc2..9242f68651 100644
--- a/web/src/features/ai-gateway/components/TeamInviteFields/components/ExternalInviteeHint.tsx
+++ b/web/src/features/ai-gateway/components/TeamInviteFields/components/ExternalInviteeHint.tsx
@@ -16,8 +16,8 @@ export function ExternalInviteeHint({ count }: ExternalInviteeHintProps) {
</span>
<span>
{subject} in the organization yet. They&apos;ll be invited to the
- organization and join as{" "}
- <strong className="text-foreground font-bold">Member</strong>.
+ organization and join with the{" "}
+ <strong className="text-foreground font-bold">AI Gateway</strong> role.
</span>
</p>
);
diff --git a/web/src/features/ai-gateway/constants/gatewayTeamInvites.ts b/web/src/features/ai-gateway/constants/gatewayTeamInvites.ts
index 0ada5c6aa9..9dadf89958 100644
--- a/web/src/features/ai-gateway/constants/gatewayTeamInvites.ts
+++ b/web/src/features/ai-gateway/constants/gatewayTeamInvites.ts
@@ -5,6 +5,6 @@ export const MAX_MEMBER_SEARCH_LENGTH = 320;
export const TEAM_NOTIFY_COPY = {
title: "Notify your team",
description:
- "Members can create their own gateway keys and use the models you enabled. New people join as Member.",
+ "Members can create their own gateway keys and use the models you enabled. New people join with the AI Gateway role.",
rolesDocsUrl: "https://langfuse.com/docs/administration/rbac",
} as const;
diff --git a/web/src/features/ai-gateway/server/router.ts b/web/src/features/ai-gateway/server/router.ts
index d9cfa72d8c..45717e93b5 100644
--- a/web/src/features/ai-gateway/server/router.ts
+++ b/web/src/features/ai-gateway/server/router.ts
@@ -241,7 +241,7 @@ export const aiGatewayRouter = createTRPCRouter({
});
}),
- /** Invites new people as members and optionally tells existing members. */
+ /** Invites new people with the AI Gateway role and optionally tells existing members. */
inviteTeam: protectedOrganizationProcedure
.input(
organizationInput.extend({
diff --git a/web/src/features/ai-gateway/server/team/gatewayTeamService.ts b/web/src/features/ai-gateway/server/team/gatewayTeamService.ts
index 35f921e615..a694b67707 100644
--- a/web/src/features/ai-gateway/server/team/gatewayTeamService.ts
+++ b/web/src/features/ai-gateway/server/team/gatewayTeamService.ts
@@ -53,8 +53,8 @@ function normalizeEmails(emails: string[]) {
type GatewayTeamContext = Pick<OrgAuthedContext, "session" | "prisma">;
/**
- * Owns every email the gateway setup sends: invitations for new people (as
- * organization members) and the announcement to existing members who can use
+ * Owns every email the gateway setup sends: invitations for new people (with
+ * the AI Gateway organization role) and the announcement to existing members who can use
* the gateway. Emails are queued, one job per recipient, and sent by the worker.
*/
export class GatewayTeamService {
@@ -203,7 +203,7 @@ export class GatewayTeamService {
try {
await inviteOrganizationMember({
ctx,
- input: { orgId: organizationId, email, orgRole: Role.MEMBER },
+ input: { orgId: organizationId, email, orgRole: Role.AI_GATEWAY },
sendInvitationEmail: async ({ to, userExists }) => {
emailJobs.push({
...sender,