**Embedding adapter** — `EMBEDDING_PROVIDER` env var (`openai` | `ollama`) for selecting embedding generation backend. Ollama support for fully local RAG.
**Vector store adapter** — `VECTOR_STORE_PROVIDER` env var (`sqlite` | `memory`). `VectorStoreAdapter` interface for future backends.
**AI tool use** — Function calling in `/api/chat` with `getCurrentTime` and `getAppInfo` tools, `stepCountIs(3)` limit.
**Org AI quota** — `checkOrgQuota('aiChat')` enforcement in the chat route.
**Background RAG indexing** — `rag-index` job registered in the job system for async content indexing.
**MCP resources** — 6 read-only resources (schema, app config, AGENTS.md, .env.example, validation, navigation) for AI assistants.
**Context-aware MCP prompts** — `code_review` and `schema_design` prompts auto-inject current DB tables and app config.
**AI module Cursor rule** — `.cursor/rules/ai-module.mdc` with architecture and patterns.
**MCP auto-setup** — `codapult setup` now generates `.cursor/mcp.json` automatically.
**Demo mode** — `NEXT_PUBLIC_DEMO_MODE` env var, `DemoBanner` component with one-click sign-in, `seed-demo.ts` with a single admin account for public demo instances.
**Security headers** — `X-Content-Type-Options`, `X-Frame-Options: DENY`, `Strict-Transport-Security`, `Referrer-Policy`, `Permissions-Policy` on all routes via `next.config.ts`.
**Guards tests** — 13 unit tests for `requireAuth`, `requireOrgPermission`, `requireOrgMembership`, `requireOrgAdmin`.
**Branding sanitization tests** — 7 tests for CSS injection prevention and custom class validation.
Changed
**RAG indexing API** — `/api/ai/index` now uses Zod discriminated union validation for `index`, `search`, and `delete` actions.
**AI chat route** — Uses `appConfig.ai.systemPrompt`, respects `ragEnabled`/`ragMaxChunks`/`ragMinScore` from config.
**API keys** — Server action now validates input with Zod (`createApiKeySchema`); removed unsafe `as string` cast.
**API keys UI** — Replaced native `confirm()` with `AlertDialog`, added clipboard toast feedback, switched to `useTransition` for pending state, date formatting via `useFormatter` (next-intl), removed redundant `router.refresh()`.
**Admin API routes** — All admin routes now have rate limiting and Zod input validation (drip campaigns, jobs, multi-region, experiments, email domains, SSO, perf, webhook retry).
**GraphQL** — Added rate limiting (60 req/min per IP) on POST `/api/graphql`.
**Plugin API** — Added rate limiting (120 req/min per IP) on `/api/plugins/[...path]`.
Fixed
**Database CLI** — `drizzle.config.ts` and `seed.ts` now auto-load `.env.local` via `process.loadEnvFile()`. All `db:*` scripts (`db:push`, `db:seed`, `db:generate`, `db:studio`) work without manually exporting env vars.
Security
**Branding CSS injection** — Color values are now validated against an allowlist regex before `dangerouslySetInnerHTML` injection. `sanitizeCustomClass()` prevents arbitrary class injection.
v[0.1.0]
Added
**Auth adapter** — Better-Auth (default) and Kinde, switchable via `AUTH_PROVIDER` env var. Includes 2FA (TOTP), magic link sign-in, passkeys, and OAuth (Google, GitHub).