Security & Governance

Built so automation never outruns human authority.

Security controls in Nirvaagi are enforced server-side in code and PostgreSQL—never left to prompt instructions alone.

Workspace & Database Isolation

Every request binds its active tenantId inside AsyncLocalStorage (`src/core/tenant.ts`), filters all scoped Prisma queries, and runs inside PostgreSQL row-level security (`atlas_tenant` role) unless explicitly disabled in dev.

Least-Privilege Roles & Scopes

Human team roles (`COO`, `CTO`, `CMO`, `CFO`, `CBO`, managers, `BILLING_MANAGER`, `VIEWER`, `TEAM_MEMBER`) restrict both sidebar visibility and server API prefixes. Client portal sessions are strictly rejected by `/api/admin/*`.

Server-Enforced A0–A4 Approvals

Research (A0), drafts (A1) and internal logs (A2) run automatically. First client messages (A3) and all money, contract, permission or deployment actions (A4) wait in Approval Center. Owner email verification is required before A3 sends run.

AES-256-GCM Secret Storage

Third-party AI keys, SMTP credentials and OAuth tokens are encrypted per tenant using AES-256-GCM before hitting PostgreSQL and are never returned to browsers beyond their last four characters.

Audit History & Prompt-Injection Guard

Every sign-in, approval decision, role change and AI spend entry writes to `AuditLog`, `DecisionLog` and `AiUsage`. External web/email text is handled strictly as untrusted data—never executable instructions.

Owner 2FA & Emergency Stop

Owners can enable authenticator-app TOTP two-factor authentication with single-use recovery codes and trigger a one-click Emergency Stop that pauses all agent runs without deleting records.

Emergency stop & retention

What pauses, what logs, and how deletion works.

What Emergency Stop pauses: All scheduled agent cycles, outbound follow-ups and queued `AgentJob` executions stop immediately. Existing CRM records, audit trails and read-only briefings remain accessible so owners can inspect safely.

Off-site backups: When the Supabase off-site backup connector is configured, nightly encrypted copies keep up to the newest 30 snapshots.

Deletion & key revocation: Removing an API key in Integrations Hub clears the encrypted row at once. Full workspace data export or permanent deletion requests are handled directly via support@iboyhub.com.

Questions or a responsible disclosure?

Write directly to support@iboyhub.com for security audits, architecture questions or vulnerability reports.