Files
PaperClipAI/packages/plugins/sandbox-providers/cloudflare/bridge-template
dependabot[bot] 2b8d92c769 build(deps-dev): bump @cloudflare/workers-types from 5.20261114.1 to 5.20261117.1 in /scripts/typecheck-sandbox-providers (#19570)
Bumps [@cloudflare/workers-types](https://github.com/cloudflare/workerd)
from 5.20261114.1 to 5.20261117.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cloudflare/workerd/releases">@​cloudflare/workers-types's
releases</a>.</em></p>
<blockquote>
<h2>PGO profiles</h2>
<p>The profiles that optimize the Linux release builds
(build/pgo/README.md). Don't delete them: build/pgo/profile.json names
one of them, as may older commits that are built again.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/cloudflare/workerd/commits">compare
view</a></li>
</ul>
</details>
<br />

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-20 18:10:34 -08:00
..

Cloudflare Sandbox Bridge Template

This Worker is the operator-facing bridge used by @paperclipai/plugin-cloudflare-sandbox.

It exposes a small authenticated JSON API under /api/paperclip-sandbox/v1 and translates Paperclip lease and command requests into Cloudflare Sandbox SDK calls.

What it does

  • health and probe
  • acquire, resume, release, and destroy leases
  • execute commands in a sandbox session
  • clean up timed-out sessions so Paperclip does not inherit wedged background processes

Prerequisites

  1. Cloudflare account with Sandbox / Containers access
  2. wrangler configured for that account
  3. Docker running locally for wrangler deploy
  4. A bridge auth token set as a Worker secret:
npx wrangler secret put BRIDGE_AUTH_TOKEN

Local development

cd bridge-template
pnpm install --ignore-workspace --no-lockfile
pnpm test
pnpm typecheck
pnpm dev

Deploy

pnpm deploy

After deploy, configure Paperclip with:

  • bridgeBaseUrl: your Worker URL
  • bridgeAuthToken: the same bearer token value stored in BRIDGE_AUTH_TOKEN

Notes

  • reuseLease: true should only be used together with keepAlive: true
  • .workers.dev is fine for bridge HTTP traffic, but preview/wildcard host flows are intentionally out of scope here
  • keep the Docker image aligned with the installed @cloudflare/sandbox version