> ## 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 Python SDK.

`client.agent_vault.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

**project\_id** `str` *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** `str` *required*

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

**traffic\_policy** `Union[AgentVaultTrafficPolicy, str]`

The proxy's [traffic policy](https://infisical.com/docs/documentation/platform/agent-vault/proxies#traffic-policy), either `AgentVaultTrafficPolicy.ANY_HOST` (`"any-host"`) to forward requests to any host or `AgentVaultTrafficPolicy.SERVICE_HOSTS` (`"service-hosts"`) to refuse requests to hosts that none of the session's services cover (defaults to `AgentVaultTrafficPolicy.ANY_HOST`; 1.1.0 calls `SERVICE_HOSTS` `AgentVaultTrafficPolicy.BUNDLE_HOSTS`, and that name still works).

**allowed\_hosts** `Union[List[str], str]`

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

**poll\_interval** `int`

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

**description** `str`

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

## Returns

**response** `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).

```python Basic theme={"dark"}
response = client.agent_vault.proxies.create(
    project_id="<project-id>",
    name="edge-proxy",
)
```

```python Service hosts only theme={"dark"}
from infisical_sdk import AgentVaultTrafficPolicy

response = client.agent_vault.proxies.create(
    project_id="<project-id>",
    name="edge-proxy",
    traffic_policy=AgentVaultTrafficPolicy.SERVICE_HOSTS,
    allowed_hosts=["pypi.org", "files.pythonhosted.org"],
    poll_interval=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": "pypi.org,files.pythonhosted.org",
    "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.