← 回到 Reading
ByteByteGo 2026-09-30

How DoorDash Built a Toolbox for AI Agents

Language models lack native access to external systems such as code repositories, incident reports, and production logs, requiring software integrations referred to as tools. An AI agent is an application that leverages a language model to orchestrate multi-step tasks by selecting and executing these tools. Tool outputs are fed back to the model iteratively to guide subsequent reasoning and actions. Tools encompass both read operations and state-modifying write operations, enabling organizations like DoorDash to connect agents to internal systems, documentation, and third-party services. The Model Context Protocol (MCP) standardizes capability discovery and invocation between AI agents and external tools, but it does not address higher-level enterprise governance. Companies like DoorDash must manage access control, credential handling, and operational monitoring across disparate agent workflows. To prevent redundant and fragmented integrations across engineering teams, DoorDash identifies three core requirements: access, tool-surface curation, and operations. The Agent Gateway consolidates these responsibilities into a unified platform to govern tool interactions reliably. DoorDash's Agent Gateway architecture controls agent access by routing Model Context Protocol (MCP) requests to downstream MCP servers. The gateway relies on two core architectural components: a proxy within the data plane and a registry within the control plane. The proxy handles live traffic by verifying callers, enforcing permissions and rate limits, injecting credentials, and logging audit information. The registry acts as the source of truth, storing metadata, tool catalogs, policies, and connection settings managed by engineering teams. To maintain distinct trust boundaries, DoorDash segments internal and external-facing proxy planes while sharing unified governance concepts and libraries.

閱讀原文 ↗
目錄 11 段
  1. 01Why an AI Agent Needs Tools
  2. 02Why MCP Is Not Enough
  3. 03The Core Components of the Agent Gateway
  4. 04Verifying Who is Calling and What They Can Do
  5. 05Why Identifying the Caller is Different from Supplying Credentials
  6. 06How a User Connects an Account During a Tool Call
  7. 07Why Agents Should See a Selected Tool Catalog
  8. 08What Happens During Discovery and Execution
  9. 09Understanding What Happened After a Request
  10. 10Making the Platform Easy for Teams to Adopt
  11. 11What DoorDash Plans to Improve Next

Why an AI Agent Needs Tools

Language models lack native access to external systems such as code repositories, incident reports, and production logs, requiring software integrations referred to as tools. An AI agent is an application that leverages a language model to orchestrate multi-step tasks by selecting and executing these tools. Tool outputs are fed back to the model iteratively to guide subsequent reasoning and actions. Tools encompass both read operations and state-modifying write operations, enabling organizations like DoorDash to connect agents to internal systems, documentation, and third-party services.

  • Language models do not inherently have access to external systems such as code repositories, incident reports, or production logs.
  • An AI agent is defined as an application that uses a language model to choose which tools and steps to execute for a task.
  • The host application executes the tool chosen by the model and returns the output for subsequent reasoning.
  • Tools can perform read-only actions, like searching documentation, or write actions that modify external systems, such as opening a pull request.
  • DoorDash sources agent capabilities across internal services, engineering systems, documentation platforms, and third-party software.

Why MCP Is Not Enough

The Model Context Protocol (MCP) standardizes capability discovery and invocation between AI agents and external tools, but it does not address higher-level enterprise governance. Companies like DoorDash must manage access control, credential handling, and operational monitoring across disparate agent workflows. To prevent redundant and fragmented integrations across engineering teams, DoorDash identifies three core requirements: access, tool-surface curation, and operations. The Agent Gateway consolidates these responsibilities into a unified platform to govern tool interactions reliably.

  • The Model Context Protocol (MCP) provides a common interface for discovering capabilities via tools/list and invoking them via tools/call.
  • MCP does not enforce enterprise-specific rules such as identity, credential management, access permissions, or operational monitoring.
  • Decentralized tool integrations lead to duplicated effort across engineering teams for secret handling, OAuth flows, and usage logging.
  • DoorDash organizes agent tool governance into three distinct concerns: Access, Tool-surface Curation, and Operations.
  • The Agent Gateway centralizes access control, tool filtering, and production operations into a shared enterprise platform.

The Core Components of the Agent Gateway

