Secret Injector plugin
The Secret Injector plugin adds a secret to the request that the upstream receives, as a header or a query parameter. The data plane fetches the secret from a vault on every request, so secret values never appear in the plugin configuration. The plugin can also remove a header or query parameter that the client sent. Secret Injector is a Preview plugin, so the data plane must allow Preview plugins.
Where it runs
On LLM routes, a header that the connection’s own credential writes overwrites an injected header of the same name.
Set up the plugin
Add a Secret Injector instance to a connection or route in the console.
Prerequisites
- A connection or route whose upstream needs the secret.
- A data plane that allows Preview plugins.
- The secret. On a data plane that you manage, register a vault on the Vaults page in the console settings and store the secret in it. For more information, see Manage credentials and vaults. On a Postman-hosted data plane, the console shows Provider secret instead of Vault, stores the secret for you, and you only paste it.
Steps
- In the console sidebar, select Plugins, then open the All tab.
- Find secret-injector and select Use.
- In Apply to, select Connection or Route, then select the connection or route in the field that follows. A Secret Injector instance applies to one connection or route.
- In Instance name, enter a name, for example
partner-api-key. - Under Configuration, in Injection 1, set Add to to Header or Query parameter.
- In Header name or Parameter name, enter the name that the upstream expects, for example
Authorization. - In Mode, select Set to replace the client’s value, Add to add beside it, or Delete to remove the header or parameter. Delete needs no secret.
- For Set or Add, provide the secret:
- On a data plane that you manage, select a Vault, then enter the Secret reference. For a JSON secret, also enter Property.
- On a Postman-hosted data plane, paste the secret into Provider secret.
- (Optional) Expand Advanced settings, then set the following values:
- Version: The secret version to read, if your vault supports versions.
- Value template: A string that contains
{{secret}}, for exampleBearer {{secret}}. - On secret error: Fail request (default) or Skip injection.
- (Optional) Select Add injection to add another injection.
- Make sure Enabled is selected, then select Create instance.
Verify it works
Send a request to the route, then check the request that the upstream received, for example in its request log or through an echo endpoint:
The upstream’s request has the injected header or query parameter, and the response to the client doesn’t contain the secret. Prefer a header over a query parameter, because the value of a query parameter can appear in trace data.
Fix common problems
502on every request. The data plane doesn’t allow Preview plugins, the configuration is invalid, or a secret can’t be read while On secret error is Fail request (default). Ask whoever runs the data plane to setglobal.plugins.allow_preview: true. Check the Vault, the Secret reference, and Property. To let requests continue without the secret, select Skip injection, and the upstream then gets the request without the credential.- The upstream doesn’t get the value on an MCP route. Only requests that the gateway forwards as plain HTTP carry injected values. Tool calls, tool lists, and session setup that the gateway makes itself don’t.
- The upstream gets a different credential on an LLM route. A header that the connection’s own credential writes overwrites an injected header of the same name.
- The console says the value template must include
{{secret}}. Add{{secret}}to Value template, or clear the field.
Configuration
The changes to make, in order. Must not be empty.
header or query.
The header or query parameter name.
set replaces any value that the client sent. add keeps the client’s value and adds another. delete removes the header or parameter, and needs no source.
The vault that holds the secret. Required for set and add.
The reference to the secret in the vault. Required for set and add.
The field to read from a structured secret.
The secret version to read.
A template that must contain {{secret}}, for example Bearer {{secret}}.
What to do when the secret can’t be read. fail breaks the plugin. With the default fail_closed, the request ends with 502. skip leaves out this injection and applies the rest.
When you paste a secret into Provider secret, the console encrypts it in your browser, the control plane stores it in a managed vault, and the saved injection holds only a vault_id and value_ref. The console never shows the value again. Select Rotate to replace it.
An injection that contains the secret itself, in a value, secret, or secret_ref field, is rejected. An instance with an invalid configuration never runs, and every request that it applies to gets 502.

