ADR 0005: API Security Defaults

Ratification

Adopted before ADR 0018. There was no separate ratification process. Git history for this file on main is the record.

Context

Why this matters: Security is not one switch — it is a set of defaults: who may call the API, how much traffic they can send, which browser origins we trust, and how large bodies may be. If those defaults differ between a laptop and staging/production, teams often find gaps only after abuse or incidents.

Set a baseline early (even with mock auth) so integrators learn real headers and keys. Moving later to real identity is then mostly configuration, not a full redesign.

Decision

Protected routes under /api/v1/* share one security baseline:

  1. Per-client rate limiting is enabled by default.
  2. CORS is allowlist-based and configured from environment.
  3. Security headers are attached to every response.
  4. Request body size is capped via configurable global limit.
  5. Basic auth strategy is required in all environments; current default is mock API-key auth.

Configuration

Contract impact

Consequences

Positive

Trade-offs

Implementation Notes

Page history

Date Change Author
Added Page history section (repository baseline). Ivan Boyarkin