Technology

Keycard and Temporal Replaced Static Agent Keys With Expiring Tokens

Kim Maida and Mason Egger replaced static API keys with Token Exchange and Temporal durable execution, cutting token lifetime to minutes.

StartupHub.ai Staff

By StartupHub.ai Staff, reviewed by Daniel Singer, Editor

2 min read

Before this demo the Expense Desk agent used a static API key. That key held unrestricted permissions to the Ledger API via the Expense MCP server. Then Kim Maida of Keycard and Mason Egger of Temporal showed a runtime replacement on AI Engineer. An attacker with local disk access could steal the old key. A remote attacker now gets a token that expires within minutes.

Keycard and Temporal Replaced Static Agent Keys With Expiring Tokens - AI Engineer
Keycard and Temporal Replaced Static Agent Keys With Expiring Tokens, AI Engineer

Static keys do not expire.

Maida traced the fix to Token Exchange, an open standard since 2020 that extends OAuth 2. The flow issues a subject token for the principal. It exchanges that token through Keycloak's Security Token Service. The issued access token expires within minutes and should never be stored on disk.

"The agent has unrestricted access to any and all permissions in that API key," Maida said. Her workshop moved step by step from an unidentified agent to an agent with its own identity to delegated human identity. The stack included Keycard Vault to keep LLM keys off disk, the Keycard CLI to populate secrets dynamically, the Keycard SDK mint function to request the exchange, and the Keycard Console to audit applications, resources and activity logs.

Egger paired that with Temporal's Durable Execution Framework. Workflows define parent logic and Activities run child tasks that can fail and retry. A native Interceptor injects identity and permissions, the Worker-Server model rebuilds state after failure, the Temporal Web UI shows history, and a Payload Encoder encrypts that history. Egger said no LLM calls were redone and no previous Activities were re-executed after a worker failure. He cited integrations with OpenAI, Pydantic AI, LangChain and an agentic harness.

What still has to happen is delegation. The workshop runs in a pre-provisioned shared Keycard organization and sandbox with admin access and checkpoints for each lesson, fronted by an Expense MCP server and a custom LangChain Expense Desk app tied to the Ledger database. Outside the demo, Microsoft Entra now creates agent identity from a blueprint that holds credentials and mints identities per tenant, which frames why vendors are shifting to runtime exchange over long-lived keys. The next checkpoint is human user identity and delegation.

Mentioned in this story

Markets

MicrosoftNASDAQ:MSFT

Sources

Get the free daily brief every morning

Every morning the day's AI news, new AI startups and new funding rounds. Free and takes a few minutes to read, unsubscribe at any time.

Join 64,000 other subscribers.

TopicsKeycardTemporalToken ExchangeOAuth 2KeycloakLedger APILangChain

StartupHub.ai Staff

Written by

StartupHub.ai Staff

Editorial team

The staff writers of StartupHub.ai, ranging from investment analysts to avid AI tool users, early adopters and critical enthusiasts. Backgrounds span engineering, business and the arts. We hold every piece to rigorous standards of research and review.

Daniel Singer

Written by

Daniel Singer

Editor, reviewed this article

Daniel Singer is an AI expert who has been writing about, covering and building AI technology since 2018.

Test your Agent Readiness now

Paste your website. How well ChatGPT, Claude and the other agents can read and use a site, in about a minute.

Watch

The videos behind the news, one flip at a time

The feed mixes the videos from our articles with startup demos and you flip through them like TV channels for free with no signup.