<!-- https://avertgate.com/docs/reverse-proxy · Integration -->

# HTTP reverse proxy

For agents that don't use MCP (REST-based ones such as the OpenAI or Anthropic APIs) AvertGate runs as an HTTP reverse proxy and scans the text in request and response bodies.

<!-- terminal -->
```
npx @avertgate/cli proxy \
  --port 8080 \
  --upstream https://api.openai.com \
  --policy policy.yaml
```

## How body inspection works

The proxy extracts the text to inspect from request/response bodies: OpenAI-style `messages` arrays (including text parts and `tool_calls`) and other common shapes. The extracted text goes through the same egress/ingress scanners.

## Path-based routing

Different path prefixes can be routed to different upstreams (e.g. `/v1/messages` → Anthropic). The tool name is built as `http_proxy:METHOD /path`; UUIDs and numeric ids are normalised to `:uuid` and `:id`.

## SSRF protection

The upstream cannot be changed dynamically via the `x-upstream-url` header (off by default). If enabled, only `http`/`https` is accepted; if an allowed-hosts list is given only those hosts are usable, otherwise anything except `localhost`, the cloud metadata address, `.local`/`.internal` names and RFC1918 private ranges.

> **Scope**: The reverse proxy uses the same policy engine and audit log as the MCP proxy.
