Skip to content

[agent test] Use numeric user ID instead of email for context.user_id#214

Draft
jennsun wants to merge 1 commit into
databricks:mainfrom
jennsun:use-user-id-for-context
Draft

[agent test] Use numeric user ID instead of email for context.user_id#214
jennsun wants to merge 1 commit into
databricks:mainfrom
jennsun:use-user-id-for-context

Conversation

@jennsun
Copy link
Copy Markdown
Contributor

@jennsun jennsun commented May 16, 2026

image

Summary

  • Pass session.user.id (the Databricks numeric user ID from X-Forwarded-User header, e.g. 4255605719359984@2850744067564480) instead of session.user.email as the context.user_id sent to the agent backend
  • This avoids exposing email addresses in agent memory namespaces and Lakebase store keys
  • The numeric ID is the stable Databricks identity and is always available (email is optional per the X-Forwarded-Email header)

Test plan

  • Deploy agent template with long-term memory, verify context.user_id in backend logs shows numeric ID
  • Verify memory save/retrieve still works with the numeric ID namespace
  • Verify chat history and session continuity are unaffected

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@jennsun jennsun changed the title Use numeric user ID instead of email for context.user_id [agent test] Use numeric user ID instead of email for context.user_id May 16, 2026
@jennsun jennsun marked this pull request as draft May 16, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant