For teams whose production database must never be reachable from the cloud: a slim container that runs inside your network, dials out to Codepanion, and executes the agent's read-only queries locally. No inbound ports, and your connection string never leaves your network.
Getting started
Using Codepanion
The connector is outbound-only. It opens a long-poll control channel to Codepanion and waits. When the agent needs your database, the query travels down that channel, the connector runs it locally — with the same read-only enforcement Codepanion applies everywhere (a read-only connection plus a transaction that is always rolled back, a 5-second timeout, and a 1,000-row cap) — and posts the result back. Your firewall stays closed.
Good to know
The database connection string is configured on your side, as an environment variable on the container. Codepanion never sees it, never stores it, and cannot connect to your database itself — every query is executed by the connector, inside your network, under read-only enforcement that runs on your side of the channel.
The connector authenticates with a token scoped connector — minted through the same API-token flow as your ingest key, with "scope": "connector". It can't upload code, and your ingest key can't open the connector channel: one credential, one job. The token value is shown once; rotation is the usual create-new-then-revoke-old.
POST /settings/ingest-tokens
{ "label": "datacentre-east", "scope": "connector" } One container, three environment variables. Run it anywhere inside your network that can reach the database — Docker, Kubernetes, or a VM with Docker installed:
docker run -d --restart unless-stopped \
--name codepanion-connector \
-e CODEPANION_URL="https://api.codepanion.app/api" \
-e CONNECTOR_TOKEN="<your connector-scoped token>" \
-e CONNECTOR_DB_CONNECTION_STRING="Server=db.internal;Database=prod;User Id=codepanion_reader;Password=...;" \
ghcr.io/codepanion-app/connector:latest Use a dedicated read-only database user, exactly as you would for a direct connection — least privilege applies on your side too. SQL Server and PostgreSQL are both supported; the connector detects the provider from the connection string. The image is a hardened native build: a single static binary on a distroless base — no shell, no package manager, runs as a non-root user.
Mark a database environment as connector-mode and the agent routes that environment's queries through the channel instead of a stored connection string:
POST /settings/databases/prod
{ "mode": "connector" } If the connector isn't running when the agent asks, the query fails fast with a clear "no connector connected" answer — nothing hangs, and the agent tells the support engineer what's wrong.
Outbound only. No inbound rules, no port forwarding, no VPN. If your egress is allow-listed, permit HTTPS (443) to:
api.codepanion.app # the control channel
ghcr.io # pulling connector images
pkg-containers.githubusercontent.com # GHCR's blob storage (image layers)
The two registry hosts cover both your initial docker pull and the connector's future automatic updates.
Through the connector, the agent can do exactly two things: run read-only queries expressed in Codepanion's structured query language, and read your database schema (tables, columns, keys, indexes). That's it. It cannot write — the connector wraps every query in a read-only connection and a transaction that is always rolled back. It cannot run arbitrary SQL — queries arrive as a structured definition that is compiled and parameterised locally, against your actual schema. And it cannot reach anything else on your network: the connector connects to the one database you configured, and nothing in the protocol can change that from our side.
The connector reports its version on every heartbeat, so we can see who is running what. Today, updating is a normal docker pull + restart (or your orchestrator's rolling update).
Coming: automatic updates
The connector is designed to keep itself current so you don't have to: roughly every 24 hours it will check ghcr.io for a newer image, verify the publisher's cosign signature, pin the exact image digest it verified, and restart onto it — so the update channel can't be hijacked between check and run. Until that ships, releases are infrequent by design (the connector is deliberately tiny) and announced in the changelog.
Every pilot customer gets hands-on onboarding from the founding team. We'll walk through setup together and make sure everything is working.