ADR-0007: Claude Copilot with tenant-scoped tools and no training on merchant data
All AI calls go through packages/ai with a mandatory tenant context and module-provided tools; no training on merchant data; per-plan token quotas; every call logged with its cost in SAR.
ADR-0007: Claude Copilot with tenant-scoped tools and no training on merchant data
- Date: 2026-09-18
- Status: Withdrawn — the Copilot surface was removed with the vertical (see ADR-0010). The record is kept for history.
- Deciders: the owner, Claude (seed)
- Tags:
aicompliance
Context
The product relies on AI for content generation, review replies, summaries, and ad budgets. Arabic quality, data safety, and token cost are all constraints.
Decision
Claude through packages/ai (Vercel AI SDK with @ai-sdk/anthropic), fronted by Cloudflare AI Gateway (semantic cache, limits, log) when the Cloudflare target is chosen. Every call passes through packages/ai with a mandatory tenant context and tools provided by modules through copilotTools in the manifest.
- No training or fine-tuning on merchant data; stated in the contract and the privacy notice.
- Token quotas per plan; the default model is still open (Claude Sonnet 5 is wired today).
- Every call is recorded in
ai_callswith its cost in SAR.
Consequences
- Positive — high Arabic quality, controlled cost, auditability.
- Negative — dependence on an external provider; variable cost that needs monitoring.
- Revenue impact (SAR / month, confidence) — cost ≈ 5–20 SAR / merchant / month (medium confidence); AI is a retention and upgrade lever, not a standalone revenue channel for now.
Rejected alternatives
- Self-hosted open models: lower Arabic quality and heavier operations.
- AI without tenant boundaries: risk of data leakage between merchants.
References
Withdrawn 2026-09-20. This record describes a surface that is no longer part of the product: the Copilot surface was removed with the vertical. ADR-0010 records the decision.
ADR-0006: Simplified invoicing in the core, full accounting as an add-on
The core generates and stores a ZATCA simplified invoice for every payment; full accounting is a Marketplace add-on delivered by an embedded partner first.
ADR-0008: Adopt supastarter-nextjs as the foundation
Adopt supastarter-nextjs as the upstream foundation — Node-runtime Next.js 16, Better Auth, oRPC, Prisma + Drizzle, next-intl — while keeping the module contract, the glass design contract, and English docs.