All videos
0:00 / 0:00
software_tutorials

How to manage shared and user credentials with Managed Deep Agents Connections

LangChain9 September 2026Watch on YouTube

Part of series

Ep. 9 · Actually Agent Agents

View the series

What you'll learn

  • You learn the three ways to wire credentials into Managed Deep Agents
  • Using the MDA connections CLI to create and retrieve agent-owned secrets
  • How an OAuth flow through MCP runs automatically on the user's behalf
  • Registering a custom OAuth app in the connections catalog for user-owned tokens
  • You see how tools are built that use the user's token to run searches and create issues

Frequently asked questions

What is the downside of one hardcoded API key in an agent?
With a single hardcoded key all users share the same credentials. The video solves this with agent-owned secrets or user-bound OAuth, so each user works with their own access.
How do you store an agent-owned secret and retrieve it at runtime?
You create the connection with the MDA connections create command and retrieve the secret later with connections.get. This way your agent's tools use one shared key.
In which three ways can you wire credentials into a deep agent?
The three methods are agent-owned secrets with one shared key, user-owned OAuth through MCP, and user-owned OAuth with a custom app that you register in the connections catalog.
How is the OAuth flow for a user triggered?
The OAuth flow is triggered from LangSmith Studio and then runs automatically on the user's behalf. This lets the agent act on the user's own tools and data.

Topics

In this video

Read next

Description from the channel

Nathan Drezner, Product Manager at LangChain, walks through Connections for Managed Deep Agents. Keep watching for three ways to wire credentials into a deep agent so it can act on real tools and data. He covers agent-owned secrets (one shared key), user-owned OAuth through MCP, and user-owned OAuth with a custom app, showing the MDA connections CLI, LangSmith Studio, and the OAuth flow that runs automatically on the user's behalf. Chapters: 0:00 The problem with one hardcoded API key 0:30 Method 1: Agent-owned secrets (one shared key) 0:48 Creating a connection with MDA connections create 1:41 Pulling the secret at runtime with connections.get 2:15 Running the tool in LangSmith Studio 2:48 Method 2: User-owned OAuth through MCP 3:06 Connecting Linear's MCP server 4:07 Triggering the OAuth flow from Studio 5:23 Method 3: User-owned OAuth with a custom app 6:22 Registering the OAuth app in the connections catalog 7:32 Writing custom tools that use the user's token 8:25 Running search and create issue on the user's behalf 10:09 Getting started with the connections catalog Resources: → Deep Agents: https://www.langchain.com/deep-agents → LangSmith: https://www.langchain.com/langsmith → LangChain Academy: https://academy.langchain.com