Skip to main content
Use an Agent-owned binding when everyone who can use a custom agent should run it with the same API key, including people outside the agent’s home team. The secret stays in its personal or team Vault. Sharing the agent lets people use the secret through the agent without giving them direct access to that Vault.

Before you start

Create, bind, and use the secret

1

Create a secret in Vault

Open your Vault. Under Secrets, click Add, enter a name and the API key, and add the API host under Allowed domains. Click Create.If you already have a personal or team secret you can access, skip this step. See Create a secret for details on allowed domains.
2

Choose who can use the secret

Open the custom agent. In the right sidebar, select the Agent tab, then open Secrets under What I know.
The Agent tab and Secrets row highlighted in the custom agent's right sidebar
Click Add secret. In Who can use this secret?, select Agent-owned and click Continue.
Agent-owned selected in the secret scope dialog
3

Name and add the binding

In Name, enter the environment-variable name the agent should use, such as SUPPORT_API_KEY. Under Source, choose Existing secret, select the Vault secret, and click Add.
Add secret to agent dialog with SUPPORT_API_KEY as the name and Support API Key selected as the secret
4

Use the secret in an API request

In the agent’s chat, ask it to make an API request and name the variable. For example: “List open tickets from the support API. Use SUPPORT_API_KEY to authenticate.”Sandbox code reads the environment variable. For a new Vault secret, the code gets a stand-in instead of the real API key. Gumloop swaps in the real key when the code sends the stand-in in a supported authentication header to an allowed domain. Don’t ask the agent to print the key or save it to a file.
If multiple bindings use the same environment-variable name, Agent-owned takes precedence over Personal, which takes precedence over Team. See Which secret does the agent use?.