S209 Vitto Governance And Tier Hierarchy

Documentation for Progress

Session 209 — Vitto Governance Hardening & User Tier Hierarchy Fix

Overview

This document covers the foundational security and governance changes made to the GoGrab platform in Session 209. These changes ensure that the right people have the right level of control over Vitto (our AI super-assistant) and the platform at large.


What Was Wrong (The Problem)

1. Anyone could change Vitto's behavior

Vitto has "executive instructions" — strategic directives that shape how the AI behaves for an entire workspace. Think of these as the "company policy" for AI behavior. Any logged-in user could create, modify, or delete these directives. There were no permission checks.

2. The user hierarchy was upside down

Our platform has different levels of users, from founders (executives) down to end customers. The code incorrectly placed developers and admins at the top (L0), when in reality executives (founders/C-suite) should be at the top. This matters because whoever is "at the top" gets to control things like Vitto's core values, personality defaults, and strategic directives.

3. The "executive" role existed in the backend but was invisible to the frontend

The backend added an executive role at the right hierarchy level (90 out of 100), but the frontend UI didn't know it existed. The frontend UserRole type didn't include executive. This meant the UI couldn't show executive-only features or restrict access for executives.

4. A security guard had no teeth

The Vitto backend had its own local "roles guard" (the code that checks if you're allowed to access something). But this guard used simple text matching instead of understanding the hierarchy. So an executive wouldn't automatically pass an "admin required" check — it would only pass if the code explicitly listed "executive" as an allowed role.


What We Fixed (The Changes)

The Corrected User Hierarchy

Tier Who What They Can Do
L0 — Executive Founders, C-suite Everything. Modify Vitto's core values, set strategic directives, publish personas, set defaults
L1 — Developer / Admin GoGrab engineering & ops team Full technical access, create personas, manage system settings
L2 — Space Builder / Space Admin Business owners creating platforms Create and manage their spaces, configure their workspace
L3 — Space User Team members within a space Use the platform, manage content
L4 — Platform User End customers of generated platforms Use the final product only
System Automated processes (not human) Backend-to-backend communication, scheduled tasks

What Was Changed (8 files across 3 layers)

Layer 1: Shared Type Definitions

Layer 2: Backend Security

Layer 3: Frontend UI


What This Means For Users

For Executives (You)

For Developers & Admins

For Regular Users


What's Next

Immediate (This Session)

Upcoming


Technical Details (For Engineering Reference)

Files Modified

File Path Change Type
auth.types.ts libs/libs-ui/auth-ui/src/lib/models/ Type definition fix
roles.guard.ts libs/libs-api/auth-core/src/lib/guards/ JSDoc update
roles.guard.ts APIs/backend-vitto-api/src/app/auth/ Replaced with re-export
vitto.controller.ts APIs/backend-vitto-api/src/app/engine/ Added @Roles guards
vitto-config.service.ts APIs/backend-vitto-api/src/app/engine/ Fixed role mapping
brain-context.service.ts libs/libs-ai/vitto-core/src/lib/services/ Added isExecutive
vitto-settings.component.ts libs/libs-ai/vitto-hub/src/lib/components/vitto-settings/ Fixed role mapping
theme-dashboard.component.ts libs/libs-space/theme-designer/src/lib/theme-dashboard/ Added executive check

MCP Intelligence Logged

Risk Assessment