LiteLLM as an A2A agent gateway

Register A2A and cloud-hosted agents behind one self-hosted LiteLLM gateway, then control which teams and keys can invoke them and track each call's logs and budget.

On this page

What LiteLLM as an A2A agent gateway does for your agents

LiteLLM can invoke A2A agents and several managed agent platforms through one gateway, so callers reach agents built on different stacks without each team wiring its own connection, credentials and logging. Agents often grow in separate teams and cloud accounts: one group runs a LangGraph workflow, another deploys to Vertex AI Agent Engine, a third uses Azure AI Foundry or Bedrock AgentCore, and each has its own endpoint, key and audit trail. Without a shared layer, no one can answer which team called which agent, how much each call cost, or who can still invoke an agent that was meant to be retired.

The supported agent types are A2A agents, Vertex AI Agent Engine, LangGraph, Azure AI Foundry, Bedrock AgentCore and Pydantic AI agents. You need this gateway when two or more of these types are in use, when agent calls must be logged and budgeted like model calls, or when several teams need to share the same agent under different permissions. If every agent is one team's internal tool on one platform, the gateway may add more operational work than it removes. Ask each team which agent types it runs now and which it plans to add over the next year before deciding the gateway's scope.

The gateway is one part of a wider MCP and agent governance setup. It does not decide on its own which people should be allowed to use an agent, how the agent itself is secured, or what data it may read. Those decisions sit with identity, the agent owner and your security team, and the gateway enforces them only after they are written down. Confirm with the LiteLLM A2A documentation which features your chosen agent types support in your LiteLLM version before you commit to a design.

Which agent types LiteLLM can invoke

LiteLLM invokes agents through the A2A protocol and also supports several vendor agent platforms. Each agent type needs its own registration details, credentials and network path, so the choice of agent type shapes the setup work. The cards below describe each type and what your team should have ready on the agent side before registering it.

A2A protocol agents

The A2A protocol is the common interface LiteLLM uses to call agents. Any agent that speaks A2A can be registered as a gateway target, so this is the path for agents you host yourself. Before registering one, confirm the agent card URL, the supported transport, and whether the agent expects bearer tokens or another header scheme. Test a single invocation through the gateway with a non-production key before you grant team access.

LiteLLM A2A docs

Vertex AI Agent Engine agents

Agents deployed to Vertex AI Agent Engine run in Google Cloud and are reached through that platform's endpoints. LiteLLM needs a path to the deployed agent and credentials that the gateway can use to call it. Confirm which Google Cloud service account the gateway will use, where that account's keys are stored, and whether the agent endpoint is reachable from the gateway's network. Keep the gateway's cloud identity scoped to this one agent.

LangGraph agents

LangGraph agents are graphs of steps that you build and host, so their behavior and authentication depend on your own deployment. Before registration, decide how the LangGraph server authenticates callers, which endpoint exposes the agent, and whether the graph's tools need their own credentials. Confirm with your LangGraph deployment that it can be reached through the A2A path and that streaming responses pass through the gateway as expected.

Azure AI Foundry agents

Agents in Azure AI Foundry are invoked through Azure endpoints and tied to an Azure identity model. The gateway needs the endpoint for the agent and an authentication method that Azure accepts from your network. Confirm whether your tenant requires Microsoft Entra ID tokens, managed identity or API keys for the agent, and who in your organization owns the Foundry resource that LiteLLM will call.

Bedrock AgentCore agents

Agents hosted on Amazon Bedrock AgentCore are called through AWS endpoints and signed with AWS credentials. The gateway's IAM role or credentials must allow invocation of the specific agent runtime, and that role should be separated from the role used for model calls. Confirm the required IAM actions, the region of the agent runtime, and how your team rotates the credentials stored in the gateway.

Pydantic AI agents

Pydantic AI agents are Python agents that you expose over HTTP, so their security depends on the service you wrap around them. Decide which endpoint LiteLLM calls, how the service validates the gateway's credentials, and how it limits iterations and tool use. Confirm that the agent's iteration budget and streaming behavior match what your teams expect, and log which agent version answered each call.

