Skip to main content
Creating a relay gives it an address. Grants decide which callers may use it. Access is deny-by-default: a virtual key reaches a relay only through an explicit grant for that relay, exactly like its agent and MCP grants. Relay access is separate from provider access, MCP tool access and agent access. A key that may call tavily gains nothing on /v1/chat/completions and the other way round.

Grant a virtual key access

  1. Open Virtual Keys and add or edit a key.
  2. Find Relay access.
  3. Select each relay to grant from the picker; a granted relay appears as a row you can remove again.
  4. Save the key.
Send the key on every relay request:
Any header that carries a virtual key on the inference endpoints (x-bf-vk, Authorization: Bearer sk-bf-..., x-api-key, …) carries it here too. Whatever the caller sends in those headers is consumed by Bifrost and never forwarded; the relay signs in with its own credential. A key without a grant is refused before any upstream effect:
The relay path uses the same authentication middleware as inference. With client.enforce_auth_on_inference on, a request must present a credential the deployment accepts (a virtual key, an API key or a user token) or it is refused; grants then restrict what the identified caller may reach. The setting defaults to on for new deployments, while an existing deployment keeps its stored value when the key is omitted, so check it: with enforcement off, a request carrying no credential is relayed without any grant check.

What governance evaluates

A relay call is governed the way an MCP tool execution is: the caller’s identity is resolved, then every budget and rate limit the caller’s holders carry is checked, before the upstream is contacted. After the call, every reply the relay forwarded counts one request against the request rate limits, whether or not the route is billable, exactly as every MCP tool execution does: a limit on calls bounds calls. Only a counted call (billable route, 2xx reply) carries a cost, which is charged to the budgets. A call that never got a reply (the upstream could not be reached) counts nothing. A stream the caller abandoned still reports what was forwarded, so hanging up does not avoid the charge. The budget and rate-limit ids a call was charged against are recorded on its Relay Logs row.

Enterprise: access profiles and projects

On Bifrost Enterprise, relay_grants are also available on access profiles and projects, as grant rows only, like their agent grants. A request is allowed when its permits allow it under the same composition rules as agents and MCP tools; a refusal names the profile or project that denied it, for example Relay 'tavily' is not allowed for access profile 'contractors'. The Relays page itself is gated on the Relays RBAC resource: a user with Relays:View can view relays, and one with Relays:Create, Update or Delete can manage them. Relay Logs are read under the separate RelayLogs resource, which has its own data access control scope. On upgrade, the default roles receive their Relays and RelayLogs permissions as for the Agent Gateway resources; a custom role gets nothing until an admin grants it.

Next steps