From 6a5867e40ec8a9aa86ef6d1ef84a10c668e09690 Mon Sep 17 00:00:00 2001 From: Jenny Date: Fri, 15 May 2026 22:32:46 -0700 Subject: [PATCH] Use numeric user ID instead of email for context.user_id Pass session.user.id (the Databricks numeric user ID from X-Forwarded-User header, e.g. "4255605719359984@2850744067564480") instead of email address as the context user_id sent to the agent backend. This avoids exposing email addresses in agent memory namespaces and store keys. Co-Authored-By: Claude Opus 4.6 --- e2e-chatbot-app-next/server/src/routes/chat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-chatbot-app-next/server/src/routes/chat.ts b/e2e-chatbot-app-next/server/src/routes/chat.ts index e2f4080e..f687e0c0 100644 --- a/e2e-chatbot-app-next/server/src/routes/chat.ts +++ b/e2e-chatbot-app-next/server/src/routes/chat.ts @@ -251,7 +251,7 @@ chatRouter.post('/', requireAuth, async (req: Request, res: Response) => { const modelMessages = await convertToModelMessages(uiMessages); const requestHeaders = { [CONTEXT_HEADER_CONVERSATION_ID]: id, - [CONTEXT_HEADER_USER_ID]: session.user.email ?? session.user.id, + [CONTEXT_HEADER_USER_ID]: session.user.id, // Forward OBO user token to the backend/serving endpoint ...(req.headers['x-forwarded-access-token'] ? { 'x-forwarded-access-token': req.headers['x-forwarded-access-token'] as string }