Establish OAuth Flow for Secure Tool Usage #3308
KentonParton
started this conversation in
Ideas & Feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
Vercel AI SDK has quickly become the easiest way to build elegant and powerful AI experiences. One of the standout features that enables this is tools, allowing the integration of external APIs and services seamlessly into AI workflows.
While tools are simple to implement in the Vercel AI SDK, secure access to many useful tools presents a challenge, especially when organizations have strict authentication requirements.
Example Scenario:
Consider Organization X, which uses Okta for identity management. User A within Organization X has access to multiple tools, such as GitHub, NewRelic, and Confluence. When building an AI chatbot, the challenge arises: How do we securely provide access to these tools within the AI workflow?
It wouldn’t be secure to expose GitHub, NewRelic, or Confluence to the organization’s users via a static API key, especially when the user's identity and permissions are tied to their organization. Instead, OAuth should be incorporated into the chat session.
Proposed Solution:
When a user asks a question that requires access to a tool (e.g., fetching data from GitHub repositories), the AI chatbot should initiate an OAuth flow for that tool. Here’s how this could work:
User Authentication via Okta:
Users sign in using Okta, which handles primary authentication and ensures their organization’s identity provider is leveraged for secure access.
Dynamic OAuth Flow for Tools:
When the user invokes a tool (e.g., GitHub), the app should trigger an OAuth flow for that specific tool. The user is prompted to log in (if necessary) and grant access to the AI chatbot for that session.
Secure Token Storage:
The OAuth token is stored securely, scoped to the user’s session, and used only when needed to interact with the respective tool.
Seamless User Experience:
The OAuth flow would only be initiated when required, ensuring users aren’t prompted unnecessarily, while ensuring secure, granular access to tools on a per-session basis.
Request for Feedback:
Would the Vercel AI SDK consider supporting an OAuth flow for tools?
I’d love to hear thoughts on how others envision this working.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions