# Security and write rules

> What is stored, who can read it, how runs sign in, and which runs may write to the cache.

Source: https://warmbuild.dev/docs/security/

**What you do**

1. Give CI jobs `id-token: write`: they sign in with GitHub's short-lived token.
2. Optional: account admins choose which refs may write, on the Write rules tab.

**What you get**

Compiler outputs and build metadata, never source or logs, kept per account: served for 7 days, deleted after 14. Pull requests and Macs only read.

## Security and privacy

- **What is stored:** compiler outputs, addressed by their hash, and the CI report’s build metadata. No source code, no logs.
- **Who can read it:** runs and Macs of the same account. Each account has its own keys; nothing is shared or deduplicated across accounts.
- **Sign-in:** on CI, the job’s short-lived GitHub OIDC token (hence `id-token: write`). On a Mac, GitHub’s device sign-in; the token stays in the macOS Keychain. Self-hosted runners without OIDC can use an API token from the dashboard.
- **Integrity:** objects are addressed by the SHA-256 of their contents, and the client checks every object it downloads against it; a mismatch counts as a miss.
- **Preload lists:** the list of entries a CI build used, which the next fresh runner fetches first, is kept by the API under the session’s own repository and served to sessions of that repository only; developers’ tokens get none.
- **Retention:** a cache entry is served for at most 7 days after it was written, and everything stored is deleted after 14 days.

## Write rules

A CI run writes to the cache when a rule matches its repository and ref; every other run only reads.

- **Default:** with no rules, each repository’s default branch writes.
- **Never write:** pull requests and Macs.
- **Editing:** account admins edit the rules on the dashboard’s *Write rules* tab. `@default` is the repository’s default branch and `*` matches anything, e.g. `owner/app` on `refs/heads/release/*`.
