Design Philosophy

The SC Platform's security model follows three core principles:

Why This Matters

This security model is what makes the platform safe to extend. When proactive agents arrive, they inherit this same permission system — no new security infrastructure required. A background agent monitoring the Permian Basin area only sees Permian Basin data because it runs with a scoped identity, just like a human user would.

Authentication — Who Are You?

The platform supports exactly two authentication methods. There is no third option, no fallback, and no exception.

Entra ID (Humans)

All human users authenticate via Microsoft Entra ID (Azure AD) using PKCE-based OAuth 2.0. This applies to every tool in the ecosystem — Ask Ricky, Pennywise, Hawkeye, Ops Dashboard, Platform Admin.

API Keys (Machines)

Machine-to-machine callers (agents, connectors, external integrations) use sk_-prefixed API keys.

PropertyEntra ID (Humans)API Keys (Machines)
Token typeJWT (signed by Microsoft)Opaque sk_ string
Identity bindingUser row (Entra OID → tenant + role)ApiKey row (hash → tenant + scopes)
Scope sourceUser's group/role membershipApiKeyScope rows on the key
ManagementEntra ID / Azure PortalPlatform Admin
RevocationEntra token expiry + revocationDelete key in Platform Admin

Multi-Tenant Isolation

Every domain table in the platform has a tenantId column. Every database query filters by it. This is the foundational security boundary:

Role Hierarchy

Users are assigned a role that determines their feature-level access. The hierarchy is strictly ordered:

RoleAccess LevelTypical User
MEMBER Standard data access within their scoped boundaries. Can use tools, submit feedback, view data they're authorized to see. Mechanics, area managers, analysts
TENANT_ADMIN Everything a MEMBER can do, plus tenant configuration: manage users, configure integrations, manage API keys within their tenant. IT leads, department heads
SUPER_ADMIN Cross-tenant access. Can create tenants, manage the platform itself, configure global settings. Platform development team

Each API route declares exactly one guard — requireMember, requireTenantAdmin, or requireSuperAdmin. There is no "check both" ambiguity.

Scope System

Scopes are the fine-grained permissions that control what data a caller can access. Unlike roles (which are about feature access), scopes are about data access — specifically, which categories of data a caller can read or act on.

Scope Catalog

ScopeWhat It GatesUsed By
Agent.Run Permission to start an AI agent conversation at all Ask Ricky
Telemetry.Read Live sensor data, fault codes, alarms from M-Link / Enbase Ask Ricky, Ops Dashboard
Assets.Read Equipment profiles — unit makeup, specs, configuration Ask Ricky, Ops Dashboard
WorkHistory.Read Past maintenance records, corrective maintenance items Ask Ricky
KnowledgeBase.Read Curated troubleshooting guides and general knowledge Ask Ricky
Directory.Read Employee/mechanic directory for dispatch lookup Ask Ricky
FleetLocation.Read Real-time vehicle GPS positions from Samsara Ops Dashboard
KnowledgeBase.Write Create and modify knowledge base articles Ricky Curator
Tenant.Admin Tenant configuration, user management, API key management Platform Admin

How Scopes Are Assigned

AI Tool Gating

This is where the platform's permission model becomes uniquely powerful. When the AI Engine receives a request from Ask Ricky:

User's scopes resolved
Agent toolset composed
Claude sees only permitted tools
Data filtered to user's scope
Key Insight

Most AI platforms bolt security on after the fact — a blanket API key with broad access. The SC Platform inverts this: the AI never has more access than the person (or identity) it represents. Security isn't a layer around the agent — it's woven into how the agent is constructed for each request.

Row-Level Access Control

Beyond scopes (which gate categories of data), some tools enforce row-level filtering based on the user's organizational assignment.

Pennywise RBAC

Pennywise has the strictest row-level controls in the ecosystem because it handles sensitive financial data:

Hawkeye Org-Based Visibility

Hawkeye uses the org chart to determine what approval items a manager sees:

Per-Tool Auth Patterns

ToolAuth MethodScope ModelData Filtering
Ask Ricky Entra ID (PKCE) Platform scopes → AI tool gating Per-unit data access via scopes
Pennywise Entra ID (PKCE) Role + scope assignment Row-level RBAC (region/area/unit)
Hawkeye Entra ID (PKCE) Org chart-based visibility Reports chain filtering
Ops Dashboard Entra ID (PKCE) Platform scopes Scope-filtered API responses
TrueCount Entra ID (PKCE) Platform scopes Warehouse assignment
Platform Admin Entra ID (PKCE) TENANT_ADMIN / SUPER_ADMIN role Tenant-scoped management
AI Engine Inherits from caller Caller's scopes → tool composition Tool-level + data-level filtering

Audit & Logging

Administration

The permission model is managed through two primary interfaces:

Platform Admin

  • Tenant creation and configuration
  • User role assignment
  • API key creation with scope selection
  • Agent tool configuration per tenant
  • Integration credential management

Per-Tool Admin

  • Pennywise — user invite, role + scope assignment, org chart
  • Hawkeye — org chart editor, approval routing rules
  • Ricky Curator — knowledge base access and publishing permissions