FrictionGuard

System design

Architecture Explorer

AI Proposes → Policy Decides → System Executes Safely. Click through each layer to see exactly what it may and may not do.

Pipeline

Click any node to inspect its responsibilities and security properties

Groq AI Diagnosis

Sandboxed diagnosis: root cause, bounded action proposal, confidence, microcopy.

  • Model: openai/gpt-oss-20b via Groq (openai/gpt-oss-20b recommended in the brief).
  • Structured JSON output validated with Zod before it is used anywhere.
  • If Groq errors or returns invalid schema → deterministic fallback, no unsafe action.
  • Cannot create payments, links, or orders; cannot change amounts; cannot approve itself.
🔒 Output is Zod-validated🔒 Fallback diagnosis on any AI failure🔒 AI has zero execution authority

Interactive state machine

Transitions highlight from real live events

IDLE
PAYMENT_ATTEMPT
FAILURE
NORMALIZED
AI_DIAGNOSIS
POLICY
RECOVERY
SUCCESS

At POLICY the machine branches: APPROVE/OVERRIDE → RECOVERY → SUCCESS, while BLOCK stops safely. Branch points are enforced by lib/policy/engine.ts.

Pipeline events

POLLING
  1. Waiting for events — run a checkout, recovery, or evaluation…