Skip to content

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

feat(ai-gateway): show a HIPAA notice when adding or editing provider credentials (#19530)

Hassieb Pakzadbe69f6bddba4
diff --git a/web/src/features/ai-gateway/components/GatewaySetupPage/components/ProviderDialogController/ProviderDialogController.tsx b/web/src/features/ai-gateway/components/GatewaySetupPage/components/ProviderDialogController/ProviderDialogController.tsx
index fc4d9d2a5c..a7263d263d 100644
--- a/web/src/features/ai-gateway/components/GatewaySetupPage/components/ProviderDialogController/ProviderDialogController.tsx
+++ b/web/src/features/ai-gateway/components/GatewaySetupPage/components/ProviderDialogController/ProviderDialogController.tsx
@@ -1,6 +1,6 @@
/* eslint-disable no-nested-ternary, @typescript-eslint/no-deprecated -- Legacy UI usage retained during migration to design-system components. */
import { useState, type ReactNode } from "react";
-import { TriangleAlert } from "@langfuse/icons";
+import { Info, TriangleAlert } from "@langfuse/icons";
import { Alert } from "@/src/components/design-system/Alert/Alert";
import { Button } from "@/src/components/ui/button";
@@ -17,6 +17,8 @@ import { CredentialFields } from "@/src/features/ai-gateway/components/GatewaySe
import { ProviderSelect } from "@/src/features/ai-gateway/components/GatewaySetupPage/components/ProviderDialogController/components/ProviderSelect";
import { providerLabels } from "@/src/features/ai-gateway/constants/providerLabels";
import { isGatewayConnectionNameError } from "@/src/features/ai-gateway/fns/isGatewayConnectionNameError";
+import { isGatewayHipaaNoticeVisible } from "@/src/features/ai-gateway/fns/isGatewayHipaaNoticeVisible";
+import { useLangfuseCloudRegion } from "@/src/features/organizations/hooks";
import { suggestGatewayConnectionName } from "@/src/features/ai-gateway/fns/suggestGatewayConnectionName";
import type {
GatewayConnection,
@@ -59,6 +61,7 @@ export function ProviderDialogController({
const utils = api.useUtils();
const capture = usePostHogClientCapture();
const existingNames = useExistingConnectionNames(organizationId);
+ const { region } = useLangfuseCloudRegion();
const name =
nameDraft ?? suggestGatewayConnectionName(provider, existingNames);
const test = api.aiGateway.testConnection.useMutation({
@@ -208,6 +211,16 @@ export function ProviderDialogController({
</DialogTitle>
</DialogHeader>
<DialogBody>
+ {isGatewayHipaaNoticeVisible(region) ? (
+ <Alert variant="info" icon={Info}>
+ <Alert.Title>HIPAA region</Alert.Title>
+ <Alert.Description>
+ Requests are forwarded to the provider you configure, using
+ your credentials and on your instruction. Make sure you have
+ a BAA with that provider before sending PHI.
+ </Alert.Description>
+ </Alert>
+ ) : null}
{selectedConnection ? (
<div>
<Label>Provider</Label>
diff --git a/web/src/features/ai-gateway/fns/isGatewayHipaaNoticeVisible.clienttest.ts b/web/src/features/ai-gateway/fns/isGatewayHipaaNoticeVisible.clienttest.ts
new file mode 100644
index 0000000000..96565b3e01
--- /dev/null
+++ b/web/src/features/ai-gateway/fns/isGatewayHipaaNoticeVisible.clienttest.ts
@@ -0,0 +1,22 @@
+// @vitest-environment node
+
+import { describe, expect, it } from "vitest";
+
+import { isGatewayHipaaNoticeVisible } from "@/src/features/ai-gateway/fns/isGatewayHipaaNoticeVisible";
+
+describe("isGatewayHipaaNoticeVisible", () => {
+ it("shows the notice in the HIPAA cloud region", () => {
+ expect(isGatewayHipaaNoticeVisible("HIPAA")).toBe(true);
+ });
+
+ it.each(["EU", "US", "JP", "STAGING", "DEV"] as const)(
+ "hides the notice in the %s cloud region",
+ (region) => {
+ expect(isGatewayHipaaNoticeVisible(region)).toBe(false);
+ },
+ );
+
+ it("hides the notice on self-hosted deployments", () => {
+ expect(isGatewayHipaaNoticeVisible(undefined)).toBe(false);
+ });
+});
diff --git a/web/src/features/ai-gateway/fns/isGatewayHipaaNoticeVisible.ts b/web/src/features/ai-gateway/fns/isGatewayHipaaNoticeVisible.ts
new file mode 100644
index 0000000000..6ebfdcdf4f
--- /dev/null
+++ b/web/src/features/ai-gateway/fns/isGatewayHipaaNoticeVisible.ts
@@ -0,0 +1,6 @@
+import type { useLangfuseCloudRegion } from "@/src/features/organizations/hooks";
+
+/** Only HIPAA-region customers need a BAA with the provider they forward requests to. */
+export const isGatewayHipaaNoticeVisible = (
+ region: ReturnType<typeof useLangfuseCloudRegion>["region"],
+) => region === "HIPAA";