Stop Giving Your AI Agents API Keys - Kim Maida, Keycard & Mason Egger, Temporal
Summary
This talk details how to build secure and reliable AI agents by addressing two critical architectural challenges: identity management and state persistence. Kim Maida demonstrates replacing shared API keys with OAuth token exchange, ensuring every tool call is scoped to a specific resource and tied to both the agent's and the user's identity, creating a full audit trail. Mason Egger complements this by introducing Temporal, a durable execution framework that ensures agents can fail and recover seamlessly, preventing the loss of state, credentials, or expensive LLM calls during long-running tasks.
Key takeaways
-
Secure Agent Identity via Token Exchange
20:51
Instead of shared API keys, agents should use OAuth token exchange. This process ensures that every tool call receives a short-lived token scoped to that specific call and tied to the agent's identity and the user's identity (the 'subject token').
-
Multi-Hop Token Delegation
10:40
Token exchange is a multi-hop process: The agent exchanges the user's subject token for a token to access the MCP server (1st hop). The MCP server then uses that token to initiate a second exchange to get a token for the downstream resource (e.g., Ledger API).
-
Durable Execution for Agents
Temporal provides durable execution, allowing agents (which are complex loops/distributed systems) to fail and recover without losing state, re-calling LLMs, or re-executing previous activities. The application state is maintained internally.
-
Maintaining Confidentiality in Durable Systems
Sensitive data (like JWT tokens and credentials) must be kept out of the Temporal event history. This can be achieved using custom interceptors (like Keycard implemented) or Temporal's native payload encoder.
More digests on Agent Architecture
Technical details
-
OAuth 2.0 Token Exchange
159s
The process involves an Authorization Server (IdP) issuing a token after user consent and defining scopes. The agent uses this subject token to request access to a resource via a dedicated OAuth client, which validates the request against defined policies.
-
Agent Architecture Components
310s
The agent loop involves an LLM, an MCP client, and an MCP server. The MCP server acts as a gateway, receiving the agent's proposed tool calls and initiating the necessary token exchanges to access downstream resources (e.g., Ledger API).
-
Temporal Workflow Structure
Temporal applications are built using workflows, which are defined by parent and child function calls (activities). These activities are designed to be fault-tolerant, allowing the system to retry or rebuild state upon failure.
Mentioned resources
Channel & topics
Watch on YouTube · Back to latest
This independent, AI-assisted summary is provided for commentary and informational purposes. It may contain errors or omit important context. Please watch the original video for the creator's complete presentation. Video, thumbnail, and related copyrights belong to their respective owners.