Configuration options and when each fits

This table compares the agent registration and call settings you will decide on when putting A2A agents behind LiteLLM, including agent type, endpoint, visibility, load balancing, streaming and iteration budgets. Read each row as a decision: what it fits, and what it changes for callers and for logs. Confirm exact field names in the LiteLLM A2A documentation before you write configuration.

OptionWhen it fitsWhat it changes for callersWhat it changes for logging
Agent endpoint (A2A protocol)Agents you run yourself that speak A2A and expose their own endpointCallers invoke the agent through the LiteLLM gateway URL, not the agent's direct addressCalls are recorded at the gateway with the key and team that made them
Agent type (Vertex AI Agent Engine, LangGraph, Azure AI Foundry, Bedrock AgentCore, Pydantic AI)Agents already built on one of these platforms, so LiteLLM can call them in their native formCallers keep one invocation pattern while the gateway handles the platform-specific callLogs show the agent type, which helps separate platform-specific failures during triage
Key and team visibilityRestricting an agent to specific teams or keys, for example a finance agent limited to one teamCallers without access cannot discover or invoke the agentDenied attempts and permitted calls can be attributed to the key and team
Load balancing across agent instancesSeveral instances of the same agent serve one logical name for availability or capacityCallers see one agent name, and the gateway selects an instance per callLogs should record which instance served each call so slow or failing instances can be isolated
StreamingLong-running agent responses where callers need partial output as it is producedCallers must handle streamed responses rather than waiting for one complete replyLogging of streamed calls should be confirmed, since partial and final output may be recorded differently
Iteration budgetsAgents that loop through tools or reasoning steps, where runaway iterations would drive costCallers may receive a bounded result or an early stop when the budget is reachedLogs show how many iterations ran, which supports cost review per agent
Budgets on agent callsCharging agent use to a team or key alongside model spendCallers hit a limit when their budget is exhausted, rather than an open-ended runSpend records tie each agent call to a team, key or user for chargeback

Setting up agent registration, access and budgets

This sequence takes an A2A agent from a deployed LiteLLM gateway to a registered, permissioned and budgeted agent that teams can call through keys you control. Each step ends with a check so access and spend are proven before real workloads depend on them.

  1. Confirm the gateway and PostgreSQL database

    The platform team confirms the LiteLLM proxy is running in your infrastructure with PostgreSQL attached, since virtual keys and budgets need a PostgreSQL database. If more than one proxy instance runs, confirm Redis 7.0 or newer is available for shared state. Check that the admin API answers health requests, that LITELLM_MASTER_KEY starts with sk- and is held in a secret manager, and that the admin account is the only holder of that key. The step is done when the gateway starts cleanly and the database connection is confirmed in its logs.

  2. Register each agent with its endpoint

    The platform team adds each agent to the gateway configuration or admin interface, one entry per agent, using its A2A endpoint or the connection details for Vertex AI Agent Engine, LangGraph, Azure AI Foundry, Bedrock AgentCore or Pydantic AI. Record the owning team, the environment and the upstream credential the gateway will use, and confirm each credential is stored in your secret manager rather than in plain configuration. Confirm the exact registration fields for each agent type against the LiteLLM A2A documentation before you start. The step is done when each agent appears in the registry with a name that matches your catalog.

  3. Create teams and organize users

    The administrator creates one team per group that will call agents, such as a support automation team or a finance reporting team, and adds the people who own each team. Keep team names aligned with the cost centers your finance team uses so spend can be charged back later. Decide which teams need access to production agents and which only need staging agents, and record that decision in the change ticket. The step is done when every calling group maps to exactly one team and every team has a named owner.

  4. Issue virtual keys and grant invoke permissions

    The administrator generates a virtual key for each team or service account and restricts it to the agents that team is approved to invoke, rather than issuing one broad key. Give each key a descriptive alias, an owner and an expiry plan. Then test the permission boundary: an approved key should list and invoke its agent, and a key from another team should be refused. Confirm the refused attempt is recorded in the logs. The step is done when the allowed key succeeds and the unauthorized key is denied for the same agent.

  5. Set budgets, rate limits and model restrictions

    The administrator sets a budget on each key and team, plus TPM and RPM limits where the gateway supports them for the agent calls, using values agreed with the team owner in writing. Confirm which spend the budget counts, since agent calls can invoke underlying models and tools that carry their own costs. Document how temporary budget increases are approved and who may grant them. Confirm the limits are read from the gateway and not only from the admin screen. The step is done when a deliberately low test budget blocks further calls once reached and the block is logged.

  6. Send a test call through the gateway

    The team owner sends a test request to the registered agent using an approved virtual key, with a prompt that contains no personal or confidential data. Check that the response returns through the gateway endpoint and that the agent's upstream credentials never reach the calling application. Confirm streaming and any iteration limits behave as your configuration specifies. The step is done when the test returns the expected result and the call appears in the request log.

  7. Verify logs and cost attribution

    The platform team checks that the test call is recorded with the calling key, team, agent name, timestamp, status and cost. Compare the recorded cost with the test budget decrement, and note any difference in how the agent's underlying model or tool spend is reported. Confirm that the denied attempt from the access step is also in the log. Ask the vendor or your own environment checks which fields are retained and for how long before you rely on them for chargeback. The step is done when a reviewer can trace one successful call and one denied call from the log alone.

