Software Factory
Your preview talks to the Ghosty API without keys
Updated 2026-11-22
If your app calls the Ghosty partner API (/api/v2/partner/*), in production it signs with its key (X-Ghosty-Key + HMAC). In a preview there is no need to copy that key: Ghosty gives each box its own identity, like GitHub Actions or Vercel OIDC. The API accepts it as Authorization: Bearer and resolves the partner from its own records, never from what the app says.
What you get
GHOSTY_PREVIEW_TOKENin every preview's environment: anEdDSAJWT withaud=ghosty-api,sub= the box,repo,prandsha. It is re-signed on every push and expires with the box (48 h for a standalone preview). It does not exist in production.- Same keys and JWKS as
X-Ghosty-Identity(/.well-known/preview-identity/jwks.json), with a differentaud: one never works as the other.
The recipe (3 lines)
Spread ...auth into the fetch headers and drop the "missing key" error when there is a token.
What it can do
- Testing: whatever needs
agents:read— turns (/turns,/agui), pages (/pages/*) and reads. Creating or changing agents and businesses, WhatsApp and credentials still require the partner key (403). - Partner: always one of the partner workspaces owned by the owner of the preview's workspace. Which one: the one named by
partner: <workspace>in the.ghosty/factory.mdfrontmatter; otherwise the preview's own workspace; if that is not a partner, the owner's only one. None, several without saying which, or someone else's → 403 with the reason. - Live box: if the box no longer exists or belongs to another repo, 401. Capped at 300 calls per hour per box (429).
- Calls show up in the partner's audit log as
preview:<box>.