DoorDash's Agent Gateway architecture controls agent access by routing Model Context Protocol (MCP) requests to downstream MCP servers. The gateway relies on two core architectural components: a proxy within the data plane and a registry within the control plane. The proxy handles live traffic by verifying callers, enforcing permissions and rate limits, injecting credentials, and logging audit information. The registry acts as the source of truth, storing metadata, tool catalogs, policies, and connection settings managed by engineering teams. To maintain distinct trust boundaries, DoorDash segments internal and external-facing proxy planes while sharing unified governance concepts and libraries.

  • The Agent Gateway acts as an intermediary that controls access and routes MCP requests from agents to downstream MCP servers.
  • The gateway consists of two primary components: a proxy (data plane) and a registry (control plane).
  • The proxy handles live traffic tasks, including caller verification, permission checking, rate limiting, credential attachment, and audit logging.
  • The registry functions as the source of truth, holding configurations, agent and MCP server details, tool catalogs, and access policies.
  • DoorDash divides internal workflows and external use cases into distinct proxy planes to preserve separate trust boundaries while retaining shared governance concepts.

Verifying Who is Calling and What They Can Do

DoorDash's engineering team built an Agent Gateway that relies on authentication and authorization to control agent interactions. Authentication establishes caller identity, while authorization evaluates fine-grained context including the user, agent, requested tool, and environment. The system distinguishes between read-only and administrative capabilities rather than granting blanket server access. By propagating identity downstream and centralizing security policies, the gateway eliminates the need to encode authorization rules into prompts or individual tools.

  • Authentication identifies whether a caller is a user, a service, or an agent acting on a user's behalf.
  • Authorization in the gateway provides granular control rather than coarse access to an entire MCP server.
  • DoorDash's Agent Gateway considers multiple contexts, including agent, user, tool, environment, and read-versus-write capabilities.
  • Caller identity is preserved throughout request routing and usage recording to enable downstream attribution.
  • Centralizing access control prevents developers from encoding security checks in prompts or duplicating authorization logic across tools.

Why Identifying the Caller is Different from Supplying Credentials

In DoorDash's agent gateway architecture, caller identification is decoupled from the credentials required by downstream services. Rather than allowing agents to hold raw API keys or tokens, the gateway implements credential injection, attaching appropriate credentials before requests are forwarded. The architecture supports four credential models: Internal Service Identity, Gateway-held Token, Per-user OAuth, and Service Principal. This approach centralizes secret storage, credential rotation, auditing, and revocation outside of the AI agents.

  • Caller identity entering an agent gateway is functionally distinct from the downstream credentials needed by external systems.
  • Credential injection is the process where the gateway attaches necessary secrets to outgoing requests without exposing them to agents.
  • Internal Service Identity passes DoorDash-verified caller context directly to internal microservices.
  • Gateway-held Tokens store vendor and service keys in gateway secret storage and prevent agents from seeing raw secrets.
  • Per-user OAuth enables the gateway to securely store, inject, and refresh user-delegated tokens for external services.
  • Service Principals provide software and team automations with short-lived credentials via gateway-managed identities.
  • Centralizing credentials in the gateway provides a single location to manage, rotate, audit, and revoke access keys.

How a User Connects an Account During a Tool Call

Tools acting on behalf of a specific user require authorization, typically handled via OAuth access and refresh tokens. DoorDash's agent gateway centralizes user connection flows and encrypted token storage across product teams. When authorization is missing, the gateway initiates an OAuth flow, optionally utilizing MCP elicitation to pause requests while the user authorizes via a browser prompt. For clients lacking elicitation support, the gateway provides a structured response with a connection URL for recovery.

  • OAuth provides access tokens for authorized API calls and refresh tokens to replace expired ones.
  • DoorDash's agent gateway centralizes connection flows and encrypted token storage, replacing separate implementations across product teams.
  • For clients supporting MCP elicitation, the gateway pauses the tool request, prompts user authorization in a browser, securely stores the token, and resumes the call.
  • Agents do not receive the raw user credentials during or after the OAuth elicitation process.
  • Clients without MCP elicitation support receive a structured error response with an authorization connection URL.

Why Agents Should See a Selected Tool Catalog