How teams and keys control which agents they can invoke

Access to agents in LiteLLM is governed through the same key, user and team model that controls model access, so the first decision is which teams own which keys. Virtual keys require a PostgreSQL database, and they support per-key, per-user and per-team budgets, TPM and RPM limits, temporary budget increases and restriction of a key to specific models. Those controls are documented for model calls. Whether and how they apply to A2A agent invocations is the point to confirm in your LiteLLM version before you rely on them, because an agent call is a different request type from a chat completion. Ask the vendor or check the LiteLLM docs for A2A agent gateway for the exact access settings that exist for agents, and whether an agent can be restricted by name the way a model can.

Test access before rollout with a key issued to each team, not with the admin key. For each team, invoke an agent it should be allowed to call and one it should be refused, then confirm the refusal is recorded in the logs with the team and key attached. Repeat the check for a key that has reached its budget or rate limit, since an agent call that bypasses those limits would make spend controls ineffective for agent workloads. Record the results as the acceptance evidence for the rollout, and rerun the same checks after each LiteLLM upgrade, because permission behavior can change between releases.

Plan for the case where a model restriction exists but an agent restriction does not. If the version you run cannot limit agents by key or team, the practical controls are separate keys for agent traffic, budgets set on those keys, and a rule that agents built on a sensitive data source are only reachable from a dedicated team. Treat that as a documented limitation in your design rather than assuming the model controls cover it. Your security team should sign off on the access model in writing, with the version tested and the known gaps listed.

How an agent call moves through the gateway

A call starts with a caller presenting a virtual key, which the LiteLLM proxy checks against model and agent permissions, budgets and rate limits before anything leaves the gateway. The proxy then invokes the registered agent over A2A or through a managed platform, and writes the call to logs and spend records. PostgreSQL holds keys, budgets and spend, and Redis holds shared state once more than one proxy instance runs. The boundary around external agent platforms is where your controls end and the provider's begin, so confirm what each platform logs and retains.

Caller, gateway checks, shared state and external agent platforms, with the trust boundary around the platforms.

Security and operational risks of agent gateways

A LiteLLM gateway that fronts A2A agents concentrates credentials, team permissions and prompt traffic in one place. The cards below cover the risks that tend to matter most, the control to apply to each, and what to confirm in your own environment before agents go live.

Master key handling

The master key (LITELLM_MASTER_KEY) has administrative reach over every registered agent and team, so a leaked copy exposes the whole gateway. LiteLLM's production guidance is to keep the key, which must start with sk-, in a secret manager rather than in configuration files or environment files checked into source control. Confirm who can read the secret, how rotation is performed without breaking agent registrations, and whether the secret manager integrations available in Enterprise fit your standard.

Production guide

Platform credentials for cloud agents

