Administrator Guide
This chapter is for tenant administrators and platform owners responsible for keeping Regurai running cleanly inside the firm.
Administrator roles
| Role | Capabilities |
|---|---|
owner | Full access to the tenant, including access governance, audit log viewer, and admin pages. |
admin | Manage users, grants, and most configuration. Cannot read every audit entry. |
auditor | Read-only: access governance reviews, audit log viewer. Cannot mutate state. |
risk_officer, compliance_officer, model_owner, user | Functional roles — see Authentication & Authorization. |
Roles are stored in public.user_roles and never on the profile/users table. See the security chapter for why.
User management
Today, users self-register via Supabase Auth on /auth (where enabled) or are invited by an owner / admin. After first sign-in they are forced through MFA enrolment.
To grant a user a role:
- Open Access Governance v2.
- Find the user (or invite them).
- Issue an
access_grantwith the appropriate role and expiry. - The grant is recorded in
access_grantsand a corresponding entry appears inaccess_audit_log.
Role management
The role switcher in the top navigation is intentionally only visible on Access Governance pages (/app/access-governance and /app/access-governance-v2). Switching roles outside this surface is not possible — every role change opens a confirmation modal (RoleChangeConfirmModal) and writes an audit entry.
Access reviews
Periodic access reviews are run from Access Governance v2 → Reviews:
- Start a review cycle (quarterly recommended).
- The system lists every active grant in scope.
- Reviewers attest or revoke each grant.
- Attestations land in
access_reviews; revocations also write toaccess_audit_log. - At cycle close, generate the evidence pack from
/app/evidence.
Delegating approval authority during leave
Both AI-model approvals (ai_approvals) and access-request approvals (access_request_approvals) enforce strict self-approval at the database layer (Phase 5.4, Option A+ — chapter 14 §9). Concretely, the RLS WITH CHECK predicate (approver_id IS NULL OR approver_id = auth.uid()) ensures that the approver_id recorded on every row is either empty (pending state) or matches the currently signed-in user. An admin cannot record an approval "on behalf of" another named approver by writing that person's id into the field — the database rejects the row with new row violates row-level security policy.
When a named approver (e.g. the Head of Compliance) is on annual leave and an approval must be actioned during that period, do not attempt to record the approval under their identity. Instead, use the existing time-bounded role grant mechanism in Access Governance:
- An owner/admin/risk_manager opens Access Governance → Grant access for the delegate (e.g. the Deputy Compliance Officer).
- Issue a grant of the same role the absent approver holds (e.g.
compliance_officer), with:expires_atset to the end of the leave period (the grant is automatically revoked at that timestamp by the existingaccess_grantsmechanism — covered by the Phase 2.1 isolation harness);justificationset to e.g. "Delegated approval authority — covering [absent approver name] [leave dates] — see ticket REF-1234";regulatory_basisset toISO 27001 A.5.18 (Access rights — provisioning, review, removal).
- The delegate signs in and records approvals under their own identity — the audit trail then shows: (a) the delegate as
approver_idon each approval row, (b) the temporary grant inaccess_grants(with its justification and expiry), and (c) the correspondingaccess_audit_logentries for grant issuance and auto-revocation.
The audit story is therefore complete and accurate: every approval is attributed to the person who actually clicked, the temporary authority is bounded and traceable, and no row in any approval table carries a falsified attribution. This is the supported delegation pattern; no separate "delegate-on-behalf-of" attribution field exists, and none is planned (chapter 14 §9 records Option B as a documented fallback should a customer specifically contract for in-row delegated attribution).
Why this matters for audit: the alternative — a free-text
approver_idnot bound to the caller — produces approval rows whose attribution can be forged by any role-bearing member of the tenant, which fails the segregation-of-duties (SoD) expectation under ISO/IEC 27001 A.5.3 and the human-oversight expectation under EU AI Act Art.14. Theaccess_grantsroute satisfies both standards because the delegation event itself is the audit artefact, not an implicit claim inside the approval row.
Configuration
| Setting | Where |
|---|---|
| Branding (logo, colours) | src/styles.css tokens; src/assets/regurai-mark.png |
| Sidebar items | src/components/app/Sidebar.tsx |
| Idle timeout (default 60 min) | src/hooks/useInactivityTimer.ts |
| Rate-limit threshold (default 5/15m) | supabase/functions/login-rate-limit/index.ts |
| Manual version / revisions | src/content/manual/MANUAL_META.ts |
Monitoring and maintenance
| What to watch | Where |
|---|---|
| Failed sign-ins per IP | public.sec_login_attempts (service-role query) |
| Audit log entries | /app/audit-log-viewer (owner / auditor) |
| Edge function errors | Lovable Cloud edge function logs |
| Server function errors | Worker stdout, Lovable Cloud dashboard |
| Database health | Supabase project info & db_health |
| MFA enrolment coverage | supabase.auth.admin.listUsers() cross-reference with TOTP factors |
GDPR / DSAR handling
Data Subject Access Requests are recorded in public.gdpr_requests. Workflow:
- Subject submits request (via support channel).
- DPO records the request in
gdpr_requestswith statusreceived. - Investigation → export / deletion as required.
- Response delivered; status moves to
closed; evidence retained for the regulatory retention period.
Operational hygiene
- Rotate the Lovable Cloud service-role key on staff turnover.
- Re-run the security scan after every release; aim for zero critical findings.
- Review the Change Management chapter monthly; close out open ADRs and tech-debt entries.