← back to AbramsOS

docs/COMPLIANCE.md

48 lines

# Compliance Posture

AbramsOS is **consumer-only** in v0 and operates as a personal tool for Steve. The compliance bar will rise in lockstep with each milestone in `ROADMAP.md`. Document this file as the system grows.

## Today (Phase 0 + auth/Plaid v1, 2026-05-10)

| Area | Posture |
|---|---|
| Authentication | bcrypt (cost 12) password + TOTP (otplib v12) — single-user; signup is locked after the first user is created |
| 2FA enforcement | TOTP verified on every signin AND re-verified (step-up) within 60 seconds before any visit to `/import` or any "Import all" run |
| OAuth | server-side authorization-code flow against Google; scopes: `gmail.readonly`, `drive.readonly`, `userinfo.email` |
| Bank/card data | Plaid (sandbox by default); access tokens AES-256-GCM-encrypted at rest; **never** PAN/CVV/full account numbers — Plaid stores tokenized item refs only |
| At-rest encryption | refresh tokens, Plaid access tokens, and TOTP secrets all AES-256-GCM under `ENCRYPTION_KEY` (32-byte hex, route via `/secrets`) |
| Sessions | DB-backed (`auth_session` table), 30-day TTL, signed cookie `aos.sid`, httpOnly + sameSite=lax |
| Data residency | local PG `abrams_os` on Mac2; nothing in cloud yet |
| PII handling | no redaction yet — single-user; **do NOT** open up multi-tenant until redaction lands |
| Model providers | local Ollama qwen3:14b on Mac1 only; **no Anthropic API**, no OpenAI calls |
| HIPAA | N/A — no PHI ingested in v0; medical_* tables not implemented |
| Audit log | every connector mutation writes one `audit_log` row; every auth/import event writes one `auth_event` row |
| Outbound | none — drafts only; no email send, no API submit, no e-sign |
| Logging | pm2 stdout/stderr to `logs/`; no remote log shipping |
| Backups | manual `pg_dump` for now |
| Plaid env | `PLAID_ENV=sandbox` by default; sandbox creds `user_good` / `pass_good`; promote to `development` then `production` only after Plaid Production Application Review |

## When this changes (and what becomes mandatory)

| Trigger | Required additions |
|---|---|
| Add second user | RBAC, per-user data isolation, redaction before model calls, session security review |
| Add outbound action (send email / file claim) | per-action approval token, destination allowlist, signed audit entry, replay protection |
| Add Plaid / Stripe / PayPal | PCI-aware logging boundaries, tokenized account references, no PAN/CVV ever |
| Add medical_asset / pharma_product | medical_consent_grant precondition, BAA-ready vendor posture, PHI boundary tags, breach-notification runbook, encryption-in-transit + at-rest review |
| Sell to providers / payers / employer benefits | full HIPAA program: Security Rule risk analysis, workforce controls, sanctions policy, business-associate agreements, incident response, contingency plan |
| Add MCP marketplace (third-party tools) | Connector Security Gateway: URL allowlist, schema validation, content sanitization, prompt-injection scanning, egress restrictions |
| Public-facing deployment | TLS, CSP, HSTS, rate limits, helmet hardening review, CSRF on all state-changing routes, security contact + disclosure policy |

## Standing rules from Steve's global instructions that apply

- **Never use the Anthropic API.** All Claude inference via `claude` CLI; delete `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` before any spawn.
- **No CSV attachments in outbound email.** Inline `<table>`, RFC 2047-encoded subjects.
- **Every site needs `info@<domain>`.** Provisioned via Purelymail at build time.
- **Cloudflare caches HTML.** Edited Express sites need `Cache-Control: no-store, must-revalidate` on origin.
- **No stock-image libraries** (Unsplash/Pexels/Getty). Allowed: Wikimedia, IA, Calisphere, USC, LAPL.

## Not legal advice

AbramsOS produces drafts and educational content. It is not a lawyer, an insurance agent, or a billing service. Output should always carry a "for your review" framing in the UI; do not auto-send anything that asserts a legal claim without the user reading and approving the exact text.