Each cloud agent platform the gateway calls, such as Vertex AI Agent Engine, Azure AI Foundry or Bedrock AgentCore, needs its own credentials stored in LiteLLM. These grant the gateway the ability to invoke agents in your cloud accounts, so they carry more reach than a single model key. Use a dedicated service identity per platform with the narrowest invoke permission available, store the credentials in your secret manager, and record which agents and teams can reach each one.

Over-broad team access

If a key or team can invoke every registered agent, one compromised key becomes a path to every downstream system those agents touch. Restrict each team and virtual key to the specific agents it needs, and review that mapping on a schedule. Organization and team RBAC is an Enterprise feature, so confirm whether your deployment needs it before relying on team boundaries alone. Test the restriction by calling an agent from a key that should be denied.

Enterprise features

Logs that capture sensitive content

Request and response logs for agent calls can contain customer data, internal documents and tool outputs, often with more sensitive content than a chat prompt. Decide what the gateway records, who can read the logs, and how long they are kept before the first agent goes live. Audit logs of administrative actions are an Enterprise capability, and confirm whether they meet your retention and access needs. Mask or restrict fields that should not be stored.

Shared Redis and database state

Once more than one proxy instance runs, shared rate limits, router state and cache depend on Redis, and virtual keys, budgets and spend records depend on PostgreSQL. A failure or misconfiguration in either affects every agent and team at once. PostgreSQL is the primary supported database, and Redis 7.0 or newer is required for multiple instances. Plan high availability, backups and restore tests for both, and confirm how budget enforcement behaves during a database outage.

Production guide

Questions buyers ask about A2A agent gateway work

What makes an A2A agent gateway project take more or less effort?

The effort follows the number of agent platforms, the authentication model for each agent, how many teams need different access, and how many logging targets must receive agent call data. A gateway that registers one A2A agent with one team and one log sink is a small job. A gateway that registers agents from several platforms, such as Vertex AI Agent Engine, LangGraph, Azure AI Foundry and Bedrock AgentCore, with separate permissions per team and budgets per key, takes considerably more design and testing. Each platform adds its own credentials, invocation pattern and failure modes to verify. Ask any partner to list each agent platform, auth model, team and log target in the scope before quoting.

What does our team need to provide before the work starts?

You need access to the cloud accounts where the agents run, with rights to create or read the credentials the gateway will use. You also need named owners for each agent who can confirm its purpose, expected callers and acceptable data handling. Your identity provider team must be ready to supply client registrations or group mappings if admin access or team-based access control depends on SSO. Finally, identify the logging and SIEM destinations that agent call records should reach. Missing any of these usually delays the design phase more than the build itself.

Can our own platform team deliver this without outside help?

Yes, if your team already runs LiteLLM or a similar gateway, has experience with the target agent platforms and can own the design decisions about permissions, budgets and logging. The LiteLLM A2A documentation covers registration and the supported agent types, so a capable engineer can build a working prototype. The harder parts are usually the access model across teams, verifying that keys cannot reach agents they should not call, and keeping the configuration maintained after the first release. Many teams split the work: they build the gateway themselves and bring in a partner for security review or a fixed-scope hardening pass.

What does a fixed-scope quote for this work depend on?

A fixed-scope quote follows from a written scope that lists the agent platforms to register, the authentication method for each, the teams and keys that need access, the budget and logging requirements, and the environments to deliver into. It also depends on whether SSO, secret manager integration or guardrails are included. DeployOpen does not publish a price list, so the quote comes from that scope. Ask for deliverables, acceptance tests, the assumptions behind each item and what is excluded, so you can compare offers on the same basis.

Which parts of the work recur after the gateway goes live?

Setup is a one-time cost, but several parts recur. Agents change their endpoints, credentials rotate, teams add new callers, and budgets need review as usage grows. LiteLLM itself also releases new versions, and the project supports four recent stable minor versions, so the gateway must be upgraded on a schedule. If you want continued help, DeployOpen offers ongoing support, upgrades and continuous testing as retainers. Ask a partner to separate the one-time build from any retainer so you can see the recurring commitment.

