Skip to main content
A global variable is a value that you can use in any service in an Agent Vault project, whichever access bundle the service is in. You define the variable once and give it a key, such as GITHUB_TOKEN. Then, any service can use the variable by referencing the key within double braces: {{GITHUB_TOKEN}}. When an agent sends a request, the proxy replaces each reference with the variable’s value.
Only admins of the project can view and update global variables.

Add a variable

To add a variable:
1
In your Agent Vault project, go to Variables and select the Global Variables tab.
The Global Variables tab of the Variables page, listing seven variables with hidden values and the access bundles that use each one (STATUSPAGE_API_KEY is unused), and an Add Global Variable button
2
Select Add Global Variable.
The Add Global Variable dialog with OPENAI_API_KEY as the key and a hidden value
3
Enter a Key and a Value. To view the value later, select the eye icon next to it. Each time someone views or copies a value, Infisical adds an event to the audit log.
A key can be up to 64 characters long. It must start with a letter and use only uppercase letters, numbers, and underscores. No two global variables can have the same key.
4
Select Add Global Variable. The variable appears in the list on the Global Variables tab.
Each Agent Vault project can hold up to 500 global variables.

Use a variable in a service

You can use a variable in the following fields when configuring a service: To use a variable:
1
Add a service, or open an existing service’s actions menu and select Edit. Then go to the Credential step.
2
In a field that accepts variables, type {{. A list of your variables appears.
The Credential step of a GitHub service, with {{GITH typed in the Password field and a list showing GITHUB_TOKEN and Create GITH
3
Select a variable from the list. Infisical inserts the reference, such as {{GITHUB_TOKEN}}.
You can also create a variable without leaving the service. Type its key, then select Create at the end of the list. The Add Global Variable dialog opens with the key filled in, so you only need to enter a Value.
The Credential step of a GitHub service with a GITHUB_TOKEN reference as the Password, and the Sends preview showing the reference in the Authorization: Basic header
A reference can fill a whole field or part of one. For example, if a custom header’s Value is org-{{ORG_ID}}, the proxy sends org- followed by the value of ORG_ID.

Check variable usage

To check which services are using a variable:
1
In your Agent Vault project, go to Variables.
2
In the variable’s Used By column, hover over an access bundle to see which of the access bundle’s services use the variable.
The Variables page with the pointer over the code-review badge of GITHUB_TOKEN, and a tooltip listing the github service in code-review

Update a variable

To update a variable:
1
In your Agent Vault project, go to Variables.
2
Open the variable’s actions menu and select Edit.
3
Update the key or the value. Leave Value blank to keep the current value.
4
Select Save.
If you rename a variable, the services that use it keep working without changes. If you change a variable’s value, the proxy starts using the new value within one poll interval (60 seconds by default), so you don’t need to restart running agents.

Delete a variable

To delete a variable:
1
In your Agent Vault project, go to Variables.
2
Open the variable’s actions menu and select Delete.
3
Select Delete Variable.
If any service still uses the variable, the dialog lists those services, and you can’t delete the variable until you remove the reference from each one.
The Delete GITHUB_TOKEN dialog, listing the github services in code-review and release-notes that use the variable, with Delete Variable disabled

Personal variables

A personal variable works like a global variable, with two differences: only your personal values can use it, and only you can read it. Use one when several services ask you for the same value, such as a personal GitHub token that services in two access bundles require. To see your personal variables, go to Variables in your Agent Vault project. If you’re an admin, select the Personal Variables tab.
The Personal Variables tab, listing the personal variables GITHUB_PAT and SLACK_USER_TOKEN
You add, update, and delete personal variables the same way as global variables, with these limits:
  • You can keep up to 100 personal variables in each project, and your personal variables in one project aren’t available in another
  • A personal variable’s key only has to be unique among your own personal variables (it can match a global variable’s key, or another member’s)
  • If your personal values for a service use a variable, you can’t delete the variable until you remove it from the service