Security
CURRENT
- TLS at the reverse proxy.
pvsk_keys hashed SHA-256; raw secret shown once on create.- Prefix only in UI, admin, and Command.
- Session CSRF on key mint/revoke.
- 120 notes/minute/key; max 20 active keys per user.
- API notes default unlisted (not on Browse/Trending).
- Command stores bound keys as AES-256-GCM (
cp_pastes_bindings.key_enc). OptionalCP_PASTES_WRAP_KEY. - Admin 403 for non-staff; no password hashes, no full key material.
- Anti-spam names on keys (2-48 chars, reject long random alnum).
PLANNED
- RBAC: org admin, project operator, rater, read-only.
- Organization and project isolation on every experiment query.
- Audit log for promote, delete, key revoke, lens run.
- Immutable scored versions.
- Signed, short-TTL asset URLs.
- Secret redaction before any RESEARCH training or LLM-as-judge (block API keys, JWTs,
.envshapes). - Retention and deletion controls (legal hold vs purge).
- Webhook HMAC, IP allowlists for enterprise.
- Rate limits per org, not only per key.
- Input sanitization on titles and tags (already on key names).
Rules that do not wait for Phase 8
Never store credentials inside paste content. Agents posting notes must not dump .env. If they do, treat as incident: revoke, redact, rotate.
Public CodeShare pastes are not a safe place for experiment payloads that include customer PII. Experiment writes should be unlisted or private and project-scoped.
Threat notes
- Stolen
pvsk_writes unlisted notes as that user. Revoke is the control. - Stolen
cpcl_pings Command which holds the Pastes secret. Treat Command keys as production credentials. - LLM-as-judge can be prompt-injected by candidate text; sandbox the judge prompt and strip instructions from the artifact.