What security checks should we ask for before agents are exposed to callers?

Ask for a review of which keys and teams can invoke each agent, whether agent credentials are stored in a secret manager, and whether admin access to the gateway is restricted. Confirm that logs capture agent calls with enough detail for investigation, and that retention meets your policy. DeployOpen can test agent gateway setups, including tool and permission settings, credential handling and SSO and admin configuration, and deliver a findings report with fixes and a retest. Confirm with your security team which of these checks they need before go-live.

Does DeployOpen certify that the gateway meets our compliance requirements?

No. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports, attestations or certifications. Independent auditors and certification bodies perform those assessments. For an A2A gateway, the work typically includes documenting who can call which agents, how calls are logged and how credentials are protected, so your assessor has evidence to review. Confirm early with your compliance lead which frameworks apply and what evidence they expect.

What costs are one-time and what recurs for agent calls

The recurring costs of routing agent calls through LiteLLM sit in four places: the gateway infrastructure, the PostgreSQL and Redis tier behind it, the agent platforms' own charges that LiteLLM passes through, and the license edition you choose for SSO and RBAC. Setup work such as registering agents, defining team and key access, and wiring logging is largely one-time, but the platform bills keep arriving every month for as long as agents are invoked. Ask the partner to separate these lines in the quote so you can see which ones scale with usage and which stay flat.

Infrastructure and data stores are the clearest recurring items. LiteLLM's production guide names PostgreSQL as the primary supported database and requires Redis 7.0 or newer once more than one proxy instance runs, because shared rate limits, router state and cache depend on it. Your cost rises with the number of proxy workers, the volume of agent requests that generate spend records, and the retention period you set for logs. Confirm the proxy replica count, database sizing and log storage assumptions with the partner, and confirm how spend updates are batched at your expected volume.

The agent platform charges (Vertex AI Agent Engine, Azure AI Foundry, Bedrock AgentCore, and any model calls a LangGraph or Pydantic AI agent makes) come from your cloud or vendor accounts and are not set by LiteLLM. They recur with every invocation and are usually the largest variable line. Edition choice is a recurring decision: the free SSO allowance covers only up to 5 users from v1.76.0, and team-level RBAC and audit logs sit in Enterprise, so an Enterprise subscription is a recurring fee to confirm with LiteLLM. Upgrades are also recurring: plan staff time for the four supported minor versions and for database migrations. Ask for a quote that lists one-time implementation, monthly infrastructure, pass-through platform estimates, the Enterprise subscription, and an annual upgrade allowance.

How DeployOpen scopes and delivers A2A agent gateway work

DeployOpen approaches LiteLLM as an A2A agent gateway as a fixed-scope implementation inside your own infrastructure. We agree which agents, teams and keys are in scope, build the registrations and access rules, test them, and hand over documentation your team can operate.

How we scope

  • Inventory every A2A, Vertex AI Agent Engine, LangGraph, Azure AI Foundry and Bedrock AgentCore agent that teams intend to call through the gateway.
  • Record which teams and virtual keys may invoke each agent, and which must be denied by default.
  • Agree in writing the logging destination, budget owners, iteration limits and the retainer option for ongoing support.

How we build

  • Register each agent in LiteLLM and confirm its invocation path, streaming behavior and load-balancing setup in a staging proxy.
  • Configure PostgreSQL-backed virtual keys and team budgets so agent calls are attributed to the right owner.
  • Test permission boundaries with allowed and denied keys, and verify that agent call logs and spend records appear as expected.

How we hand over

  • Deliver a runbook covering agent registration, key scoping, budget changes and rotation of upstream credentials.
  • Document the configuration as code and the decisions behind each access rule so reviewers can trace them.
  • Walk your platform and security teams through the setup and leave a list of items that need confirmation with each vendor.

How we support

  • Offer ongoing support, LiteLLM version upgrades and continuous testing of agent access as a retainer.
  • Retest agent permissions after LiteLLM upgrades, new agent registrations or changes to team structure.
  • Prepare evidence of agent access controls and logging for internal and external security reviews, without issuing audit opinions.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.