StackGate
A self-service internal developer platform that turns plain-English PostgreSQL requests into structured specs, classifies risk, routes policy-based approvals, and provisions databases with a complete audit trail.
The problem
Infrastructure requests usually bounce between tickets, Slack threads, and tribal knowledge. StackGate makes the intent the input and produces a governed, auditable provisioning workflow, like a real internal platform product, not a CRUD form.
What it does
- Natural-language intake: describe a database need in plain English and Claude parses it into a structured PostgreSQL spec, with a deterministic regex fallback if the API is unavailable.
- Validates required and valid fields before anything provisions.
- A policy engine classifies each request low / medium / high risk (and a cost band) based on environment, tier, vCores, storage, HA, networking, and data classification.
- Approval routing: low-risk auto-approves; medium/high route to manager and/or platform approvers with rationale, comments, and full ticket-level audit history.
- Role-based experiences (requester, approver, admin) with a dashboard, approvals inbox, ticket detail timeline, and a resource handoff card on completion.
Approach & architecture
The data layer is Prisma + SQLite (User, Ticket, TicketSpec, Approval, TicketEvent, ProvisioningJob, ProvisionedResource). Auth is a server-owned signed, httpOnly-cookie session: identity is resolved server-side on every request and never trusted from the request body. Provisioning is simulation-first for safe demos, with a guarded live Azure path (Azure Database for PostgreSQL Flexible Server) restricted to a narrow low-risk dev profile, anything outside that envelope falls back to simulation.
how it fits together
NL request → governed, reviewable provisioning
Plain-English database requests become risk-classified, policy-approved infrastructure-as-Code with a full audit trail.
- Natural-language request"I need a small Postgres for a staging app…" → Claude parse (deterministic regex fallback).
- Structured spec + validationEnvironment, tier, vCores, storage, HA, networking, data classification.
- Policy engine · risk + costClassifies low / medium / high risk and an estimated monthly cost band.
- Low risk → auto-approveStraight to the provisioning queue.Med / high → approversTransactional, status-guarded, self-approval blocked.
- Provisioning adapterSimulation or guarded Azure (az CLI). Live calls gated to a low-risk eligibility envelope, else auto-fallback to simulation.
product screens



key engineering decisions
Real access control, not a mock user
Replaced a client-side mock-user model with a server-owned, signed-cookie session. Every API route derives the actor from the session, blocking identity spoofing and self-approval, verified with a 6-case auth smoke test.
Safe approval → provision path
Read-decide-write wrapped in a Prisma transaction with a status guard, so concurrent approvals can't double-provision.
Guarded live cloud provisioning
A strict eligibility envelope gates real Azure calls; anything outside it auto-falls back to simulation to cap blast radius and cost.
Policy-as-code classification
Risk and cost are classified by an explainable policy engine, and the rationale is surfaced directly in the UI.
results & outcomes
- Plain-English requests become traceable workflows with consistent approvals and full audit visibility.
- Identity spoofing, self-approval, and double-provisioning eliminated, verified with an automated auth test suite.
- A guarded Azure provisioning path that stays safe by construction, falling back to simulation outside the low-risk envelope.
