Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
docs(cli): clarify av env variables (#8761)
Adrian Kahali4c885072ddc3
diff --git a/docs/cli/reference.mdx b/docs/cli/reference.mdxindex 73f85ce612..32c8d99529 100644--- a/docs/cli/reference.mdx+++ b/docs/cli/reference.mdx@@ -108,27 +108,40 @@ You set the proxy's traffic policy, exceptions, and poll interval in Infisical,{ name: "--keep-session", type: "bool", description: "Leave a session created with `--access-bundle` active when the agent exits, instead of revoking it. Can't be combined with `--session-token`." },{ name: "--no-ca-trust", type: "bool", description: "Skip writing the certificate authority, setting the trust variables, and adding it to the macOS keychain, for a machine that already trusts this proxy. `--ca-fingerprint` is still checked." },{ name: "--no-proxy", value: "<string>", type: "string", description: "More hosts for the agent to reach directly instead of through the proxy, separated by commas. Always merged with `localhost,127.0.0.1` and any `NO_PROXY` in your environment." },- { name: "--proxy", value: "<string>", type: "string", required: true, description: "The Agent Vault proxy's address as `host:port`, such as `10.0.1.5:17323`. A leading `http://` or `https://` is dropped. Can also be set with `INFISICAL_AGENT_VAULT_PROXY_ADDRESS`." },+ { name: "--proxy", value: "<string>", type: "string", description: "The Agent Vault proxy's address as `host:port`, such as `10.0.1.5:17323`. A leading `http://` or `https://` is dropped. Required unless `INFISICAL_AGENT_VAULT_PROXY_ADDRESS` is set." },{ name: "--session-token", value: "<string>", type: "string", description: "A session token created in Infisical. The command never revokes this session. Can't be combined with `--access-bundle`. Can also be set with `INFISICAL_AGENT_VAULT_SESSION_TOKEN`, which keeps it off the command line." },{ name: "--ttl", value: "<string>", type: "string", default: "never", description: "How long a session created with `--access-bundle` lasts: one number and one unit, such as `30m`, `8h`, or `7d` (not `2h30m`), or `never`. Defaults to `never` because the session is revoked when the agent exits, so an expiry only governs one that outlives the command. Can't be combined with `--session-token`." },]}+ env={[+ { name: "INFISICAL_AGENT_VAULT_ACCESS_BUNDLE", description: "The access bundle to create a session with, by name. Used if neither `--access-bundle` nor `--session-token` is passed." },+ { name: "INFISICAL_AGENT_VAULT_PROXY_ADDRESS", description: "The Agent Vault proxy's address as `host:port`. Used if `--proxy` isn't passed." },+ { name: "INFISICAL_AGENT_VAULT_SESSION_TOKEN", description: "A session token created in Infisical, which keeps the token off the command line. Used if neither `--session-token` nor `--access-bundle` is passed." },+ { name: "INFISICAL_UNIVERSAL_AUTH_CLIENT_ID", description: "The client ID of the machine identity that creates the session. Used if `--client-id` isn't passed." },+ { name: "INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET", description: "The client secret of the machine identity that creates the session. Used if `--client-secret` isn't passed." },+ ]}examples={[{ title: "Run an agent with a session token", code: "infisical agent-vault run --session-token=<session-token> --proxy=10.0.1.5:17323 -- claude" },{ title: "Create a session from an access bundle", code: "infisical agent-vault run --access-bundle=code-review --ttl=8h --proxy=10.0.1.5:17323 -- claude" },{ title: "Pin the proxy's certificate authority", code: "infisical agent-vault run --session-token=<session-token> --proxy=10.0.1.5:17323 --ca-fingerprint=SHA256:9F:2C:... -- claude" },{ title: "Create the session as a machine identity", code: "infisical agent-vault run \\\n --access-bundle=code-review \\\n --client-id=<client-id> \\\n --client-secret=<client-secret> \\\n --proxy=10.0.1.5:17323 \\\n -- claude" },+ { title: "Read the settings from environment variables", code: "export INFISICAL_AGENT_VAULT_PROXY_ADDRESS=10.0.1.5:17323\nexport INFISICAL_AGENT_VAULT_SESSION_TOKEN=<session-token>\ninfisical agent-vault run -- claude" },]}>-Launch an agent with its HTTP traffic routed through an Agent Vault proxy. The agent needs a [session](/documentation/platform/agent-vault/sessions), and you pass exactly one of `--session-token` or `--access-bundle`.+Launch an agent with its HTTP traffic routed through an Agent Vault proxy.++The agent needs a [session](/documentation/platform/agent-vault/sessions). You can provide one in either of the following ways:-With `--session-token`, the agent uses a session created in Infisical, and no login is needed. With `--access-bundle`, the command creates a session with that [access bundle](/documentation/platform/agent-vault/access-bundles). The command authenticates with `--client-id` and `--client-secret`, then `INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN` or `INFISICAL_TOKEN`, then your login.+- Pass `--session-token` (or set [`INFISICAL_AGENT_VAULT_SESSION_TOKEN`](#agent-vault-run--env-infisical-agent-vault-session-token)), to use an existing session that already exists in Infisical+- Pass `--access-bundle` (or set [`INFISICAL_AGENT_VAULT_ACCESS_BUNDLE`](#agent-vault-run--env-infisical-agent-vault-access-bundle)), to create a session with that [access bundle](/documentation/platform/agent-vault/access-bundles)-Either way can come from an environment variable instead of its flag. A flag takes precedence over a variable, including over the other kind's variable. If both variables are set and neither flag is passed, the run stops and asks which you meant.+<Note>+The CLI gives flags precedence over environment variables. If you pass either a session token or access bundle as a flag, the CLI will ignore any session token or access bundle that you've set as an environment variable.+</Note>-The command starts the agent with `HTTP_PROXY` and `HTTPS_PROXY` set to the proxy's address, and sets the variables that make the agent's HTTP clients trust the proxy's certificate. [Certificate trust](/documentation/platform/agent-vault/proxies#certificate-trust) lists those variables and explains the macOS keychain prompt.+The command also needs the proxy's address. You can provide it either by passing `--proxy` or by setting [`INFISICAL_AGENT_VAULT_PROXY_ADDRESS`](#agent-vault-run--env-infisical-agent-vault-proxy-address).-The agent inherits the rest of your environment, apart from `INFISICAL_AGENT_VAULT_SESSION_TOKEN` when it holds a session other than this run's, and the command exits with the agent's exit code. Unlike [infisical sm agent-proxy run](/cli/reference#sm-agent-proxy-run), this command doesn't sandbox the agent.+The command starts the agent with `HTTP_PROXY` and `HTTPS_PROXY` set to the proxy's address, and sets the [variables that make the agent's HTTP clients trust the proxy's certificate](/documentation/platform/agent-vault/proxies#certificate-trust). The agent inherits the rest of your environment, and the command exits with the agent's exit code.</CLICommand>diff --git a/docs/style.css b/docs/style.cssindex 386e21dc9e..9c62f3587d 100644--- a/docs/style.css+++ b/docs/style.css@@ -2585,6 +2585,32 @@ a.ifx-card__title:hover .ifx-card__chevron {margin-top: 0.875rem;}+/* The CLI page sits outside Mintlify's prose styles, so lists keep the reset that hides their markers. */+.cli-cmd__description ul,+.cli-cmd__description ol {+ margin: 0.875rem 0 0;+ padding-left: 1.25rem;+}++.cli-cmd__description ul {+ list-style: disc;+}++.cli-cmd__description ol {+ list-style: decimal;+}++.cli-cmd__description li + li {+ margin-top: 0.25rem;+}++.cli-cmd__description ul + [data-as="p"],+.cli-cmd__description ul + p,+.cli-cmd__description ol + [data-as="p"],+.cli-cmd__description ol + p {+ margin-top: 0.875rem;+}+.cli-cmd__table {margin-top: 2rem;scroll-margin-top: calc(var(--cli-top) + var(--cli-head) + 1rem);