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(agent-proxy): revamp security & quickstart pages, refresh screenshots (#7336)
Saif Ur Rahman00af10424ecb
diff --git a/docs/cli/commands/agent-proxy.mdx b/docs/cli/commands/agent-proxy.mdxindex e58cea8270..3d1465d024 100644--- a/docs/cli/commands/agent-proxy.mdx+++ b/docs/cli/commands/agent-proxy.mdx@@ -18,8 +18,11 @@ description: "Run the Infisical Agent Proxy and connect agents to it"```bashinfisical secrets agent-proxy connect [options] -- [agent start command]- # Example+ # Example (flags)infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<project-id> --env=prod --path=/ai-agents -- claude++ # Example (configuration from environment variables)+ infisical secrets agent-proxy connect -- claude```</Tab>@@ -157,11 +160,18 @@ $ infisical secrets agent-proxy start --port 17322 --unmatched-host=blockThe 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.+ <Note>+ Every input below resolves from the same sources, in order: **the flag → an environment variable → `.infisical.json` → the built-in default.** An explicitly-passed flag always wins. This is why, in a container or CI where the environment variables are already set, the command collapses to `infisical secrets agent-proxy connect -- claude`.+ </Note>+```bash$ infisical secrets agent-proxy connect --proxy=<host>:<port> --projectId=<project-id> --env=<env-slug> -- [agent start command]-# Example+# With flags$ infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<project-id> --env=prod --path=/ai-agents -- claude++# With configuration from environment variables (see below) or .infisical.json+$ infisical secrets agent-proxy connect -- claude```### Environment variables@@ -177,7 +187,7 @@ $ infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<</Accordion><Accordion title="INFISICAL_PROJECT_ID">- The project to fetch proxied services and secrets from. Alternative to the `--projectId` flag or running inside a directory with an `.infisical.json` file (created by `infisical init`).+ The project to fetch proxied services and secrets from. Alternative to the `--projectId` flag or the `workspaceId` field in `.infisical.json` (created by `infisical init`).```bash# Example@@ -185,6 +195,33 @@ $ infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<```</Accordion>+ <Accordion title="INFISICAL_ENVIRONMENT">+ The environment slug to fetch proxied services and secrets from. Alternative to the `--env` flag or the `defaultEnvironment` field in `.infisical.json`.++ ```bash+ # Example+ export INFISICAL_ENVIRONMENT=prod+ ```+ </Accordion>++ <Accordion title="INFISICAL_SECRET_PATH">+ The secret path (folder) to scope to. Alternative to the `--path` flag or the `defaultSecretPath` field in `.infisical.json`.++ ```bash+ # Example+ export INFISICAL_SECRET_PATH=/ai-agents+ ```+ </Accordion>++ <Accordion title="INFISICAL_AGENT_PROXY_ADDRESS">+ Address of the agent proxy as `host:port`. Alternative to the `--proxy` flag.++ ```bash+ # Example+ export INFISICAL_AGENT_PROXY_ADDRESS=<proxy-host>:17322+ ```+ </Accordion>+<Accordion title="INFISICAL_DOMAIN">Point the CLI to your Infisical instance. Alternative to the `--domain` flag.@@ -197,7 +234,7 @@ $ infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<### Flags<Accordion title="--proxy">- Address of the agent proxy as `host:port`. Required.+ Address of the agent proxy as `host:port`. Required, unless provided via `INFISICAL_AGENT_PROXY_ADDRESS`.```bash# Example@@ -206,7 +243,7 @@ $ infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<</Accordion><Accordion title="--env">- The environment slug to fetch proxied services and secrets from (for example `dev`, `staging`, `prod`). Falls back to the environment in `.infisical.json` if present; required otherwise.+ The environment slug to fetch proxied services and secrets from (for example `dev`, `staging`, `prod`). Falls back to `INFISICAL_ENVIRONMENT`, then to the `defaultEnvironment` (and git-branch mapping) in `.infisical.json`; required otherwise.```bash# Example@@ -215,7 +252,7 @@ $ infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<</Accordion><Accordion title="--path">- The secret path (folder) to scope to. Proxied services and secrets are fetched from this folder.+ The secret path (folder) to scope to. Proxied services and secrets are fetched from this folder. Falls back to `INFISICAL_SECRET_PATH`, then to the `defaultSecretPath` field in `.infisical.json`.```bash# Example@@ -262,7 +299,7 @@ $ infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<</Accordion><Accordion title="--allow-readable-brokered-secrets">- Start even if the agent can **Read Value** on a secret that a proxied service brokers to it. By default `connect` refuses to start in that case, since the agent would receive the real value directly and bypass the proxy, defeating the point of brokering it. This is a misconfiguration guardrail, not a security boundary: the real fix is to not grant the agent read access to brokered secrets. Use this flag only for the rare intentional case.+ Start even if the agent can **Read Value** on a secret that a proxied service brokers to it. By default `connect` refuses to start in that case, since the agent would receive the real value directly and bypass the proxy, defeating the point of brokering it. This is a misconfiguration guardrail, not a security boundary: the real fix is to not grant the agent read access to brokered secrets. Use this flag only for the rare intentional case. Can also be set via `INFISICAL_AGENT_PROXY_ALLOW_READABLE_BROKERED_SECRETS`.```bash# Examplediff --git a/docs/docs.json b/docs/docs.jsonindex af8384f603..1353d9819f 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -630,6 +630,8 @@"documentation/platform/agent-proxy/overview","documentation/platform/agent-proxy/quickstart","documentation/platform/agent-proxy/proxied-services",+ "documentation/platform/agent-proxy/deployment",+ "documentation/platform/agent-proxy/connecting-agents","documentation/platform/agent-proxy/activity-logs","documentation/platform/agent-proxy/security"]diff --git a/docs/documentation/platform/agent-proxy/activity-logs.mdx b/docs/documentation/platform/agent-proxy/activity-logs.mdxindex e3fbd89cc5..2587c071af 100644--- a/docs/documentation/platform/agent-proxy/activity-logs.mdx+++ b/docs/documentation/platform/agent-proxy/activity-logs.mdx@@ -1,10 +1,12 @@---title: "Activity Logs"sidebarTitle: "Activity Logs"-description: "See what the agent proxy brokered on every request through its log stream, then ship it wherever you want."+description: "See what the agent proxy brokered on every request."----The agent proxy logs one entry for every request it handles, in its normal log stream alongside its operational logs — nothing separate to enable. You ship that stream yourself (Infisical never stores it): point a collector like Fluent Bit or the OpenTelemetry Collector at it to forward to Splunk, Datadog, Elastic, or anywhere.+Activity logs record what the agent proxy did with each request: which agent called which host, and which credential was applied. Together they form an audit trail of every credential your agents used, and a way to spot blocked or failed requests.++The proxy emits these records in its log output. To keep them, forward that output with a collector such as Fluent Bit or the OpenTelemetry Collector to your logging platform: Splunk, Datadog, Elastic, or anything else.<Note>Only requests that reach the forwarding stage are logged. Requests rejected earlier (malformed proxy auth, an invalid `CONNECT` target, TLS failures) never reach it and aren't logged. A request whose identity can't be resolved at forwarding is still logged as an `error`, just with an empty agent.@@ -26,7 +28,7 @@ Each request is logged with these fields (plus the standard `time`, `level`, and| `credentials` | What was injected: each entry's secret key (or, for a dynamic secret, its name and output field), and the header or surfaces it landed in |<Warning>- A record never contains a real secret. The proxy logs the request as the agent sent it, before the real value is swapped in, so `path` only ever shows the placeholder. The `credentials` list records secret **names** and where they were applied, never values, and header values and request bodies are never logged.+ A record never contains a real secret. Requests are logged as the agent sent them, before the swap, so `path` shows only the placeholder; `credentials` lists secret **names**, not values; header values and request bodies are never logged.</Warning>## Log levels@@ -40,35 +42,28 @@ Each decision is logged at a level, so `--log-level` controls how much you see:| `blocked` | warn || `error` | error |-## Output format and destination--| Flag | Values | Default |-| --- | --- | --- |-| `--log-format` | `console` \| `json` | `console` |-| `--log-file` | file path | none |+## Log format-`--log-format` sets the shape: `console` (the default — human-readable, colorized in a terminal and plain when redirected or in a container) or `json` for machines and SIEMs. Logs go to **stderr** (capture with `2>` or `2>&1`). `--log-file` also writes `json` to a file, so you can watch the console **and** persist machine-readable logs at once.+`--log-format` sets the shape of each record: `console` (the default, human-readable) or `json` for machines and SIEMs. Logs go to **stderr** (capture with `2>` or `2>&1`).<Tabs>- <Tab title="console (human)">+ <Tab title="console">```text- 2026-07-17T14:32:09 INF agent request event=agent-proxy.request decision=brokered agentName=claude-agent serviceName=stripe-api method=POST host=api.stripe.com path=/v1/charges status=200 credentials=[{"key":"STRIPE_API_KEY","role":"header-rewrite","header":"Authorization"}]+ 2026-07-17T14:32:09 INF agent request event=agent-proxy.request decision=brokered agentName=claude-agent serviceName=github method=POST host=api.github.com path=/repos/acme/app/issues status=201 credentials=[{"key":"GITHUB_PAT","role":"header-rewrite","header":"Authorization"}]2026-07-17T14:32:12 WRN agent request event=agent-proxy.request decision=blocked agentName=claude-agent host=evil.example.com method=GET status=403```</Tab>- <Tab title="json (machine)">+ <Tab title="json">```json- {"level":"info","time":"2026-07-17T14:32:09+05:30","message":"agent request","event":"agent-proxy.request","decision":"brokered","agentId":"9c1e40cf-...","agentName":"claude-agent","projectId":"53c8b330-...","environment":"prod","secretPath":"/ai-agents","serviceName":"stripe-api","method":"POST","host":"api.stripe.com","port":443,"path":"/v1/charges","status":200,"credentials":[{"key":"STRIPE_API_KEY","role":"header-rewrite","header":"Authorization"}]}- ```- </Tab>- <Tab title="dynamic secret">- A brokered credential backed by a [dynamic secret](/documentation/platform/dynamic-secrets/overview) records its name and output field instead of a static key:- ```json- "credentials":[{"dynamicSecretName":"my-postgres-creds","dynamicSecretField":"DB_PASSWORD","role":"header-rewrite","header":"Authorization"}]+ {"level":"info","time":"2026-07-17T14:32:09+05:30","message":"agent request","event":"agent-proxy.request","decision":"brokered","agentId":"9c1e40cf-...","agentName":"claude-agent","projectId":"53c8b330-...","environment":"prod","secretPath":"/coding-agent","serviceName":"github","method":"POST","host":"api.github.com","port":443,"path":"/repos/acme/app/issues","status":201,"credentials":[{"key":"GITHUB_PAT","role":"header-rewrite","header":"Authorization"}]}```</Tab></Tabs>+## Log file++`--log-file` writes `json` records to a file, in addition to the console output. This lets you watch a readable stream in the terminal while persisting machine-readable logs for your collector.+## Common setups```bashdiff --git a/docs/documentation/platform/agent-proxy/connecting-agents.mdx b/docs/documentation/platform/agent-proxy/connecting-agents.mdxnew file mode 100644index 0000000000..9b78ce2e39--- /dev/null+++ b/docs/documentation/platform/agent-proxy/connecting-agents.mdx@@ -0,0 +1,48 @@+---+title: "Connecting Agents"+description: "Launch any agent behind the Agent Proxy and control what its environment contains."+---++You launch your agent through `infisical secrets agent-proxy connect -- <agent command>`, which sets up the agent's environment and then starts it. No code changes are needed: `connect` points the agent's HTTP clients at the Agent Proxy, so its normal outbound requests route through it. Each request carries the agent's Infisical token and folder scope, which is how the Agent Proxy knows which identity is asking and which of that folder's proxied services apply.++## What `connect` sets in the agent's environment++- **Proxy routing.** `HTTPS_PROXY` and `HTTP_PROXY` point at the Agent Proxy. `NO_PROXY` always includes `localhost,127.0.0.1`; add more hosts with `--no-proxy` or an existing `NO_PROXY`.+- **Certificate trust.** The standard trust variables point at the downloaded root CA so the agent's HTTP clients accept the Agent Proxy's certificates. See [Certificates & TLS interception](/documentation/platform/agent-proxy/security#certificates--tls-interception).+- **Placeholders.** A dummy value for each [secret-substitution](/documentation/platform/agent-proxy/proxied-services#secret-substitution) service, so the agent has something to send.+- **Real values (opt-in).** To give the agent a real secret directly, grant its identity **Read Value** on that secret; `connect` then injects the value into the agent's environment, like any secret the identity can read. This is for values the agent uses in its own code; for credentials it sends to an external API, broker them instead. An agent with only the `Proxy` permission gets no real values, just the routing and placeholders above. Brokered credentials are never injected here; the Agent Proxy adds them to each outbound request itself, so they reach the destination but never the agent.++## Connection behaviors++- Both HTTPS and plain-HTTP services are brokered. HTTPS traffic arrives as `CONNECT` tunnels; plain `http://` traffic arrives as regular forward-proxy requests (useful for internal services without TLS). An `https://` URL sent as a plain forward-proxy request is rejected, so the Agent Proxy can never be used to downgrade TLS.+- If the agent identity can already read a secret that one of its proxied services brokers, `connect` refuses to start: the agent would receive that value directly and bypass the Agent Proxy. Pass `--allow-readable-brokered-secrets` to override the guardrail.++## Configuration++Every option resolves from the same sources, in order: **the flag → an environment variable → `.infisical.json` → the built-in default.** An explicitly-passed flag always wins. In a container or CI where the environment variables are already set, the flags fall away and only your agent command remains: `infisical secrets agent-proxy connect -- claude`.++| Option | Flag | Environment variable | `.infisical.json` |+| --- | --- | --- | --- |+| Auth | `--client-id` / `--client-secret` | `INFISICAL_UNIVERSAL_AUTH_CLIENT_ID` / `_SECRET` | — |+| Instance | `--domain` | `INFISICAL_DOMAIN` | `domain` |+| Project | `--projectId` | `INFISICAL_PROJECT_ID` | `workspaceId` |+| Environment slug | `--env` | `INFISICAL_ENVIRONMENT` | `defaultEnvironment` |+| Secret path | `--path` | `INFISICAL_SECRET_PATH` | `defaultSecretPath` |+| Proxy address | `--proxy` | `INFISICAL_AGENT_PROXY_ADDRESS` | — |++<Note>+ The proxy address is the one setting that cannot come from `.infisical.json`. That file is usually committed to your repository, so a wrong or malicious value would silently route every agent's traffic through the wrong host. Pass it with `--proxy` or `INFISICAL_AGENT_PROXY_ADDRESS` instead.+</Note>++See the [CLI reference](/cli/commands/agent-proxy) for the full list, including `--port`, `--unmatched-host`, and `--poll-interval` on `start`.++## Next steps++<CardGroup cols={2}>+ <Card title="agent-proxy CLI reference" icon="terminal" href="/cli/commands/agent-proxy">+ Every flag for `start` and `connect`, with examples.+ </Card>+ <Card title="Activity Logs" icon="scroll" href="/documentation/platform/agent-proxy/activity-logs">+ See what the Agent Proxy brokered on every request.+ </Card>+</CardGroup>diff --git a/docs/documentation/platform/agent-proxy/deployment.mdx b/docs/documentation/platform/agent-proxy/deployment.mdxnew file mode 100644index 0000000000..f2adcdcf4e--- /dev/null+++ b/docs/documentation/platform/agent-proxy/deployment.mdx@@ -0,0 +1,117 @@+---+title: "Deployment"+description: "Run the Agent Proxy in production: network placement, deployment methods, and high availability."+---++The Agent Proxy is a single long-running process started with `infisical secrets agent-proxy start`. This page covers where to place it in your network, how to run it, and how it behaves at scale. For a first run, the [Quickstart](/documentation/platform/agent-proxy/quickstart) is enough; read this before going to production.++## Network placement++The Agent Proxy is built for private-network deployment. A well-placed one looks like this:++```text++---- Your private network -------------------++| |+| +--------------+ |+| | Agent host |----+ | +------------------++| +--------------+ | | +-->| External APIs |+| | +----------------+ | | +------------------++| +-->| Agent Proxy |-------++| | | its own host |-------++| +--------------+ | +----------------+ | | +------------------++| | Agent host |----+ | +-->| Infisical |+| +--------------+ port 17322, | +------------------++| agents only |++---------------------------------------------++```++- **Inside your private network, off the public internet.** The Agent Proxy's listening port should only ever be reachable from within your network.+- **Reachable only by your agent machines.** Restrict inbound access to the Agent Proxy's port to the hosts that run agents, using your usual controls (security groups, firewall rules, network policies).+- **On its own host.** Same network as the agents for low per-request latency, but a separate machine, which keeps the real credentials fully isolated from the agents.+- **Alongside any plain-HTTP upstreams.** Internal services the Agent Proxy reaches over plain HTTP belong inside the same trusted network.+- **Credentials where they are used.** Provision the Agent Proxy identity's client credentials only on its host, and each agent identity's only on its agent machine.++Outbound, the Agent Proxy only needs to reach your Infisical instance and the APIs your proxied services define.++## Deployment methods++However you run the Agent Proxy, provide its identity's credentials, publish port `17322` to your agent machines only, and set `INFISICAL_DOMAIN` for EU Cloud or self-hosted.++<Tabs>+ <Tab title="CLI (systemd, VM)">+ Install the [CLI](/cli/overview) on the host and run `start` under a process supervisor so it restarts on failure:++ ```bash+ export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<agent-proxy-client-id>+ export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<agent-proxy-client-secret>+ # export INFISICAL_DOMAIN=https://eu.infisical.com # EU Cloud or self-hosted++ infisical secrets agent-proxy start+ ```+ </Tab>+ <Tab title="Docker">+ The CLI ships as the `infisical/cli` image. Pass credentials as environment variables and publish the port:++ ```bash+ docker run -p 17322:17322 \+ -e INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<agent-proxy-client-id> \+ -e INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<agent-proxy-client-secret> \+ infisical/cli:latest secrets agent-proxy start+ ```++ Add `-e INFISICAL_DOMAIN=https://eu.infisical.com` for EU Cloud or a self-hosted instance.+ </Tab>+ <Tab title="PaaS (Render, Railway, Fly)">+ Deploy the `infisical/cli` image as a service:++ - **Image:** `infisical/cli:latest`+ - **Start command:** `secrets agent-proxy start`+ - **Environment:** `INFISICAL_UNIVERSAL_AUTH_CLIENT_ID`, `INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET`, and `INFISICAL_DOMAIN` if not on US Cloud+ - **Port:** `17322`, exposed on a private network your agents can reach, not the public internet++ On Render, this is a private service pointed at the image with the start command above.+ </Tab>+</Tabs>++<Note>+ Keep the Agent Proxy on a private network reachable only by your agent machines (see [Network placement](#network-placement)). To run more than one instance, see [High availability](#high-availability).+</Note>++## Caching and polling++The Agent Proxy keeps everything it needs in memory, so steady-state requests involve no Infisical calls:++- **First request from an agent**: the Agent Proxy discovers all proxied services in the agent's scope and fetches the referenced secret values, then serves every subsequent request from that agent, to any host, from cache.+- **Refresh**: every 60 seconds (configurable via `--poll-interval`), the Agent Proxy re-fetches services, permissions, and secret values for active agents. Changes such as a rotated secret or an edited service take effect within one poll interval, with no agent restart. Authorization fails closed on the same cycle. If an agent's identity, role, or Proxy grant is revoked, or its token expires, the Agent Proxy drops that agent's cached credentials on the next poll and stops applying them.+- **Eviction**: an agent idle for about 10 minutes has its cache dropped and polling stopped. Its next request triggers a fresh discovery.+- **API load**: polling grows with the number of active agents. With a large fleet or a short `--poll-interval`, factor in your instance's API rate limits; a longer interval reduces load at the cost of slower propagation.++## Unmatched hosts++When an agent requests a host no proxied service matches, the `--unmatched-host` flag decides what happens:++- `allow` (default): the request is forwarded untouched, with no credentials applied. This is the normal mode, because much of an agent's traffic does not need a brokered credential at all: reading documentation, cloning public repos, installing packages, or calling services the agent legitimately authenticates to itself. All of that flows through untouched, while matched hosts still get credentials applied.+- `block`: the request is rejected with `403`. Use this to restrict agents to an allowlist of exactly the services you have defined.++<Note>+ `block` applies to every host without a matching proxied service, including your Infisical instance itself. Since agent traffic routes through the Agent Proxy, Infisical CLI commands run from inside the agent (using the `INFISICAL_TOKEN` from its environment) will also be rejected in this mode.+</Note>++## High availability++Run multiple Agent Proxy instances with the same machine identity behind a TCP load balancer. Instances coordinate through Infisical rather than with each other:++- All instances chain to the same per-organization root CA, so agents trust any instance. Each instance signs its own intermediate.+- Each instance keeps its own agent cache. If the load balancer moves an agent to a new instance, that instance does one fresh discovery and then serves from cache.+- Each instance polls Infisical independently. After a secret rotation, instances may briefly apply different values until their next poll (up to one poll interval).++## Next steps++<CardGroup cols={2}>+ <Card title="Connecting Agents" icon="plug" href="/documentation/platform/agent-proxy/connecting-agents">+ Launch an agent behind the proxy and control what its environment holds.+ </Card>+ <Card title="Security" icon="shield-halved" href="/documentation/platform/agent-proxy/security">+ The isolation, authentication, and trust model.+ </Card>+</CardGroup>diff --git a/docs/documentation/platform/agent-proxy/overview.mdx b/docs/documentation/platform/agent-proxy/overview.mdxindex 9c18f7fa5d..cfeb54ca66 100644--- a/docs/documentation/platform/agent-proxy/overview.mdx+++ b/docs/documentation/platform/agent-proxy/overview.mdx@@ -1,97 +1,89 @@---title: "Agent Proxy"sidebarTitle: "Overview"-description: "Let AI agents and untrusted code execution environments call authenticated APIs without ever holding real credentials."+description: "Give AI agents and untrusted code execution environments access without handing over your secrets."----You want an AI agent to do real work: push code, file tickets, call external APIs. That work needs credentials, and the **Infisical Agent Proxy** lets the agent do all of it without ever being handed one.+The **Infisical Agent Proxy** is a credential broker for AI agents and untrusted code execution environments. It sits between your AI agents and the APIs they call including LLM providers, GitHub, Slack, and more.-It works like this: the agent makes an API call with no real credential (or a dummy placeholder, where one is expected). On its way out, the request passes through the agent proxy. The proxy attaches the real credential and forwards the request to the API. The API sees a normal authenticated call. The agent never saw the key, so there is nothing to leak.+Agents like Claude Code or OpenClaw route HTTP requests through the proxy, which swaps dummy credentials for real ones (or replaces auth headers entirely), before forwarding the request to the target service.-A credential that enters an untrusted code execution environment is exposed in more ways than one:+```text+ Your private network Public internet-- A prompt injection can talk the agent into sending its keys to an attacker (**credential exfiltration**).-- Anything in the agent's environment can end up in its context window, and from there in LLM provider logs and transcripts, or even training data.-- Keys leak sideways into shell history, log files, and error reports as the agent works.-- A stolen key works from anywhere until someone notices and rotates it.++----------+ +-------------+ +------------------++| AI agent | --------------> | Agent Proxy | ---------------> | api.slack.com |++----------+ request with a +-------------+ request with the | api.github.com |+ placeholder key | real credential | ... |+ | +------------------++ | fetches the real+ | credential values+ v+ +-------------++ | Infisical |+ +-------------++```-Brokered credentials sidestep all of it: they cannot be exfiltrated, logged, or memorized from inside the agent, they only work through the proxy for the services you configured, and an agent's access can be revoked centrally at any time.+## Why Agent Proxy-<Note>- The agent proxy is not limited to AI agents. Any untrusted code execution environment that respects an HTTP proxy can run behind it, with no code changes.-</Note>+Traditional secrets management involves returning credentials back to applications and services.-## How It Works+This is not suitable for AI agents because they are vulnerable to credential exfiltration via [prompt injection](https://en.wikipedia.org/wiki/Prompt_injection); an attacker could craft a malicious prompt or payload and exfiltrate credentials from an agent back to the attacker.-```mermaid-flowchart LR- A[Agent] -->|request without real credentials| B[Agent Proxy]- B -->|real credentials applied on the wire| C[External Service]- B <-->|fetches configs + secrets| D[Infisical]-```+Enter Infisical Agent Proxy - a proxy service backed by Infisical that prevents credential exfiltration by brokering access to credentials stored in Infisical at the network boundary.-1. **Keep your secrets in Infisical**, exactly as you do today. Next to them, define [proxied services](/documentation/platform/agent-proxy/proxied-services): small configs that say, for example, "requests to `api.stripe.com` get `STRIPE_API_KEY` as a Bearer token".-2. **Run the agent proxy** with one command: `infisical secrets agent-proxy start`.-3. **Launch your agent through the wrapper**: `infisical secrets agent-proxy connect -- claude`. The wrapper points the agent's traffic at the proxy and starts it. The agent holds none of the brokered credentials, and has no idea any of this is happening.+## How it works-Now the agent calls `api.stripe.com`. The proxy adds the real `STRIPE_API_KEY` and forwards the request. Stripe sees a normal authenticated call.+Start by configuring the resources Agent Proxy needs within Infisical to broker your agent access to an external service.-## The Whole Platform Comes With It+1. Add a credential as a secret in Infisical; this can be a static secret or a [dynamic secret](/documentation/platform/dynamic-secrets/overview).-Standalone credential proxies manage their own keys, users, and permissions in isolation, so you end up running a second secrets manager just for your agents. The agent proxy is different: brokered credentials are ordinary Infisical secrets, so everything the platform does applies to them with zero extra setup.+2. Configure a [proxied service](/documentation/platform/agent-proxy/proxied-services) in Infisical. This defines the external service (e.g. `api.anthropic.com`, `api.github.com`, `slack.com`, etc.) that Agent Proxy can broker access to using the credential.-<CardGroup cols={2}>- <Card title="Secret Rotation" icon="rotate" href="/documentation/platform/secret-rotation/overview">- Rotate brokered credentials on a schedule. The proxy applies the new value within a minute, with no agent restart and no agent awareness.- </Card>- <Card title="Dynamic Secrets" icon="bolt" href="/documentation/platform/dynamic-secrets/overview">- Generate short-lived, per-use credentials on demand for databases, clouds, Kubernetes, and more, so there is no long-lived key to steal in the first place.- </Card>- <Card title="Approval Workflows" icon="check-double" href="/documentation/platform/pr-workflows">- Require a review before a brokered credential changes, exactly like a code change.- </Card>- <Card title="Audit Logs" icon="scroll" href="/documentation/platform/audit-logs">- A complete trail of everything around your proxied services, from configuration changes to activity.- </Card>- <Card title="Access Controls" icon="user-lock" href="/documentation/platform/access-controls/role-based-access-controls">- Scope each agent identity to exactly the environments, paths, and services it should reach.- </Card>- <Card title="Versioning & Recovery" icon="clock-rotate-left" href="/documentation/platform/secret-versioning">- Every brokered credential keeps its full version history, with point-in-time recovery.- </Card>-</CardGroup>+3. Configure a [machine identity](/documentation/platform/identities/machine-identities) for Agent Proxy using [Universal Auth](/documentation/platform/identities/universal-auth) and another one for your agent.-## What You Work With+Next, set up an instance of Agent Proxy on a separate host machine:-<Tabs>- <Tab title="Proxied Service" icon="right-left">- A small config that lives in a folder next to your secrets. It says which hosts it covers, which secrets to use, and how to apply them (set a header, or swap a placeholder). You manage it in the secrets dashboard like any other resource.- </Tab>- <Tab title="Agent Proxy" icon="server">- An HTTP(S) forward proxy built into the Infisical CLI (`infisical secrets agent-proxy start`). It runs in your private network, close to your agents, and applies credentials to their outbound traffic. It authenticates to Infisical with its own machine identity, which needs read access to the referenced secrets. A single agent proxy can serve many agents at once while keeping them isolated from each other.- </Tab>- <Tab title="Agent" icon="robot">- Any program that respects an HTTP proxy: Claude Code, Codex, OpenClaw, or any other untrusted code execution environment. Each agent authenticates with its own machine identity and is launched through `infisical secrets agent-proxy connect`, which sets up the proxy routing and trust environment before starting the agent process.- </Tab>-</Tabs>+4. Start up an Agent Proxy server using the [Infisical CLI](/cli/overview) with the `infisical secrets agent-proxy start` command [here](/cli/commands/agent-proxy) with `INFISICAL_UNIVERSAL_AUTH_CLIENT_ID` and `INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET` set in the environment.++Finally, configure your AI agent to route requests through Agent Proxy:++5. Bootstrap your AI agent’s environment to automatically route all outbound HTTP and HTTPS traffic through Agent Proxy. This can be done with the [Infisical CLI](/cli/overview) and setting `INFISICAL_PROJECT_ID`, `INFISICAL_ENVIRONMENT`, `INFISICAL_SECRET_PATH`, and `INFISICAL_AGENT_PROXY_ADDRESS` in the agent’s environment.++6. Launch your agent with the `infisical secrets agent-proxy connect` command to start routing requests through Agent Proxy.++## What you work with++| Object | What it is |+| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| **Proxied service** | A config that maps a host to the secret the proxy applies, static or [dynamic](/documentation/platform/agent-proxy/proxied-services#using-dynamic-secrets). Defined next to your secrets in the dashboard. |+| **Agent proxy** | The forward proxy in the [Infisical CLI](/cli/overview) that runs in your network and attaches credentials to outbound requests. |+| **Agent** | Any program that respects `HTTPS_PROXY`: Claude Code, Codex, OpenClaw, Hermes, or any other untrusted workload. |<Warning>- The Agent Proxy is distinct from other similarly named Infisical components: the [Infisical Agent](/integrations/platforms/infisical-agent) is a daemon that fetches secrets to disk for applications, the [Infisical Proxy](/integrations/platforms/infisical-proxy) is a caching proxy for the Infisical API itself, and [Gateways](/documentation/platform/gateways/overview) let Infisical reach into private networks. Those all deliver secrets or connectivity to software you trust. The Agent Proxy does the opposite: it exists so that software you do not trust never receives a secret at all.+ The Agent Proxy is distinct from similarly named Infisical components:++ - The [Infisical Agent](/integrations/platforms/infisical-agent) fetches secrets to disk for applications.+ - The [Infisical Proxy](/integrations/platforms/infisical-proxy) caches the Infisical API.+ - [Gateways](/documentation/platform/gateways/overview) let Infisical reach into private networks.+</Warning>-## Next Steps+## Next steps<CardGroup cols={2}>- <Card title="Quickstart" icon="rocket" href="/documentation/platform/agent-proxy/quickstart">- Broker your first credential to an agent in a few minutes.- </Card>- <Card title="Proxied Services" icon="right-left" href="/documentation/platform/agent-proxy/proxied-services">- Host patterns, header rewriting, and credential substitution.- </Card>- <Card title="Activity Logs" icon="list-timeline" href="/documentation/platform/agent-proxy/activity-logs">- Record what the proxy brokered on every request, and ship it to your SIEM.+ <Card+ title="Quickstart"+ icon="rocket"+ href="/documentation/platform/agent-proxy/quickstart"+ >+ Broker your first credential to an agent.</Card>- <Card title="Security & Architecture" icon="shield-halved" href="/documentation/platform/agent-proxy/security">- Agent authentication, isolation, certificates, and high availability.+ <Card+ title="Security"+ icon="shield-halved"+ href="/documentation/platform/agent-proxy/security"+ >+ Isolation, authentication, certificates, and permissions.</Card></CardGroup>diff --git a/docs/documentation/platform/agent-proxy/proxied-services.mdx b/docs/documentation/platform/agent-proxy/proxied-services.mdxindex b6cc4e39dc..e5227d6959 100644--- a/docs/documentation/platform/agent-proxy/proxied-services.mdx+++ b/docs/documentation/platform/agent-proxy/proxied-services.mdx@@ -3,37 +3,43 @@ title: "Proxied Services"description: "Define how the agent proxy applies credentials to traffic bound for an external service."----A proxied service tells the agent proxy how to handle traffic to a specific external service. It lives in a folder alongside your secrets, references those secrets by key name, and defines which hosts it applies to and how each secret is placed into the outbound request.+A proxied service tells the agent proxy how to apply credentials to traffic bound for an external service. It lives in a folder alongside your secrets and defines which hosts it covers.-You manage proxied services in the secrets dashboard: open a folder, click the dropdown arrow next to **Add Secret**, and select **Add Proxied Service**. They appear in the folder view next to your secrets.+To create one, open a folder in the secrets dashboard, click the dropdown arrow next to **Add Secret**, and select **Add Proxied Service**.++++A service applies each secret through a [header rewrite](#header-rewrites), a [secret substitution](#secret-substitution), or both; each is covered in its own section below.## Configuration+Every service has these core fields, plus one or more credential rules described below.+<ParamField path="Service Name" type="string" required>- A slug (lowercase letters, numbers, hyphens) that identifies the service, such as `stripe-api`. Names are unique within a folder.+ A slug (lowercase letters, numbers, hyphens) that identifies the service, such as `github`. Names are unique within a folder.</ParamField><ParamField path="Host Pattern" type="string" required>- One or more comma-separated patterns describing which hosts this service applies to. See [Host Patterns](#host-patterns) below.+ One or more comma-separated patterns describing which hosts this service applies to. See [Host patterns](#host-patterns) below.</ParamField>-<ParamField path="Enabled" type="boolean" default="true">- Toggle a service off without deleting it. A disabled service is skipped entirely: its placeholder environment variables are not set, no credentials are applied, and traffic to its hosts falls back to the [unmatched host policy](/documentation/platform/agent-proxy/security#unmatched-hosts).+<ParamField path="Enabled" type="boolean" optional default="true">+ Toggle a service off without deleting it. A disabled service is skipped entirely: its placeholder environment variables are not set, no credentials are applied, and traffic to its hosts falls back to the [unmatched host policy](/documentation/platform/agent-proxy/deployment#unmatched-hosts).</ParamField>-A service then applies one or more secrets in two ways, **Header Rewriting** and **Credential Substitution**. Both are independent; use either or both.+-## Host Patterns+## Host patternsA host pattern routes requests to the right service. Each pattern is a `host[:port][/path]`, and multiple patterns can be combined with commas:```bash-api.stripe.com # exact host+api.github.com # exact host*.github.com # wildcard: matches api.github.com, not a.b.github.com-api.stripe.com:443 # specific port-api.stripe.com/v1/* # path prefix+api.github.com:443 # specific port+api.github.com/repos/* # path prefixinternal.corp.com:3000/api/* # port and path-api.stripe.com, dashboard.stripe.com # multiple patterns, matches either+api.github.com, uploads.github.com # multiple patterns, matches either```A few rules to keep in mind:@@ -50,12 +56,12 @@ When a request could match more than one service, the agent proxy picks the best4. If still tied, the service whose name sorts first alphabetically wins.<Note>- Host patterns are for routing only. Proxied services are also scoped to their folder: an agent connected with `--env=prod --path=/ai-agents` only ever matches services defined in that folder, so the same hostname can be configured differently in different folders, environments, or projects.+ Host patterns are for routing only. Proxied services are also scoped to their folder: an agent connected with `--env=dev --path=/coding-agent` only ever matches services defined in that folder, so the same hostname can be configured differently in different folders, environments, or projects.</Note>-## Header Rewriting+## Header rewrites-Header rewriting adds or replaces an HTTP header on the outbound request. The agent does not need to send any credential; if it sends a made-up one, the header is overwritten with the real value. This covers most APIs:+A header rewrite adds or replaces an HTTP header on the outbound request. The agent does not need to send any credential; if it sends a made-up one, the header is overwritten with the real value. This covers most APIs:| Auth style | Configuration | Resulting header || --- | --- | --- |@@ -66,21 +72,27 @@ Header rewriting adds or replaces an HTTP header on the outbound request. The agThe password is optional for basic auth. Many APIs pass an API key as the username with an empty password; omitting the password produces `Authorization: Basic base64(username:)`.-A service can rewrite multiple distinct headers (for example, an API key header plus a tenant header), but each header name can only be set by one secret. To build one header value out of several secrets, or use a secret kept elsewhere, see [reusing secrets from other folders and environments](#reusing-secrets-from-other-folders-and-environments).+-## Credential Substitution+A service can rewrite multiple distinct headers (for example, an API key header plus a tenant header), but each header name can only be set by one secret. To build one header value out of several secrets, or use a secret kept elsewhere, see [using secrets from other folders and environments](#using-secrets-from-other-folders-and-environments).-With credential substitution, the agent is handed a dummy placeholder value and the agent proxy swaps it for the real credential wherever it appears in the request. It is useful in two situations:+## Secret substitution++With secret substitution, the agent is handed a dummy placeholder value. The agent proxy swaps it for the real credential wherever it appears in the request. It is useful in two situations:- The API carries the credential somewhere other than a header. Telegram, for example, puts the bot token in the URL path: `api.telegram.org/bot<token>/sendMessage`.- The agent has to see a value before it will make the call at all, headers included. Some HTTP clients validate that a credential is set, and agents often refuse to attempt a request without a real-looking key. The placeholder satisfies them, and the proxy swaps in the real value on the way out.+The placeholder is also delivered for you: [`infisical secrets agent-proxy connect`](/documentation/platform/agent-proxy/connecting-agents) sets it as an environment variable in the agent's environment, so there is nothing to hand out.+++<ParamField path="Environment Variable" type="string" required>The environment variable name the agent receives, such as `TELEGRAM_BOT_TOKEN`. When an agent connects, `infisical secrets agent-proxy connect` sets this variable to the placeholder, so the agent uses it like a normal credential.</ParamField><ParamField path="Placeholder Value" type="string" required>- The dummy value that appears on the wire. A distinctive random string is generated for you, but you can override it, for example when the agent's HTTP client validates the credential's format.+ The dummy value the agent sends in its requests. A distinctive random string is generated for you, but you can override it, for example when the agent's HTTP client validates the credential's format.</ParamField><ParamField path="Replace In" type="string[]" required>@@ -91,62 +103,33 @@ With credential substitution, the agent is handed a dummy placeholder value andThe secret (from the same folder) whose real value replaces the placeholder.</ParamField>-A few behaviors worth knowing:--- Replacement is a literal string swap of every occurrence of the placeholder in the selected surfaces.-- Request bodies are scanned up to 10 MiB; larger bodies, and bodies with a `Content-Encoding` (compressed payloads), are forwarded unchanged without substitution.-- WebSocket traffic is not supported; substitution applies to regular HTTP(S) requests.--<Note>- If a placeholder environment variable has the same name as a regular secret the agent can read, the real secret value wins and the CLI logs a warning. Rename one of the two to avoid the ambiguity.-</Note>--## Using Secrets--A proxied service uses secrets **by key name, from its own folder**. This keeps the relationship self-healing:--- At creation time, Infisical validates that each secret exists and that you can read its value, so typos are caught the moment you save.-- If a secret is later renamed or deleted, the proxied service skips it (the agent proxy logs a warning and the request still goes through, just without that value). Recreating the secret with the same key restores it automatically.-- Deleting the folder deletes the proxied services in it.--<Note>- Creating or updating a proxied service requires **Read Value** permission on each secret it uses. This prevents someone with edit access to proxied services from wiring in a secret they are not allowed to read and exfiltrating it through the proxy.-</Note>--### Reusing secrets from other folders and environments+## Using secrets from other folders and environmentsYou cannot point a proxied service at another folder directly, but you can bring an outside value into its folder so the service can use it. There are two ways, both using features that already exist in Infisical:| Approach | What you do | Example || --- | --- | --- || **Imported secret** | [Import](/documentation/platform/secret-reference) another folder into the service's folder, then use the imported key by name | Import `/shared-creds`, then use its `SHARED_API_KEY` from the service's folder |-| **Composed with references** | Create a secret whose value is one or more [secret references](/documentation/platform/secret-reference), then use that secret. Lets you combine several secrets, including ones from different environments | A secret set to `${dev.gateway.KEY}.${staging.gateway.KEY}.${prod.gateway.KEY}` resolves to the three values joined together |+| **Composed with references** | Create a secret whose value is one or more [secret references](/documentation/platform/secret-reference), then use that secret. Lets you combine several secrets, including ones from other folders or environments | A secret set to `${AUTH_USERNAME}:${prod.shared.AUTH_PASSWORD}` resolves to the two values joined as `username:password` |-A folder-local secret always wins over an imported one with the same key. Read permission on an imported secret is checked where it actually lives, so an import cannot widen anyone's access.+## Using dynamic secrets-Either way, the value is fully resolved before the proxy applies it.--## Using Dynamic Secrets--A credential can reference a [dynamic secret](/documentation/platform/dynamic-secrets/overview) instead of a static secret. Instead of injecting a fixed value, the agent proxy mints a short-lived lease and injects one of its output fields (for example a database password, a GitHub App token, or a Kubernetes service-account token). Because the value rotates on its own at the lease TTL, a credential that leaks is worthless shortly after.--In the credential form, choose a dynamic secret from the **Dynamic Secrets** group of the secret picker, then pick which **Output Field** of the lease to inject. Each provider exposes different fields (SQL databases give `DB_USERNAME` / `DB_PASSWORD`, GitHub gives a `TOKEN`, and so on); pick the field you want to inject. Basic auth works by pointing the username and password at two fields of the same dynamic secret.+A credential can reference a [dynamic secret](/documentation/platform/dynamic-secrets/overview) instead of a static secret. Rather than injecting a fixed value, the agent proxy mints a short-lived lease and injects one of its output fields (for example a GCP access token, a GitHub App token, or a Kubernetes service-account token).How the agent proxy handles the lease:-- **Minted lazily, per agent session.** The first request that needs the credential mints a lease; each agent session gets its own lease, and subsequent requests reuse it.-- **Refreshed before expiry.** The proxy mints a fresh lease shortly before the current one expires and swaps it in with no failed requests in between. It does not renew the old lease; the old one is left to expire on its own.-- **Cleaned up.** Leases are revoked when the proxy shuts down; anything missed is reaped by the lease's own TTL on the server.+- **Minted lazily, per agent session.** The first request that needs the credential mints a lease; each agent session gets its own, and later requests reuse it.+- **Refreshed before expiry.** A fresh lease is swapped in shortly before the current one expires, with no failed requests in between.<Warning>- Prefer TTLs of at least a few minutes on dynamic secrets used for brokering. Each agent session on each proxy instance holds its own lease and re-mints it as it nears expiry, so a very short TTL (e.g. one minute) causes constant re-minting.+ Use a TTL of at least a few minutes on dynamic secrets you broker. Each agent session on each proxy instance holds its own lease and re-mints it as it nears expiry, so a very short TTL (for example one minute) causes constant re-minting.</Warning><Note>- Only the agent proxy's machine identity mints leases, and only it needs the **Lease** permission on the referenced dynamic secrets. The agent identity must **not** hold Lease on a brokered dynamic secret; if it does, it could mint the credential itself and bypass the proxy, so `infisical secrets agent-proxy connect` refuses to start (pass `--allow-readable-brokered-secrets` to override). Creating or updating a proxied service that references a dynamic secret requires that you hold Lease on it, and requires a plan that includes dynamic secrets.+ Give **Manage Leases** on the dynamic secret to the proxy identity only. If the agent identity also has it, it could mint the credential itself and skip the proxy, so `connect` refuses to start by default.</Note>-## Example: API Request+## Example: API requestProxied services can also be managed via the [API](/api-reference/endpoints/proxied-services/create). For example, creating the Telegram service described above:@@ -156,8 +139,8 @@ curl -X POST https://app.infisical.com/api/v1/proxied-services \-H "Content-Type: application/json" \-d '{"projectId": "<project-id>",- "environment": "prod",- "secretPath": "/ai-agents",+ "environment": "dev",+ "secretPath": "/coding-agent","name": "telegram-bot-api","hostPattern": "api.telegram.org","credentials": [@@ -178,10 +161,21 @@ To reference a dynamic secret, replace `secretKey` on a credential with `dynamic```json{- "dynamicSecretName": "my-postgres",- "dynamicSecretField": "DB_PASSWORD",+ "dynamicSecretName": "github-app-token",+ "dynamicSecretField": "TOKEN","role": "header-rewrite","headerName": "Authorization","headerPrefix": "Bearer"}```++## Next steps++<CardGroup cols={2}>+ <Card title="Connecting Agents" icon="plug" href="/documentation/platform/agent-proxy/connecting-agents">+ Launch an agent and have it use the services you defined.+ </Card>+ <Card title="Security" icon="shield-halved" href="/documentation/platform/agent-proxy/security">+ The Proxy permission and the isolation model behind these services.+ </Card>+</CardGroup>diff --git a/docs/documentation/platform/agent-proxy/quickstart.mdx b/docs/documentation/platform/agent-proxy/quickstart.mdxindex f05458d902..0fcd1f1b57 100644--- a/docs/documentation/platform/agent-proxy/quickstart.mdx+++ b/docs/documentation/platform/agent-proxy/quickstart.mdx@@ -1,117 +1,322 @@----title: "Agent Proxy Quickstart"+title: "Agent Proxy quickstart"sidebarTitle: "Quickstart"description: "Broker your first credential to an agent through the Infisical Agent Proxy."----This guide walks through brokering a credential end to end: you will create a proxied service, start an agent proxy, and launch an agent whose API calls get real credentials applied on the wire, without the agent ever holding them.+This tutorial takes you from an Infisical project to an agent making authenticated API calls through the Agent Proxy, with real credentials it never sees.-## Prerequisites+## Before you begin-- An Infisical project (Secrets Management) with the secrets you want to broker.-- The [Infisical CLI](/cli/overview) installed on the machines that will run the agent proxy and the agent.+To follow along, you'll need:++- An Infisical Secrets Management project.+- A GitHub account (this guide's running example) or any other API you'd rather broker. The steps are the same either way.+- Two hosts in the same private network: one for the agent proxy and one for the agent. The agent host must be able to reach the proxy on its port (`17322` by default).+- The [Infisical CLI](/cli/overview) installed on both the proxy host and the agent host.+- Optional: [GitHub's `gh` CLI](https://cli.github.com/) on the agent host, for the recommended verification in step 7. A `curl` fallback is provided, so this is not required.++## 1. Add a secret++First, get a GitHub personal access token to broker:++1. Go to [GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens](https://github.com/settings/personal-access-tokens).+2. Click **Generate new token**, give it a name, set an expiration, and choose the resource owner.+3. Leave the permissions at their defaults. The verification in step 7 calls `GET /user`, which any valid token can reach, so no permissions are needed here; later, grant only what your agent actually does.+4. Click **Generate token** and copy the `github_pat_…` value. GitHub only shows it once.++Then, in your Infisical project, create a folder for the agent (for example `/coding-agent` in the `dev` environment) and add a secret named `GITHUB_PAT` with that token as its value. It is a regular Infisical secret.++++## 2. Create a proxied service++A proxied service maps a host to the secret the proxy applies. In the same folder, open the **Add Secret** dropdown and select **Add Proxied Service**, then work through the steps:++<Steps>- <Step title="Add the secrets to broker">- In your project, pick or create a folder for your agent workloads (for example `/ai-agents` in the `prod` environment) and add the secrets the agents will need, such as `STRIPE_API_KEY`. These are regular Infisical secrets; nothing about them changes when they are brokered.+ <Step title="Pick the GitHub template">+ The template fills everything in for you: the host `api.github.com` and a **Secret Substitution** rule that hands the agent a realistic `ghp_…` placeholder and swaps in the real token on the way out.++ </Step>- <Step title="Create a proxied service">- In the same folder, click the dropdown arrow next to **Add Secret** and select **Add Proxied Service**.+ <Step title="Details">+ Keep the service name `github` and the host pattern `api.github.com`.- <ParamField path="Service Name" type="string" required>- A slug that identifies the service, such as `stripe-api`.- </ParamField>- <ParamField path="Host Pattern" type="string" required>- The host(s) this service applies to, such as `api.stripe.com`. See [host patterns](/documentation/platform/agent-proxy/proxied-services#host-patterns) for wildcards, ports, and paths.- </ParamField>+ + </Step>+ <Step title="Header Rewrites">+ This step is skipped automatically for GitHub. The token does travel in the `Authorization` header, but this template handles that with **Secret Substitution** (next step): the agent itself puts a placeholder in the header, and the proxy swaps it for the real token.+ </Step>+ <Step title="Secret Substitution">+ Select `GITHUB_PAT` as the secret holding the real value.- Under **Header Rewriting**, keep the pre-filled `Authorization` header with the `Bearer` prefix and select `STRIPE_API_KEY` as the value. This tells the agent proxy to set `Authorization: Bearer <real-stripe-key>` on every request to `api.stripe.com`.+ Here is how the pieces fit together. When your agent connects, it gets an environment variable `GITHUB_TOKEN` (the placeholder name the GitHub template uses) set to the fake `ghp_…` placeholder. The agent uses it like any GitHub token and sends `Authorization: Bearer <placeholder>`. As the request passes through the proxy, the placeholder is replaced with the real value of your `GITHUB_PAT` secret. The template scopes this swap to headers, since that is where GitHub expects the token; a substitution can also target the URL path, query, or body.- See [Proxied Services](/documentation/platform/agent-proxy/proxied-services) for basic auth, custom headers, and credential substitution.+ </Step>- <Step title="Create two machine identities">- Create two [machine identities](/documentation/platform/identities/machine-identities) with [Universal Auth](/documentation/platform/identities/universal-auth) and add both to your project:+ <Step title="Review and create">+ Double-check the host pattern and the substitution rule, then click **Create Proxied Service**.++ + </Step>+</Steps>++<Note>+ Not on the template list? Pick **Custom** and configure a [header rewrite or secret substitution](/documentation/platform/agent-proxy/proxied-services) by hand.+</Note>++## 3. Create the proxy identity++The proxy and the agent authenticate as **two separate machine identities with opposite access**. That split is the whole security model: the proxy can read your secrets, the agent never can.++**The proxy identity reads the secrets.**++<Steps>+ <Step title="Create the identity">+ In your project, go to **Access Control → Machine Identities** and click **Add Machine Identity to Project → Create New**. Name it (for example `agent-proxy`) and create it.++ + </Step>+ <Step title="Generate a Client Secret">+ Open the identity and go to its [Universal Auth](/documentation/platform/identities/universal-auth) authentication method.++ ++ Click **Add Client Secret**.- 1. **Agent proxy identity**: it fetches the real credential values, so grant it `Read Value` and `Describe Secret` on the **Secrets** its services reference.- 2. **Agent identity**: it routes traffic through proxied services but should not read any secret values, so grant it only `Proxy` on **Proxied Services**.+ - <Note>- Grant these permissions with a [custom role](/documentation/platform/access-controls/role-based-access-controls) or an [additional privilege](/documentation/platform/access-controls/additional-privileges) on each identity, scoped to the specific environments and paths you need. Running more than one agent? See [how many machine identities you need](/documentation/platform/agent-proxy/security#how-many-machine-identities-do-you-need).- </Note>+ Save the **Client ID** and the **Client Secret**; you will pass both to the proxy in step 5.</Step>- <Step title="Start the agent proxy">- On the machine that will run the agent proxy (ideally in the same private network as your agents, but not on the same machine), authenticate with the agent proxy identity and start it:+ <Step title="Grant it read access to the secrets">+ Grant it `Read Value` and `Describe Secret` on **Secrets** for the secrets your services reference. The quickest way is an [additional privilege](/documentation/platform/access-controls/additional-privileges) directly on the identity: open it and click **Add Additional Privileges**.+ ++ Add a **Secrets** policy allowing both `Read Value` and `Describe Secret`. A [custom role](/documentation/platform/access-controls/role-based-access-controls) with the same policy, assigned to the identity, works too.++ If you plan to broker [dynamic secrets](/documentation/platform/agent-proxy/proxied-services#using-dynamic-secrets) later, also allow `Manage Leases` on **Dynamic Secrets** while you are here. Only the proxy identity gets it; the agent identity never should.++ + </Step>+</Steps>++## 4. Create the agent identity++**The agent identity routes traffic but reads no secrets.** It needs the `Proxy` permission and nothing else.++<Steps>+ <Step title="Create the identity">+ In your project, go to **Access Control → Machine Identities** and click **Add Machine Identity to Project → Create New**. Name it (for example `agent`) and create it.++ + </Step>+ <Step title="Generate a Client Secret">+ Open the identity and add a **Client Secret** under Universal Auth, exactly as in the previous step. Save the **Client ID** and the **Client Secret**; you will pass both to the agent in step 6.+ </Step>+ <Step title="Grant it the Proxy permission">+ Grant it only `Proxy` on **Proxied Services**, scoped to the environment and path where your services live, the same way you granted the proxy identity's permissions.++ + </Step>+</Steps>++## 5. Start the agent proxy++<Steps>+ <Step title="Install the Infisical CLI">+ On the proxy host, a separate machine in your agent's private network, install the [Infisical CLI](/cli/overview). Or use Docker for the container option below.+ </Step>+ <Step title="Authenticate as the proxy identity">+ Set `INFISICAL_UNIVERSAL_AUTH_CLIENT_ID` and `INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET` to the Client ID and Client Secret you saved in step 3.++<Tabs>+ <Tab title="Infisical Cloud (US)">+ ```bash+ # Authenticate as the proxy identity (from step 3)+ export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<agent-proxy-client-id>+ export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<agent-proxy-client-secret>+ ```+ </Tab>+ <Tab title="Infisical Cloud (EU)">```bash+ # Authenticate as the proxy identity (from step 3), pointed at EU Cloudexport INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<agent-proxy-client-id>export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<agent-proxy-client-secret>+ export INFISICAL_DOMAIN=https://eu.infisical.com+ ```+ </Tab>+ <Tab title="Self-Hosted">+ ```bash+ # Authenticate as the proxy identity (from step 3), pointed at your instance+ export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<agent-proxy-client-id>+ export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<agent-proxy-client-secret>+ export INFISICAL_DOMAIN=https://infisical.your-domain.com+ ```+ </Tab>+</Tabs>++ </Step>+ <Step title="Start the proxy">+ The proxy listens on port `17322` by default. Use the CLI or Docker:+<Tabs>+ <Tab title="CLI">+ ```bashinfisical secrets agent-proxy start```+ </Tab>+ <Tab title="Docker">+ ```bash+ # -e without a value passes through the variables you exported above+ docker run -p 17322:17322 \+ -e INFISICAL_UNIVERSAL_AUTH_CLIENT_ID \+ -e INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET \+ -e INFISICAL_DOMAIN \+ infisical/cli:latest secrets agent-proxy start+ ```+ </Tab>+</Tabs>- The proxy authenticates to Infisical, sets up its certificate chain, and listens on port `17322` by default. See the [CLI reference](/cli/commands/agent-proxy) for flags such as `--port` and `--unmatched-host`.+Remember this host's address; the next step points `INFISICAL_AGENT_PROXY_ADDRESS` at it. For production deployment, see [Deployment](/documentation/platform/agent-proxy/deployment).- <Note>- If you are self-hosting Infisical or using EU Cloud, point the CLI at your instance with `--domain` or the `INFISICAL_DOMAIN` environment variable (for example `https://eu.infisical.com`).- </Note></Step>- <Step title="Connect an agent">- On the agent machine, authenticate with the agent identity and launch the agent through the `connect` wrapper. Everything after `--` is the agent's own start command:+</Steps>++## 6. Connect your agent+<Steps>+ <Step title="Install the Infisical CLI">+ On the agent host, install the [Infisical CLI](/cli/overview); `connect` is a CLI command.+ </Step>+ <Step title="Set the connection details">+ Set the agent's authentication and connection details as environment variables:++<Tabs>+ <Tab title="Infisical Cloud (US)">```bash+ # Authenticate as the agent identity (from step 4)export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<agent-client-id>export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<agent-client-secret>++ # Scope: your project, plus the environment and folder from step 1+ export INFISICAL_PROJECT_ID=<project-id>+ export INFISICAL_ENVIRONMENT=dev+ export INFISICAL_SECRET_PATH=/coding-agent++ # The agent proxy to route through (from step 5)+ export INFISICAL_AGENT_PROXY_ADDRESS=<proxy-host>:17322```+ </Tab>+ <Tab title="Infisical Cloud (EU)">+ ```bash+ # Authenticate as the agent identity (from step 4), pointed at EU Cloud+ export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<agent-client-id>+ export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<agent-client-secret>+ export INFISICAL_DOMAIN=https://eu.infisical.com- <Tabs>- <Tab title="Claude Code">- ```bash- infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 \- --projectId=<project-id> --env=prod --path=/ai-agents -- claude- ```- </Tab>- <Tab title="Codex">- ```bash- infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 \- --projectId=<project-id> --env=prod --path=/ai-agents -- codex- ```- </Tab>- <Tab title="Any command">- ```bash- infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 \- --projectId=<project-id> --env=prod --path=/ai-agents -- <your-agent-command>- ```- </Tab>- </Tabs>-- Before starting the agent, the wrapper:-- - Routes the agent's traffic through the agent proxy (`HTTPS_PROXY`, `HTTP_PROXY`).- - Downloads your organization's root CA certificate and points the common trust variables (`SSL_CERT_FILE`, `NODE_EXTRA_CA_CERTS`, `REQUESTS_CA_BUNDLE`, `CURL_CA_BUNDLE`, and others) at it, so the agent's HTTP clients accept the proxy's certificates.- - Sets dummy placeholder environment variables for any credential-substitution services.- - Sets environment variables with real values for regular secrets the agent identity has **Read Value** on in the folder (including secrets imported into it), similar to `infisical run`.-- <Note>- Real values in the agent's environment are deliberate and opt-in. When the agent identity has only the proxy permission and no secret read access, nothing real lands in the environment unless an admin explicitly grants **Read Value** on specific secrets. Brokered credentials never appear in the agent's environment; the proxy only attaches them on the wire.- </Note>-- The project can also be set via `INFISICAL_PROJECT_ID` or an `.infisical.json` file (created by `infisical init`) instead of `--projectId`.- </Step>- <Step title="Verify it works">- You can watch the proxy attach a credential by calling an echo service that reflects request headers back. Add a secret `TEST_API_KEY` to the folder, create a proxied service for it (host pattern `postman-echo.com`, header `Authorization` with prefix `Bearer`, secret `TEST_API_KEY`), then run a plain `curl` through the wrapper:+ # Scope: your project, plus the environment and folder from step 1+ export INFISICAL_PROJECT_ID=<project-id>+ export INFISICAL_ENVIRONMENT=dev+ export INFISICAL_SECRET_PATH=/coding-agent+ # The agent proxy to route through (from step 5)+ export INFISICAL_AGENT_PROXY_ADDRESS=<proxy-host>:17322+ ```+ </Tab>+ <Tab title="Self-Hosted">```bash- infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 \- --projectId=<project-id> --env=prod --path=/ai-agents -- \- curl https://postman-echo.com/headers+ # Authenticate as the agent identity (from step 4), pointed at your instance+ export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<agent-client-id>+ export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<agent-client-secret>+ export INFISICAL_DOMAIN=https://infisical.your-domain.com++ # Scope: your project, plus the environment and folder from step 1+ export INFISICAL_PROJECT_ID=<project-id>+ export INFISICAL_ENVIRONMENT=dev+ export INFISICAL_SECRET_PATH=/coding-agent++ # The agent proxy to route through (from step 5)+ export INFISICAL_AGENT_PROXY_ADDRESS=<proxy-host>:17322```+ </Tab>+</Tabs>++ </Step>+ <Step title="Launch the agent">+ Launch the agent through `connect`. Everything after `--` is the agent's own command:++<Tabs>+ <Tab title="Claude Code">+ ```bash+ infisical secrets agent-proxy connect -- claude+ ```+ </Tab>+ <Tab title="Codex">+ ```bash+ infisical secrets agent-proxy connect -- codex+ ```+ </Tab>+ <Tab title="Any command">+ ```bash+ infisical secrets agent-proxy connect -- <your-agent-command>+ ```+ </Tab>+</Tabs>++The agent starts and behaves exactly as if you had launched it directly; nothing about it looks different. In its environment it finds `GITHUB_TOKEN`, set by `connect` to the fake placeholder, and uses it like a normal token. Its traffic now routes through the proxy: on calls to `api.github.com` the placeholder is swapped for the real token, and everything else passes through untouched. The next step makes that visible.++<Note>+ Every setting here can also be passed as a flag or set in `.infisical.json`. See [Connecting Agents](/documentation/platform/agent-proxy/connecting-agents) for how `connect` works and what it puts in the agent's environment.+</Note>- The echoed headers include `"authorization": "Bearer <your TEST_API_KEY value>"`. `curl` sent no credential; the proxy attached it on the way out. The same happens to `api.stripe.com` with the service from step 2. Requests to hosts with no proxied service are forwarded untouched by default (see [unmatched hosts](/documentation/platform/agent-proxy/security#unmatched-hosts)).</Step></Steps>-## Next Steps+## 7. Verify it works++Each method below makes the same `GET /user` call to `api.github.com`. The client sends only the `ghp_…` placeholder that `connect` put in the environment; as the request passes through the proxy, the placeholder is swapped for the real value of your `GITHUB_PAT` secret. GitHub returns your account profile even though the real token never reached the client. That is the whole point: real authenticated work without the caller ever holding the credential.++<Tabs>+ <Tab title="Through your agent">+ The agent you launched in step 6 is already brokering. In its session, send:++ > Run `gh api user` and show me the output.++ [GitHub's `gh` CLI](https://cli.github.com/) reads `GITHUB_TOKEN` from the environment on its own, so the agent needs no token wiring; it just runs the command and GitHub returns your profile. Requires `gh` on the host where the agent runs.+ </Tab>+ <Tab title="gh CLI">+ Not driving an interactive agent? Run the check through `connect` directly, in the shell where you set the step 6 variables:++ ```bash+ infisical secrets agent-proxy connect -- gh api user+ ```++ `gh` reads `GITHUB_TOKEN` automatically, so there is nothing else to pass. Requires `gh` on the host where you run this.+ </Tab>+ <Tab title="curl">+ No `gh`? Any HTTP client works the same way. `curl` sends the placeholder in the header and the proxy swaps it:++ ```bash+ infisical secrets agent-proxy connect -- \+ sh -c 'curl -sS https://api.github.com/user -H "Authorization: Bearer $GITHUB_TOKEN"'+ ```+ </Tab>+</Tabs>++<Note>+ Getting a `401`? The proxy could not apply the credential and forwarded the placeholder unchanged (it does not block the call). Check the proxy's logs, and confirm the agent identity has `Proxy` on the service and the proxy identity has `Read Value` on `GITHUB_PAT`.+</Note>++## Next steps-- Configure [host patterns, header rewriting, and credential substitution](/documentation/platform/agent-proxy/proxied-services) in depth.-- Understand the [isolation and trust model](/documentation/platform/agent-proxy/security) behind the proxy.-- Browse every flag in the [CLI reference](/cli/commands/agent-proxy).+<CardGroup cols={2}>+ <Card title="Proxied Services" icon="right-left" href="/documentation/platform/agent-proxy/proxied-services">+ Host patterns, header rewrites, and secret substitution in depth.+ </Card>+ <Card title="Deployment" icon="server" href="/documentation/platform/agent-proxy/deployment">+ Take the Agent Proxy to production: placement, deployment methods, and HA.+ </Card>+</CardGroup>diff --git a/docs/documentation/platform/agent-proxy/security.mdx b/docs/documentation/platform/agent-proxy/security.mdxindex c38ea9154d..61afe3bd18 100644--- a/docs/documentation/platform/agent-proxy/security.mdx+++ b/docs/documentation/platform/agent-proxy/security.mdx@@ -1,76 +1,40 @@----title: "Security & Architecture"-description: "How the agent proxy isolates agents, manages trust, and stays available."+title: "Security"+description: "Understand how the Agent Proxy isolates agents, authenticates requests, and manages trust."----This page covers what is happening under the hood of the agent proxy: how every request is authenticated, how agents stay isolated from each other and from real credentials, how TLS interception works, and how the proxy behaves at scale. You do not need any of this to get started (see the [Quickstart](/documentation/platform/agent-proxy/quickstart)), but it is worth reading before running the proxy in production.+This page covers the Agent Proxy's security model: how agents stay isolated from each other and from real credentials, how requests are authenticated and authorized, how TLS interception works, and what access each identity needs. None of this is required to get started (see the [Quickstart](/documentation/platform/agent-proxy/quickstart)), but it is worth reading before running the Agent Proxy in production.-## Isolation Model+## Isolation model-The proxy is pinned to one organization, the one its own machine identity belongs to, but nothing narrower: no project, environment, path, or services are configured on it. It discovers those per agent. When an agent connects, the proxy uses the agent's token to look up which proxied services that agent may use in the agent's folder scope, then fetches the real secret values with its own machine identity. This means one proxy instance can serve many agents across projects and environments in the org while keeping them isolated: an agent can never receive credentials it was not granted **Proxy** access to, even on a shared proxy.+The Agent Proxy is pinned to one organization, the one its own [machine identity](/documentation/platform/identities/machine-identities) belongs to, but nothing narrower: no project, environment, path, or services are configured on it. It discovers those per agent. When an agent connects, the Agent Proxy uses the agent's token to look up which proxied services that agent may use in the agent's folder scope. It then fetches the real secret values with its own machine identity. One Agent Proxy instance can serve many agents across projects and environments in the org while keeping them isolated: an agent can never receive credentials it was not granted **Proxy** access to, even on a shared instance.-## Network Placement+## Agent authentication-The agent proxy is built for private-network deployment. A well-placed proxy looks like this:+The Agent Proxy's security boundary is machine **identity**: what an agent can reach is decided entirely by its permissions:-- **Inside your private network, off the public internet.** The proxy's listening port should only ever be reachable from within your network.-- **Reachable only by your agent machines.** Restrict inbound access to the proxy port to the hosts that run agents, using your usual controls (security groups, firewall rules, network policies).-- **On its own host.** Same network as the agents for low per-request latency, but a separate machine, which keeps the real credentials fully isolated from the agents.-- **Alongside any plain-HTTP upstreams.** Internal services the proxy reaches over plain HTTP belong inside the same trusted network.-- **Credentials where they are used.** Provision the proxy identity's client credentials only on the proxy host, and each agent identity's only on its agent machine.+- Every proxied request carries the agent's short-lived machine identity token in the proxy-authentication header. A request that arrives with no proxy-authentication header is challenged with `407` and a `Proxy-Authenticate: Basic` response. A request whose token is present but invalid, expired, or revoked is rejected with `403`. Both checks happen before anything else.+- The Agent Proxy grants nothing on its own. For each agent it asks Infisical which proxied services that agent's identity holds the **Proxy** permission on, within the agent's exact project, environment, and folder scope. Credentials are applied only for those services; everything else does not exist as far as that agent is concerned.+- The agent's identity cannot read secret values. Only the Agent Proxy's own identity can, and it lives on a separate machine. Even if an agent is tricked into leaking its token, that token grants no ability to fetch a secret; it can only route traffic through the same services the agent could already reach.+- Authorization is re-checked, not granted once. The Agent Proxy re-validates each active agent's permissions on every poll and fails closed. See [Caching and polling](/documentation/platform/agent-proxy/deployment#caching-and-polling) for the interval and exactly what happens when a grant is revoked.-Outbound, the proxy only needs to reach your Infisical instance and the APIs your proxied services define.+## Certificates & TLS interception-## Agent Authentication--The security boundary of the agent proxy is **identity**, not certificates. Certificates only make TLS interception possible; what an agent can reach is decided entirely by machine identity permissions:--- Every proxied request carries the agent's short-lived machine identity token. A request without a valid token is rejected (`407`) before anything else happens.-- The proxy grants nothing on its own. For each agent it asks Infisical which proxied services that agent's identity holds the **Proxy** permission on, within the agent's exact project, environment, and folder scope. Credentials are applied only for those services; everything else does not exist as far as that agent is concerned.-- The agent's identity cannot read secret values. Only the proxy's own identity can, and it lives on a separate machine. Even if an agent is tricked into leaking its token, that token grants no ability to fetch a secret; it can only route traffic through the same services the agent could already reach.-- Authorization is re-checked continuously. The proxy re-validates each active agent's permissions every poll interval (60 seconds by default) and fails closed: revoke the identity, its role, or its Proxy grant, and the proxy drops the cached credentials and stops applying them.--## Connections--Agents do not talk to the proxy directly; they are launched through `infisical secrets agent-proxy connect -- <agent command>`, which prepares the environment. Each proxied request carries the agent's Infisical token and folder scope in the standard proxy authorization mechanism, which is how the proxy knows which agent is asking and which folder's services apply.--A few connection-level behaviors to be aware of:--- Both HTTPS and plain-HTTP services are brokered. HTTPS traffic arrives as standard `CONNECT` tunnels; plain `http://` traffic arrives as regular forward-proxy requests (useful for internal services without TLS). Requests for `https://` URLs sent as plain forward-proxy requests are rejected so the proxy can never be used to downgrade TLS.-- `NO_PROXY` in the agent's environment always includes `localhost,127.0.0.1`, so local traffic bypasses the proxy. Additional bypass hosts can be added via the `--no-proxy` flag on `connect` or an existing `NO_PROXY` variable.-- Requests from an agent whose token has expired or been revoked fail closed: the proxy drops that agent's cached credentials as soon as it notices, and stops applying them.--## Certificates & TLS Interception--For the proxy to read and modify HTTPS requests, agents must trust the certificates it presents. This is trust plumbing rather than access control: the chain exists so the proxy can open TLS traffic that agents deliberately send it, and holding a certificate grants no access to any secret. It has three tiers, and the sensitive part never leaves Infisical:+For the Agent Proxy to read and modify HTTPS requests, agents must trust the certificates it presents. The chain has three tiers, and the sensitive part never leaves Infisical:```mermaidflowchart LR- A["Root CA<br/>(in Infisical, per org)"] -->|signs| B["Intermediate CA<br/>(in agent proxy memory)"]+ A["Root CA<br/>(in Infisical, per org)"] -->|signs| B["Intermediate CA<br/>(in Agent Proxy memory)"]B -->|signs| C["Leaf certificates<br/>(one per hostname)"]```-The root CA is generated automatically per organization and stored encrypted in Infisical; its private key never leaves the server, and all signing happens server-side. At startup, the proxy generates a keypair locally and has Infisical sign it into a short-lived intermediate certificate (7 days, re-signed automatically before expiry) that can mint leaf certificates but no further CAs. Leaf certificates (valid 24 hours, cached in memory) are minted locally per hostname, for the exact hostname the agent requested, with no Infisical round-trip.--On the agent machine, the `connect` wrapper downloads the root CA to `~/.infisical/agent-proxy/mitm-ca.pem` and points the standard trust environment variables (`SSL_CERT_FILE`, `NODE_EXTRA_CA_CERTS`, `REQUESTS_CA_BUNDLE`, `CURL_CA_BUNDLE`, `GIT_SSL_CAINFO`, `DENO_CERT`) at it. The proxy's connection to the real service is standard HTTPS with normal certificate verification, so real credentials always travel encrypted.+The root CA is generated automatically per organization and stored encrypted in Infisical; its private key never leaves the server, and all signing happens server-side. At startup, the Agent Proxy generates a keypair locally and has Infisical sign it into a short-lived intermediate certificate (7 days, re-signed automatically before expiry). This certificate can mint leaf certificates but no further CAs. Leaf certificates (valid 24 hours, cached in memory) are minted locally per hostname, for the exact hostname the agent requested, with no Infisical round-trip.-<Note>- Place the proxy according to the [network placement](#network-placement) guidance above; it is built for private-network deployment.-</Note>+On the agent machine, the `connect` wrapper downloads the root CA to `~/.infisical/agent-proxy/mitm-ca.pem` and points the standard trust environment variables (`SSL_CERT_FILE`, `NODE_EXTRA_CA_CERTS`, `REQUESTS_CA_BUNDLE`, `CURL_CA_BUNDLE`, `GIT_SSL_CAINFO`, `DENO_CERT`) at it. The Agent Proxy's connection to the real service is standard HTTPS with normal certificate verification, so real credentials always travel encrypted.## Permissions-Proxied services have their own project-level permission subject, with five actions:--| Action | What it allows |-| --- | --- |-| **Read** | View proxied services and their configuration |-| **Create** | Create new proxied services |-| **Edit** | Update a service's host patterns, secrets, or enabled state |-| **Delete** | Delete proxied services |-| **Proxy** | Route traffic through the service and have secrets applied |--**Proxy** is meant for agent machine identities: an identity with Proxy gets a service's secrets applied to its traffic without ever being able to read the values.+Proxied services have their own project-level permission subject. Alongside the usual **Read**, **Create**, **Modify**, and **Remove** actions for managing services, it adds the one that defines the security model: **Proxy**. An identity with **Proxy** has a service's secrets applied to its traffic without ever being able to read the values, which is why it is the permission you grant agent machine identities.### Roles@@ -78,50 +42,24 @@ Grant each identity the minimum permissions it needs with a [custom role](/docum| Identity | Minimum permissions | Notes || --- | --- | --- |-| **Agent** | `Proxy` on **Proxied Services**, scoped to the environments and paths where its services live | This alone lets it route traffic and have credentials applied. It does not need to read any secret. Add `Read Value` on **Secrets** only for values the agent uses directly (not brokered ones). |-| **Agent Proxy** | `Read Value` and `Describe Secret` on **Secrets**, covering every secret the services reference; plus `Lease` on **Dynamic Secrets** for any dynamic secret a service brokers | This is the identity that actually fetches the real values and mints leases. `Describe Secret` determines whether a secret is visible to the identity at all, `Read Value` reveals its value, and `Lease` lets it mint a brokered dynamic secret. It needs no proxied-service permission. |+| **Agent** | `Proxy` on **Proxied Services**, scoped to the environments and paths where its services live | This alone lets it route traffic and have credentials applied. It does not need to read any secret. |+| **Agent Proxy** | `Read Value` and `Describe Secret` on **Secrets**, covering every secret the services reference; plus `Manage Leases` on **Dynamic Secrets** for any dynamic secret a service brokers | This is the identity that actually fetches the real values and mints leases. `Describe Secret` determines whether a secret is visible to the identity at all, `Read Value` reveals its value, and `Manage Leases` lets it mint a brokered dynamic secret. It needs no proxied-service permission. |<Note>- An agent identity should be scoped to just the proxy permission, with no secret read access. If an agent also needs real values in its environment, grant its identity **Read Value** on those specific secrets. Avoid granting folder-wide read access to an agent identity: that would also expose the brokered secrets and defeat the purpose of brokering them.+ An agent identity should be scoped to just the **Proxy** permission, with no secret read access. If an agent also needs real values in its environment, grant its identity **Read Value** on those specific secrets. Avoid granting folder-wide read access to an agent identity: that would also expose the brokered secrets and defeat the purpose of brokering them.</Note>-The key thing to get right for the agent proxy: it needs **Read Value on every secret referenced by every service any of its agents use**, across the relevant environments and paths. If a referenced secret comes from a [secret import](/documentation/platform/agent-proxy/proxied-services#using-secrets), the read permission has to cover the secret's real location (the import source), not just the folder it is imported into. If a grant is missing, that credential is skipped.--For a service that brokers a [dynamic secret](/documentation/platform/agent-proxy/proxied-services#using-dynamic-secrets), the proxy identity needs `Lease` on it instead of `Read Value` — and the agent identity must **not** have `Lease` on it, or `agent-proxy connect` refuses to start.--### How Many Machine Identities Do You Need?--A [machine identity](/documentation/platform/identities/machine-identities) is how Infisical knows who is asking and what they are allowed to access. So the number you need is not a technical limit; it follows from how you want access divided:--- **One for the agent proxy.** A single proxy identity serves any number of agents, and multiple proxy instances behind a load balancer share the same one.-- **One per distinct agent scope.** Agents that should have exactly the same access can share an identity: a fleet of interchangeable workers doing the same job is one scope, so one identity is fine. Agents that reach different services, environments, or paths each get their own.--Sharing one identity between agents that need *different* access also works, but it means granting that identity the union of everything any of them needs: each agent then carries access it does not use, a compromised agent exposes the whole union, revoking the identity cuts off every agent at once, and audit logs cannot tell the agents apart.--## Caching and Polling--The proxy keeps everything it needs in memory, so steady-state requests involve no Infisical calls:--- **First request from an agent**: the proxy discovers all proxied services in the agent's scope and fetches the referenced secret values. This first request is slightly slower; every subsequent request from that agent, to any host, is served from cache.-- **Refresh**: every 60 seconds (configurable via `--poll-interval`), the proxy re-fetches services, permissions, and secret values for active agents. Changes such as a rotated secret, an edited service, or a revoked permission take effect within one poll interval, with no agent restart.-- **Eviction**: an agent idle for about 10 minutes has its cache dropped and polling stopped. Its next request simply triggers a fresh discovery.-- **API load**: polling grows with the number of active agents. With a large fleet or a short `--poll-interval`, factor in your instance's API rate limits; a longer interval reduces load at the cost of slower propagation.--## Unmatched Hosts--When an agent requests a host no proxied service matches, the `--unmatched-host` flag decides what happens:--- `allow` (default): the request is forwarded untouched, with no credentials applied. This is the normal mode, because much of an agent's traffic does not need a brokered credential at all: reading documentation, cloning public repos, installing packages, or calling services the agent legitimately authenticates to itself (for example, with a real secret in its environment because its identity has **Read Value** on it). All of that flows through untouched, while matched hosts still get credentials applied.-- `block`: the request is rejected with `403`. Use this to restrict agents to an allowlist of exactly the services you have defined.--<Note>- `block` applies to 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>+The key thing to get right for the Agent Proxy: it needs **Read Value on every secret referenced by every service any of its agents use**, across the relevant environments and paths. If a referenced secret comes from a [secret import](/documentation/platform/agent-proxy/proxied-services#using-secrets-from-other-folders-and-environments), the read permission has to cover the secret's real location (the import source), not just the folder it is imported into. If a grant is missing, that credential is skipped.-## High Availability+For a service that brokers a [dynamic secret](/documentation/platform/agent-proxy/proxied-services#using-dynamic-secrets), the Agent Proxy identity needs `Manage Leases` on that dynamic secret. The agent identity must **not** have `Manage Leases` on it, or `agent-proxy connect` refuses to start.-Run multiple proxy instances with the same machine identity behind a TCP load balancer. Instances coordinate through Infisical rather than with each other:+## Next steps-- All instances chain to the same per-organization root CA, so agents trust any instance. Each instance signs its own intermediate.-- Each instance keeps its own agent cache. If the load balancer moves an agent to a new instance, that instance does one fresh discovery and then serves from cache.-- Each instance polls Infisical independently. After a secret rotation, instances may briefly apply different values until their next poll (up to one poll interval).+<CardGroup cols={2}>+ <Card title="Deployment" icon="server" href="/documentation/platform/agent-proxy/deployment">+ Take the Agent Proxy to production: placement, deployment methods, and HA.+ </Card>+ <Card title="Connecting Agents" icon="plug" href="/documentation/platform/agent-proxy/connecting-agents">+ Launch an agent behind the proxy and control what its environment holds.+ </Card>+</CardGroup>diff --git a/docs/images/platform/agent-proxy/add-proxied-service-menu.png b/docs/images/platform/agent-proxy/add-proxied-service-menu.pngnew file mode 100644index 0000000000..dfce24e364Binary files /dev/null and b/docs/images/platform/agent-proxy/add-proxied-service-menu.png differdiff --git a/docs/images/platform/agent-proxy/header-rewrites.png b/docs/images/platform/agent-proxy/header-rewrites.pngnew file mode 100644index 0000000000..3f2cb882e1Binary files /dev/null and b/docs/images/platform/agent-proxy/header-rewrites.png differdiff --git a/docs/images/platform/agent-proxy/quickstart-add-additional-privileges.png b/docs/images/platform/agent-proxy/quickstart-add-additional-privileges.pngnew file mode 100644index 0000000000..74411f71aeBinary files /dev/null and b/docs/images/platform/agent-proxy/quickstart-add-additional-privileges.png differdiff --git a/docs/images/platform/agent-proxy/quickstart-add-client-secret.png b/docs/images/platform/agent-proxy/quickstart-add-client-secret.pngnew file mode 100644index 0000000000..1266e289e1Binary files /dev/null and b/docs/images/platform/agent-proxy/quickstart-add-client-secret.png differdiff --git a/docs/images/platform/agent-proxy/quickstart-add-proxied-service.png b/docs/images/platform/agent-proxy/quickstart-add-proxied-service.pngnew file mode 100644index 0000000000..dfce24e364Binary files /dev/null and b/docs/images/platform/agent-proxy/quickstart-add-proxied-service.png differdiff --git a/docs/images/platform/agent-proxy/quickstart-add-secret.png b/docs/images/platform/agent-proxy/quickstart-add-secret.pngnew file mode 100644index 0000000000..cd2fe1d133Binary files /dev/null and b/docs/images/platform/agent-proxy/quickstart-add-secret.png differdiff --git a/docs/images/platform/agent-proxy/quickstart-agent-identity-role.png b/docs/images/platform/agent-proxy/quickstart-agent-identity-role.pngnew file mode 100644index 0000000000..786f44e9d0Binary files /dev/null and b/docs/images/platform/agent-proxy/quickstart-agent-identity-role.png differdiff --git a/docs/images/platform/agent-proxy/quickstart-create-agent-identity.png b/docs/images/platform/agent-proxy/quickstart-create-agent-identity.pngnew file mode 100644index 0000000000..ec13ccb7ccBinary files /dev/null and b/docs/images/platform/agent-proxy/quickstart-create-agent-identity.png differdiff --git a/docs/images/platform/agent-proxy/quickstart-create-identity.png b/docs/images/platform/agent-proxy/quickstart-create-identity.pngnew file mode 100644index 0000000000..907b591e50Binary files /dev/null and b/docs/images/platform/agent-proxy/quickstart-create-identity.png differdiff --git a/docs/images/platform/agent-proxy/quickstart-proxy-identity-role.png b/docs/images/platform/agent-proxy/quickstart-proxy-identity-role.pngnew file mode 100644index 0000000000..b9c806bcffBinary files /dev/null and b/docs/images/platform/agent-proxy/quickstart-proxy-identity-role.png differdiff --git a/docs/images/platform/agent-proxy/quickstart-review.png b/docs/images/platform/agent-proxy/quickstart-review.pngnew file mode 100644index 0000000000..d0deced149Binary files /dev/null and b/docs/images/platform/agent-proxy/quickstart-review.png differdiff --git a/docs/images/platform/agent-proxy/quickstart-template-picker.png b/docs/images/platform/agent-proxy/quickstart-template-picker.pngnew file mode 100644index 0000000000..7c4318d8b0Binary files /dev/null and b/docs/images/platform/agent-proxy/quickstart-template-picker.png differdiff --git a/docs/images/platform/agent-proxy/quickstart-universal-auth.png b/docs/images/platform/agent-proxy/quickstart-universal-auth.pngnew file mode 100644index 0000000000..22bc4fdec5Binary files /dev/null and b/docs/images/platform/agent-proxy/quickstart-universal-auth.png differdiff --git a/docs/images/platform/agent-proxy/secret-substitution.png b/docs/images/platform/agent-proxy/secret-substitution.pngnew file mode 100644index 0000000000..364c62126aBinary files /dev/null and b/docs/images/platform/agent-proxy/secret-substitution.png differdiff --git a/docs/images/platform/agent-proxy/service-details.png b/docs/images/platform/agent-proxy/service-details.pngnew file mode 100644index 0000000000..30ca20c424Binary files /dev/null and b/docs/images/platform/agent-proxy/service-details.png differdiff --git a/frontend/src/components/proxied-services/CreateProxiedServiceModal.tsx b/frontend/src/components/proxied-services/CreateProxiedServiceModal.tsxindex afc73b2629..dc10f0cf41 100644--- a/frontend/src/components/proxied-services/CreateProxiedServiceModal.tsx+++ b/frontend/src/components/proxied-services/CreateProxiedServiceModal.tsx@@ -75,7 +75,7 @@ export const CreateProxiedServiceModal = ({<><SheetTitle>Choose a template</SheetTitle><SheetDescription>- Pick a service to get a head start, or start from scratch.+ Pick a service to get a head start, or set one up yourself.</SheetDescription></>) : (diff --git a/frontend/src/components/proxied-services/ProxiedServiceTemplateSelect.tsx b/frontend/src/components/proxied-services/ProxiedServiceTemplateSelect.tsxindex b82153412b..d2cde476a3 100644--- a/frontend/src/components/proxied-services/ProxiedServiceTemplateSelect.tsx+++ b/frontend/src/components/proxied-services/ProxiedServiceTemplateSelect.tsx@@ -69,15 +69,14 @@ const CustomCard = ({ onClick }: { onClick: () => void }) => (onClick={onClick}className="group flex cursor-pointer flex-col gap-3 rounded-md border border-dashed border-mineshaft-500 bg-card p-4 text-left transition-colors hover:border-mineshaft-400 hover:bg-mineshaft-700/50">- <div className="flex items-start justify-between gap-2">+ <div className="flex items-start gap-2"><div className="flex h-9 w-9 items-center justify-center rounded-md bg-mineshaft-700"><PlusIcon className="h-5 w-5 text-bunker-300" /></div>- <span className="text-[10px] font-medium tracking-wider text-muted uppercase">Custom</span></div><div className="flex flex-col gap-1">- <p className="text-sm font-semibold text-foreground">Start from scratch</p>- <p className="text-xs leading-relaxed text-muted">Set up your own service by hand.</p>+ <p className="text-sm font-semibold text-foreground">Custom</p>+ <p className="text-xs leading-relaxed text-muted">Set up any service manually.</p></div></button>);