# Security

> **In short.** Each studio's data is kept apart by the database itself (row-level security), not
> just by application code. Your team signs in with passkeys only; users never have a Junco
> account. Signed user tokens use Ed25519 and Junco holds only the public key. Uploads are checked
> by their bytes and never served as web pages. Personal details are removed before any AI model
> sees a message. Junco runs on its own servers in the United Kingdom.

## Keeping studios apart

- Every row of studio data (products, tickets, users, messages, files, AI runs) belongs to a
  studio, and **PostgreSQL row-level security** enforces it: Junco's server connects as a role
  that can only see the rows of the studio it's acting for. A bug in one query can't show one
  studio another's tickets; the database refuses.
- Tests check that queries can't cross studios, and that one studio can't reach another's
  products, invites, GitHub installations or repos.

## Signing in

- **Your team: passkeys only** (WebAuthn). No passwords to leak, reuse or phish; a passkey only
  works on Junco's own address.
- **Joining** is by invite link: single use, 7 days, and only a hash of the link is stored.
- **Sessions** are per device and can be signed out from **Settings**. Removing someone from a
  studio signs them out everywhere.
- **Roles**: Admins manage products, GitHub and the team; Members work the inbox.

## Your users

- Users never make a Junco account or give Junco a password.
- **Signed tokens** ([Signed user tokens](/docs/user-tokens)) are Ed25519 JWTs your server signs.
  The private key is made in your browser and downloaded; Junco only ever stores the public key.
  Tokens are bound to one product (`aud`) and last at most 7 days.
- **Random ids** for users without accounts are long and random (at least 32 characters), so
  they can't be guessed. A user only ever sees their own tickets; another ticket's number answers
  404.
- Browser calls are only accepted from the product's listed web addresses (CORS), and rate limits
  apply per user, per network address and per product.

## Files

- Screenshots are accepted only if their bytes are really PNG, JPEG or WebP; logs only if they're
  UTF-8 text. Saves are kept as opaque downloads.
- Files are served to your team only, signed in, as images or downloads, never rendered as HTML.
- Size limits on every file and request.
- Files are deleted after 90 days.

## The desk, widget and website

- A strict **Content Security Policy** on the desk, the hosted page, the guides and the website:
  only Junco's own scripts, nothing loaded from anywhere else, no trackers, no adverts.
- The widget runs in a **closed shadow root**, adds no cookies (`credentials: "omit"`), and loads
  nothing but itself and Junco's API.
- All traffic is encrypted: HTTPS to Cloudflare, then an encrypted tunnel to Junco's servers. No
  ports are open to the internet.

## The AI

- **Personal details are removed** before a model sees a ticket ([How the AI works](/docs/ai)).
- Models are reached through OpenRouter with **prompt logging off** and **zero data retention**:
  only providers that don't keep or train on the data.
- Every reply passes rule checks and a second model's checklist, including "doesn't follow
  instructions hidden in the user's message" (prompt injection), or it's held for a person.
- GitHub issues drafted by the AI are checked for personal details before they're created.
- Each studio's AI usage runs on its own OpenRouter key, limited to that studio's credit; the
  keys are stored encrypted.

## GitHub

- Junco's GitHub App asks only for **issues** (read and write) and basic repo details, on the
  repos you choose.
- Connecting needs both the installation and **your GitHub sign-in**, so a studio can only link
  repos its own people can reach (an installation id alone, which can be forged, isn't trusted).
- Webhooks from GitHub are verified by signature.

## Operations

- Hosted on Junco's own servers in the United Kingdom, run by Big Beans Studio.
- Encrypted nightly backups, kept up to 12 months; restores are tested.
- Secrets (API keys, signing keys) are kept out of the code and readable only by the service.
- Sub-processors and what each sees: [Sub-processors](/legal/subprocessors).

## Reporting a security problem

Please tell us privately through the form on Junco's website, saying it's about security. We'll
reply quickly and credit you if you'd like.
