Skip to main content
Abstrekkt.
ABSTREKKT · APPSEC PLAYBOOK · FIRST WRITTEN 03/2026 · MAINTAINED 11/19/2026

Vibe Coding Playbook: AppSec-First AI Development.

Hospitality and quality control teach you one lesson fast: the gap between "works in rehearsal" and "works at 2 a.m. when nobody is watching" comes down to whether you modeled failure before opening the doors. AI code generation is fast and syntactically confident. Its failure modes cluster at auth boundaries, multi-tenant queries, and unvalidated inputs.

Tip 01 · Threat Modeling

Model failure modes before you prompt.

"Confident output and correct output are independent variables. At security boundaries they often move in opposite directions."

Implicit permission assumptions: Models treat "authenticated" as "authorized." Row-level ownership, tenant isolation, and role checks never appear unless explicitly required.

Context window drift: Early turn assumptions bleed silently into turn-fourteen data queries. Verify against your written schema, never chat memory.

Unvalidated arguments: Generated handlers assume clean inputs. Control-character stripping, Zod bounds, and enum locks have to be enforced at the boundary.

[SOURCED] Live Supabase Audit

In a live project audit, invite_codes and api_keys passed every functional test with Row-Level Security disabled. Any signed-in user could query every row across tenants.

[SOURCED] Moltbook Exposure (01/31/2026)

On 01/31/2026, Moltbook exposed 1.5 million API tokens and 35,000 email addresses from the exact same gap: Supabase RLS left off while happy-path tests stayed green.

Tip 02 · Architecture Gate & Interactive SCOPE_MODE

Architecture-first is non-negotiable.

Write system boundaries, data flows, state transitions, auth lifecycles, dependency failure behavior, and abuse vectors before prompting for code. Enforce progression with an explicit SCOPE_MODE gate:

SCOPE_MODE: STANDARD · Spec + Architecture + Plan

Full boundary specification, entity RLS rules, server-function Zod contracts, and ordered file plan before any component code runs.

HTTP Production Audit Proof: An end-to-end domain audit on an unmodeled build caught four silent architectural omissions: missing HSTS header, absent Content Security Policy, unthrottled auth endpoints, and accepted null-byte path inputs.

Tip 03 · Standing Adversarial Pass

Security prompting is a discipline, not a checkbox.

Run this exact 7-question pass on every auth handler, server function, database query, and input parser before merging:

Adversarial security review. For the code above, answer each question:

1. UNTRUSTED INPUT: Which function parameters could carry
  user-controlled data? Is each one validated before use?

2. SQL / QUERY CONSTRUCTION: Is any query assembled via
  string concatenation? If so, where and with what input?

3. CONCURRENCY: Are there race conditions possible under
  concurrent requests? Identify any shared mutable state.

4. DATA EXPOSURE: What data does this return or log?
  Is any of it sensitive? Is it scoped to the requesting
  user or tenant?

5. FAIL BEHAVIOR: Does this fail open or fail closed?
  What is the default behavior on error?

6. IMPLICIT PERMISSIONS: Does this code assume that
  authentication implies authorization? Where?

7. MISSING VALIDATION: What inputs, states, or edge cases
  are not covered by explicit validation?
Tip 04 · Structural Gates & AI Trust Calibration Matrix

Calibrate review depth to blast radius.

Pair CI smoke checks, CODEOWNERS on sensitive paths, separate RLS migration checklists, unit/E2E gates (529+ tests on flagship builds), and staged canary verification with the trust matrix below:

Output TypeTrust LevelRequired Gate
Auth handlers / session logicNever trustFull adversarial review + CODEOWNERS sign-off
Data access / RLS-adjacent queriesLow trustRLS policy review + tenant scope verification
API endpoints / input handlingLow trustZod input validation + 7-question adversarial pass
Business logic / state machinesMedium trustUnit test coverage + edge-case verification
UI components / presentational markupHigher trustStandard code review and accessibility check
Commercial Implementation · Separate B2B Domain

Abstrekkt publishes this AppSec specification openly. Organizations under 200 people needing a guided Shadow AI audit, 14-template governance rollout, and internal champion training engage through Loxihart.

Open loxihart.com B2B Sprints ↗