Skip to main content
Galinum accepts three project key types as bearer tokens:
Your publishable and secret keys are on Settings → Projects. Galinum provisions the scoped hosted-agent key when it enables hosted work for a project.

Publishable keys are not secrets

Publishable keys (pk_pub_…) are designed to ship in browser code — the same model as Stripe’s publishable keys or PostHog’s project API keys. They identify which project data belongs to; they don’t grant read access to other users’ data or your account. Endpoints are rate-limited per project, and requests carry no cookies, so CORS is safely open. It’s still good hygiene to:
  • keep the key in environment config (NEXT_PUBLIC_… style variables are fine — it ends up in the bundle either way),
  • use a different project (and key) per environment, so staging traffic never pollutes production data.

Secret keys stay on your servers

The secret key authenticates the management endpoints — reading your user data and creating, launching, and measuring campaigns are privileged operations. The management endpoints are not CORS-enabled, so browsers can’t call them cross-origin; call them from your agent or backend. When you give the key to your agent, provide it as an environment variable (the galinum skill reads GALINUM_SECRET_KEY) rather than pasting it into prompts or committing it. If a secret key leaks, rotate it from Settings → Projects — the old key stops working immediately.

Hosted-agent keys are scoped

The hosted agent uses its own pk_agent_… credential. It can read required project state, check audiences, log work, and claim bounded work. Optimization uses fenced evaluation mutations and exact-payload approval proposals. GitHub work uses fenced source reconciliation to prepare unlaunched drafts. It can read launch policy and campaign activation state. It cannot use ordinary campaign, status, goal, segment, media, launch-policy, or campaign-activation writes. Those routes return 403. These reads grant no approval or deployment configuration authority. Optimization writes use the claimed evaluation’s /evaluations/{campaignId}/mutate route. GitHub writes use the claimed source’s /github/refs/{refId}/reconcile route, which cannot launch or modify live campaigns. Revoking this key stops hosted access without rotating your project secret.

Self-hosted operator credential

The stock server uses a separately configured GALINUM_OPERATOR_KEY for operator setup and review. It must differ from management and publishable keys. Keep it out of agent environments and MCP configuration. The operator HTTP surface can confirm deployment scope and approve a current review snapshot. Management and hosted-agent keys cannot perform those actions. Only safe shipping-settings inspection also accepts the management key.

Authentication errors

Missing or invalid keys return 401:
A publishable key is never accepted by the management endpoints (and vice versa) — using the wrong key type also returns 401.