Skip to main content

Overview

YesPaPa uses a two-ring architecture. The Inner Ring (TOTP gate) is fully offline and self-contained. The Outer Ring (mobile app + remote server) adds push notifications and one-tap approvals.

Component Details

Shell Interceptor (intercept.sh)

The interceptor is a shell script sourced by .zshrc / .bashrc. It defines shell functions that shadow deny-listed commands. When you type rm -rf ./dist, the shell runs the wrapper function instead of the real rm. How interception works:

Daemon (packages/core/src/daemon/)

A long-running Node.js process that:
  1. Listens on a Unix socket (/tmp/yespapa.sock) for intercepted commands
  2. Evaluates the command against rules (deny-list, allow-list, bundles)
  3. Prompts for TOTP code via the terminal and/or pushes to the remote server
  4. Validates TOTP codes locally (never trusts the remote server)
  5. Checks grace periods (HMAC-validated auto-bypasses)
  6. Responds with approve/deny to the interceptor
The daemon stores all state in SQLite (~/.yespapa/yespapa.db). This is the source of truth. The remote server is a relay, not an authority.

Remote Server (optional)

The remote server relays commands between the daemon and the mobile app. It:
  • Stores pending commands in a commands table
  • Uses Realtime (WebSocket) to push updates to the daemon
  • Sends push notifications to the mobile app via Expo Push
  • Stores grace period records for cross-device sync
Zero-trust: The remote server cannot approve commands on its own. Every approval from the mobile app includes a TOTP code that the daemon validates locally against the seed. A compromised server cannot forge approvals.

Mobile App (packages/mobile/)

A React Native + Expo app that:
  • Pairs with hosts via QR code scan
  • Displays intercepted commands in a queue
  • Generates and submits TOTP codes automatically when you tap “Approve”
  • Sends push notifications when new commands arrive
  • Manages grace periods (activate/revoke auto-bypasses)

Data Flow: Command Approval

Security Model