docs/cli/commands/agent-proxy.mdx
# Example
infisical secrets agent-proxy start --port 17322
```
# Example
infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<project-id> --env=prod --path=/ai-agents -- claude
```
Run the Infisical Agent Proxy: start launches the proxy that brokers real credentials onto agent traffic on the wire, and connect launches an agent behind it with the proxy routing, CA trust, and dummy placeholder credentials already set up.
Both subcommands authenticate with a machine identity via Universal Auth. Use separate identities for the proxy and for each agent; see the Quickstart for the recommended permissions.
Agents reach HTTPS services through standard CONNECT tunnels and plain-HTTP services through regular forward-proxy requests; credentials are brokered on both. Requests for https:// URLs sent as plain forward-proxy requests (rather than CONNECT) are rejected so the proxy can never be used to downgrade TLS.
$ infisical secrets agent-proxy start
# Example
$ infisical secrets agent-proxy start --port 17322 --unmatched-host=block
```bash
# Example
export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<agent-proxy-client-id>
export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<agent-proxy-client-secret>
```
```bash
# Example
export INFISICAL_DOMAIN=https://eu.infisical.com
```
```bash
# Example
infisical secrets agent-proxy start --port 18000
```
Default value: `17322`
```bash
# Example
infisical secrets agent-proxy start --unmatched-host=block
```
Default value: `allow`
<Note>
`block` blocks every host without a matching proxied service, including your Infisical instance itself. Since agent traffic routes through the proxy, Infisical CLI commands run from inside the agent (using the `INFISICAL_TOKEN` from its environment) will also be rejected in this mode.
</Note>
```bash
# Example
infisical secrets agent-proxy start --poll-interval 30
```
Default value: `60`
```bash
# Example
infisical secrets agent-proxy start --client-id=<client-id> --client-secret=<client-secret>
```
HTTPS_PROXY / HTTP_PROXY pointing at the agent proxy, plus NO_PROXY (always includes localhost,127.0.0.1, merged with any NO_PROXY already in your environment and the --no-proxy flag).~/.infisical/agent-proxy/mitm-ca.pem and trusted via SSL_CERT_FILE, NODE_EXTRA_CA_CERTS, REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE, GIT_SSL_CAINFO, and DENO_CERT.infisical run). This is opt-in; an agent identity scoped to just the proxy permission has no read access, and brokered credentials never appear in the agent's environment. If the agent can read a secret that a proxied service brokers to it, connect refuses to start, since the agent would receive the real value directly and bypass the proxy; fix the permissions or pass --allow-readable-brokered-secrets to override.INFISICAL_TOKEN set to the agent's access token, so the agent can run Infisical CLI commands itself.The client ID and client secret used to authenticate are stripped from the child environment. The wrapper forwards signals to the agent process and exits with its exit code.
$ infisical secrets agent-proxy connect --proxy=<host>:<port> --projectId=<project-id> --env=<env-slug> -- [agent start command]
# Example
$ infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<project-id> --env=prod --path=/ai-agents -- claude
```bash
# Example
export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<agent-client-id>
export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<agent-client-secret>
```
```bash
# Example
export INFISICAL_PROJECT_ID=<project-id>
```
```bash
# Example
export INFISICAL_DOMAIN=https://eu.infisical.com
```
```bash
# Example
infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --env=prod -- claude
```
```bash
# Example
infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --env=staging -- codex
```
```bash
# Example
infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --env=prod --path=/ai-agents -- claude
```
Default value: `/`
```bash
# Example
infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --env=prod --no-proxy=internal.corp.com -- claude
```
```bash
# Example
infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --env=prod --projectId=<project-id> -- claude
```
```bash
# Example
infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --env=prod --client-id=<client-id> --client-secret=<client-secret> -- claude
```
```bash
# Example
infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --env=prod --token=<access-token> -- claude
```
```bash
# Example
infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --env=prod --allow-readable-brokered-secrets -- claude
```
Default value: `false`
```bash
# Example
infisical secrets agent-proxy start --domain=https://your-instance.com
```
Default value: `https://app.infisical.com`