> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a proxy

> Create an Agent Vault proxy with the Node.js SDK.

`client.agentVault().proxies.create()` creates a [proxy](https://infisical.com/docs/documentation/platform/agent-vault/proxies) and its proxy token. The client must log in as a user or machine identity with the **Admin** role in the [Agent Vault project](https://infisical.com/docs/documentation/platform/agent-vault/access-control#product-membership).

## Parameters

**options** `object` *required*

**properties**

**projectId** `string` *required*

The ID of the [Agent Vault project](https://infisical.com/docs/documentation/platform/agent-vault/projects.md#find-the-project-id) to create the proxy in.

**name** `string` *required*

The name of the proxy, in lowercase letters, numbers, and hyphens (up to 64 characters).

**trafficPolicy** `AgentVaultTrafficPolicy`

The proxy's [traffic policy](https://infisical.com/docs/documentation/platform/agent-vault/proxies#traffic-policy), either `AgentVaultTrafficPolicy.AnyHost` (`"any-host"`) to forward requests to any host or `AgentVaultTrafficPolicy.ServiceHosts` (`"service-hosts"`) to refuse requests to hosts that none of the session's services cover (defaults to `AgentVaultTrafficPolicy.AnyHost`).

**allowedHosts** `string[] | string`

Hosts that agents can reach under `AgentVaultTrafficPolicy.ServiceHosts` even if none of the session's services cover them, as an array or a comma-separated string (see [Exceptions](https://infisical.com/docs/documentation/platform/agent-vault/proxies#exceptions)).

**pollInterval** `number`

How often, in seconds, the proxy checks its sessions and settings with Infisical, from 10 to 300 (defaults to `60`).

**description** `string`

What the proxy is for (up to 256 characters, without line breaks or tabs).

## Returns

**result** `AgentVaultProxyWithTokenResponse`

The proxy in `proxy`, and its proxy token in `proxyToken` (Infisical returns the token only once).

To start the proxy with the proxy token, run one of the commands in [Create a proxy and start it](https://infisical.com/docs/documentation/platform/agent-vault/proxies#create-a-proxy-and-start-it).

```typescript Basic theme={"dark"}
const { proxy, proxyToken } = await client.agentVault().proxies.create({
  projectId: "<project-id>",
  name: "edge-proxy"
});
```

```typescript Service hosts only theme={"dark"}
import { AgentVaultTrafficPolicy } from "@infisical/sdk";

const { proxy, proxyToken } = await client.agentVault().proxies.create({
  projectId: "<project-id>",
  name: "edge-proxy",
  trafficPolicy: AgentVaultTrafficPolicy.ServiceHosts,
  allowedHosts: ["registry.npmjs.org", "registry.yarnpkg.com"],
  pollInterval: 60,
  description: "Proxy for CI runners"
});
```

```json Response theme={"dark"}
{
  "proxy": {
    "id": "f1e2d3c4-b5a6-4978-8a6b-5c4d3e2f1a0b",
    "name": "edge-proxy",
    "description": "Proxy for CI runners",
    "heartbeat": null,
    "isHealthy": false,
    "rootCaFingerprint": "<sha-256-fingerprint>",
    "rootCaExpiresAt": "2036-12-02T12:10:00.000Z",
    "trafficPolicy": "service-hosts",
    "allowedHosts": "registry.npmjs.org,registry.yarnpkg.com",
    "pollInterval": 60,
    "createdAt": "2026-12-02T12:10:00.000Z"
  },
  "proxyToken": "<proxy-token>"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.