Presenting an agent with an entire server catalog introduces unnecessary choices and complex descriptions that degrade performance. To address this, DoorDash engineering exposes smaller, task-specific catalogs using bundles and filters. Bundles combine tools across multiple Model Context Protocol (MCP) servers into a single endpoint, while filters selectively expose approved capabilities based on agent or environment criteria. Gateways can also improve usability by standardizing descriptions and namespacing overlapping tool names.

  • Presenting an overly broad tool surface creates unnecessary choices that force models to interpret more descriptions and distinguish between similar tools.
  • DoorDash engineering exposes smaller, relevant tool catalogs tailored specifically to the work being performed.
  • A bundle combines tools across multiple MCP servers into a single logical MCP endpoint address.
  • Filters control which tools appear in an interface based on the bundle, agent, user group, environment, or audience.
  • Agent gateways can apply namespacing and aliases to resolve overlapping names across multiple tool servers.

What Happens During Discovery and Execution

Tool discovery and tool execution occur at distinct stages and necessitate independent validation and policy checks. During discovery, an agent issues a tools/list request to a gateway, which uses fan-out across downstream servers to assemble, filter, and return an aggregated catalog. At execution time, the agent issues a tools/call request, prompting the gateway to re-evaluate policy, enforce rate limits, inject credentials, and route to the correct server. This architecture relieves agents from having to manage downstream server routing or provider-specific credentials.

  • Discovery controls which tools are presented in the catalog, whereas invocation controls whether an execution is permitted.
  • A tool appearing in a discovery response still requires independent authorization at execution time.
  • During discovery, the gateway utilizes fan-out to query multiple downstream servers and unify their tools into one catalog.
  • During execution (tools/call), the gateway manages authorization, rate limits, server routing, and credential injection.
  • The agent interacts exclusively with the gateway, removing the need for client-side routing or credential management.

Understanding What Happened After a Request

Observability enables teams to monitor and understand systems where multiple agents interact with various tools. Positioned in the path of all tool calls, the gateway captures structured events containing metadata such as identity, timing, errors, and payload sizes. It also aggregates metrics on request counts, latencies, authorization decisions, and downstream failures. This telemetry allows platform, security, and tool teams to audit access, diagnose issues, and analyze adoption.

  • Observability refers to the ability to understand a running system through the information it produces.
  • Because all tool requests pass through the gateway, it acts as a central recording component for telemetry.
  • The gateway records structured events that capture consistent metadata, including server, tool, bundle, owner, identities, status, and timing.
  • Metrics produced by the gateway aggregate behavior across requests, including request counts, tool response times, OAuth refresh outcomes, and rate-limit decisions.
  • Observability data serves distinct enterprise roles: security teams audit access, platform teams investigate agent behavior, and tool owners track adoption and failures.

Making the Platform Easy for Teams to Adopt

DoorDash enables broad internal adoption of its centralized agent gateway by providing a self-service management interface and API. Teams register Model Context Protocol (MCP) servers, allowing the platform to discover capabilities via tools/list before teams configure approval, ownership, authentication, and access policies. Bundled tools are continuously monitored for latency, failure rates, authorization decisions, and costs. The gateway now acts as the default access route for DoorDash engineering, managing over 200 MCP servers and millions of weekly tool calls.

  • DoorDash offers a self-service UI and API for registering and configuring MCP servers on its centralized gateway.
  • The platform discovers raw tool catalogs via tools/list, requiring explicit approval and access policy configuration before tools can be used.
  • Capabilities are bound to ownership metadata and grouped into bundles to enable operational accountability and policy enforcement.
  • Teams can monitor tool traffic, response times, execution failures, authorization decisions, and cost metrics once agents start using bundles.
  • The gateway hosts more than 200 registered MCP servers and handles millions of weekly tool calls across DoorDash.

What DoorDash Plans to Improve Next

DoorDash is planning future improvements to its centralized AI agent-tool gateway architecture. Key planned areas include stronger agent identity and user delegation using cryptographic identities and short-lived scoped credentials. The company is also developing dynamic tool discovery based on tasks, access policies, and usage signals to offer context-relevant capabilities. Additional enhancements target tool quality and security evaluation, such as detecting sensitive data, simplifying server registration, and streaming redacted tool-call events.

  • DoorDash plans to implement agent identity and user delegation using cryptographic identities and short-lived credentials scoped to user, agent, task, and target tool.
  • Dynamic tool discovery will refine tool selection dynamically based on current task, access policy, and usage signals.
  • DoorDash intends to improve tool evaluation to detect risky descriptions and sensitive information like secrets or PII in errors.
  • The platform aims to simplify tool server creation and registration while providing redacted tool-call event streams.