
Afridose
Pharmaceutical distributions and AI for pharmacies
Updated 19 March 2026
Security & privacy
This page explains the concrete security and privacy controls currently implemented in the Afridose repo. It stays at the level of what the product actually does today.
How Afridose is structured
- Afridose is built around one pharmacy owner account and one isolated pharmacy workspace or environment for that owner.
- The database enforces one pharmacy record per owner account, which keeps setup, stock context, and runtime state scoped to that pharmacy.
- Workspace provisioning and WhatsApp linking are queued against that pharmacy record instead of being shared across pharmacies.
Access control in the app
- Protected pages, server actions, and API routes use Supabase Auth session claims before loading or mutating pharmacy data.
- Ownership checks are applied when Afridose loads a pharmacy, settings, or WhatsApp-linking flow so one owner cannot fetch another pharmacy record through the app.
- Service-role access is kept on the server and used for worker-side provisioning or runtime updates only.
Database protections
- Afridose enables Row Level Security on pharmacy tables such as pharmacies, pharmacy_rules, admin_commands, and the pharmacy runtime audit log.
- Those policies are written around the signed-in owner identity, using Supabase ownership checks so authenticated users only see rows tied to their own pharmacy.
- Runtime audit log access is read-only for authenticated pharmacy owners and blocked for public or anonymous access.
Owner-controlled setup and linked line
- The owner controls the business WhatsApp line, the linked admin or pharmacist number, assistant tone, and assistant rules before go-live.
- WhatsApp linking is explicitly tied to the pharmacy business line and the control flow keeps the owner-side admin number separate from the public customer line.
- Afridose validates core onboarding inputs such as WhatsApp numbers before saving setup state.
Logging and operational visibility
- Afridose records pharmacy runtime audit events for provisioning and WhatsApp-linking flows where that logging has been implemented.
- Worker-side console logging redacts sensitive values before messages are written, which reduces accidental leakage in runtime logs.
- This logging is operational visibility, not a claim of full product-wide audit coverage across every feature.
POPIA alignment language
- Afridose is designed to align with POPIA principles such as purpose limitation, access control, and keeping pharmacy environments isolated.
- Afridose does not claim formal POPIA certification, regulator approval, or guaranteed legal compliance on this page.
- Pharmacies should still review their own legal, professional, and patient-data obligations before using the service in production.