---
title: How to Connect Through the Codex CLI Proxy (public)
description: Start a local doctl proxy so your local Codex CLI drives a hosted Codex session.
product: Managed Agents
url: https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/how-to/use-codex-proxy/
last_updated: "2026-09-21"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# How to Connect Through the Codex CLI Proxy (public)

DigitalOcean Harness Runtime provides managed, hardware-isolated microVM sandboxes with built-in tools such as Chromium to run harnesses and execute arbitrary code. Rich lifecycle APIs preserve conversational history and working state across sessions, letting you pause, resume, and fork work to control costs and adapt to the nonlinear nature of agentic workflows. Scale complete agents such as Claude Code or use sandboxes independently for code execution, all through the same service. See [What You Can Build](https://docs.digitalocean.com/products/managed-agents/agent-harness-runtime/details/what-you-can-build/index.html.md) for example use cases.

For Codex sessions, you can drive a hosted session from your local Codex CLI through a local proxy started by `doctl`.

To connect through the Codex CLI proxy, start a local proxy and connect your local Codex CLI to it. In a terminal, start the proxy for the session:

```shell
doctl harness-runtime start-proxy --type codex --session <session-name-or-id>
```

By default, the proxy listens on local port `1144`. You can optionally bind to a different port using the `--port` argument.

Stop the proxy with `Ctrl+C`.

**Note**:

  Avoid `Ctrl+Z`, which suspends the process and can leave port `1144` locked.

Next, open another terminal and point Codex at the proxy:

```shell
codex --remote ws://127.0.0.1:1144
```

You can now send prompts to the hosted session through your local Codex interface. Shell commands and some tool calls render in the Codex TUI, and interactive approval prompts follow your agent policy.

To stop a stuck turn, disconnect or terminate the proxy.

When you start the proxy, your session does not auto pause.