# BOUNCER — Preemptive Protection Suite — Build Prompt

*Owner: Dennis Barnett, American Industries Mobile / Cave Labs Brands. This is the before-the-attack companion to Backtrax (which is after-the-attack only). Dennis's word for it: "the bouncer."*

## 0. READ THIS FIRST — WHAT THIS BUILD IS, AND WHAT IT IS NOT

This app MUST be built as a **real native Android app (Kotlin)**. It is NOT a single-file web page, NOT a WebView wrap, NOT a PWA.

Reason, stated plainly so no builder fakes it: a web page inside a WebView **cannot** read the phone's SMS inbox, call log, or notifications. There is no web API for that. Everything this app does — scanning incoming texts, calls, emails and notifications — requires native Android permissions and native Android services (SmsProvider, CallLog, NotificationListenerService). Any builder that claims to do this in a single HTML file is faking it. If a function cannot be built natively in this pass, leave it OUT and list it in the can't-do list with the reason — do not simulate it, do not present a demo as working.

Build lane: native Kotlin, built through the GitHub Actions Gradle pipeline (the Backtrax lane). Target: Android 12+ (API 31+), Dennis's Samsung Galaxy S23 FE first, then general Android.

Offline-first: all scanning, quarantine, logging and decisions happen **on the device**. Network is used ONLY for optional reputation lookups the owner turns on (link reputation, domain age), and the app must say clearly when a verdict came from the device alone vs an online check. No message content ever leaves the phone without the owner's explicit tap.

## 1. WHAT IT IS

**Bouncer** stands at the door of Dennis's phone and checks the ID of every incoming communication — email, SMS, phone call, voicemail, push notification, and any other incoming message — BEFORE he has to deal with it. It catches the anomaly (a "Coinbase" email from a domain Coinbase doesn't own, a "bank" text from a number the bank never used, a call from a spoofed familiar number) and holds it in quarantine until Dennis clears it or deletes it.

One-line pitch: *the bouncer checks IDs at the door, so the scams never reach the table.*

## 2. PERMISSIONS (ask for each, explain each in plain words on screen)

The app asks for each permission one at a time, with a one-line plain-English reason on the ask screen, and works with whatever subset the owner grants — every feature tied to a missing permission shows as GREY with "permission needed" and its phase, never as working. Permissions:

- **READ_SMS + RECEIVE_SMS** — read incoming texts to scan them.
- **READ_CALL_LOG** — see who called, spot spoofed/familiar-number calls.
- **Notification Listener (BIND_NOTIFICATION_LISTENER_SERVICE)** — read incoming notifications (bank alerts, delivery notices, app alerts) to scan them.
- **READ_MEDIA_IMAGES** — read images in messages to scan QR codes (quishing).
- **INTERNET (optional, owner toggle)** — only for reputation lookups (link reputation, domain age). Off by default; app says so.
- **POST_NOTIFICATIONS** — to warn Dennis when something is quarantined.
- **RECEIVE_BOOT_COMPLETED** — restart the watch after a reboot.
- **No contacts upload, no message upload, no location, no microphone, no camera.** Never ask for these. If a future feature needs one, it is a new build decision, not a silent add.

## 2A. EMAIL LANES (owner decision, 2026-11-26: ROUTE 1 is the main lane)

Email cannot be read from inside the Gmail/Outlook apps — Android allows no third-party app to do that. So Bouncer reads mail one of two ways. The owner picked **Route 1**:

- **ROUTE 1 (main lane): the app reads the mailbox itself.** The native app signs into each mailbox once — Gmail through Google sign-in, Hotmail through IMAP — and reads the mail on the phone. Scanning happens on the device. No message content leaves the phone, ever. This is the lane to build first.
- **ROUTE 2 (named backup): forward to a server.** A mail rule forwards a copy of incoming mail to a dedicated address; a small server (Cloudflare Email Routing + Worker) scans it and pushes the verdict to the app. Real, but it breaks the privacy rule — mail content travels to a server and sits there — and it needs a domain, a Worker, and push notifications. Build only if the owner orders it.
- **ROUTE 3 (middle road):** forward only mail from unknown senders (Gmail filter: "from anyone not in my contacts") to the Bouncer inbox. Everyday mail never leaves the phone; only strangers' mail takes the trip.

Every incoming item is scored on the device. Each check below produces one named flag with a plain-English reason the owner can read. No silent scores, no black-box verdicts — every flag names its evidence.

### 3.1 Sender identity
- Display-name vs domain: the name says "Coinbase" but the sending domain is not coinbase.com — FLAG, show both.
- Reply-to mismatch: reply-to address is a different domain from the sender — FLAG, show both.
- Known-brand impersonation: sender claims a known brand (bank, Coinbase, delivery company, carrier) from a domain that brand does not own — FLAG, name the brand and the real domain.
- Contact impersonation: message claims to be from a saved contact name but arrives from an unknown number/address — FLAG, show the number.
- New-sender watch: first-ever message from this sender, or a sender silent for 90+ days suddenly writing urgently — FLAG as "first contact."

### 3.2 Links and attachments
- Link expansion: shortenened links (bit.ly, t.ly, etc.) expanded on-device to show the true destination before any tap.
- Domain age + last-changed: look up the link's domain — FLAG if registered recently OR if last changed very recently on an old domain (the Lesson 2 fingerprint: born 2015, changed today).
- Attachment screening: FLAG executable or installer attachments (.apk, .scr, .iso, .zip containing executables) — never auto-download.
- QR-code scan (quishing): decode QR codes inside message images and run the decoded link through the same checks.

### 3.3 Language and pressure
- Urgency/fear scoring: "act now," "account locked," "verify immediately," threats of loss — FLAG as pressure language, quote the exact words.
- Code-request detection: any message asking the owner to read back, type, or share a verification code — FLAG, with the rule printed: "Never read a code to anyone who called you."

### 3.4 Calls and voicemail
- Spoofed-familiar-number: incoming call from a number matching a saved contact but failing carrier attestation (STIR/SHAKEN where available) — FLAG "number looks familiar, carrier can't confirm it."
- Known-scam-number check: match against the on-device list of numbers the owner (or the community list he opts into) has reported.
- Voicemail transcription scan: transcribed voicemails run through the same language + code-request checks.

### 3.5 SIM-swap and account watch
- Carrier-change alert: if the SIM or carrier profile changes, FLAG immediately — "your number moved, was that you?"
- Verification-code flood: several login codes arriving in a short window — FLAG "someone may be trying your accounts."

### 3.6 The verdict
Each item gets one of three verdicts, shown in plain words with its flags listed underneath:
- **CLEAR** — no flags. Passes through normally.
- **HOLD** — one or more flags. Goes to quarantine (see §4).
- **BLOCKED** — known-bad (owner-reported number/domain, or a link already on a bad list). Never reaches the inbox.

The owner can always overrule a verdict with one tap ("Trust this sender" / "Not a scam"), and the overrule is logged.

## 4. ISOLATION — QUARANTINE

- Suspicious items never reach the normal inbox/notification shade. They sit in the **Quarantine vault** inside Bouncer.
- Quarantined items render in **Safe View**: plain text only, links shown as dead text (not tappable), images and attachments NOT downloaded or opened, QR codes shown decoded as text only.
- The owner can, from quarantine: **Clear** (send to normal inbox), **Delete**, **Block sender**, or **Report** (see §6).
- Quarantine auto-expires: items the owner never touches are auto-deleted after 30 days (owner can change 7/30/90/never), and the deletion is logged.
- Family safe circle: numbers the owner marks as family (Mom, etc.) are never auto-quarantined on name alone — but a message from a family *name* on an *unknown number* still flags as contact impersonation (§3.1). Trust follows the number, not the name.

## 5. LOGGING — THE LOCAL RECORD

- Every scan, verdict, quarantine, clear, delete, block, and report is written to a **local-only log** on the device. Nothing uploads anywhere.
- Each log entry: time, item type (SMS/call/email/notification), sender as shown, verdict, flags with evidence, and what the owner did with it.
- The log is hash-chained (each entry links to the last) so tampering shows.
- The owner can export the log as a file, and can clear it — clearing is itself logged as an entry before wipe.
- Daily digest: one short notification each evening — "Today: 3 held, 1 blocked, 0 cleared" — with one tap to open the vault. No popup stream, ever.

## 6. DELETING AND REPORTING

### Deleting
- Delete from quarantine is one tap, with a confirm. Deleted items are logged (sender, verdict, time) but their content is gone.
- "Shred sender": delete all items from one sender and block them, in one tap.

### Reporting (one tap each, evidence bundled automatically)
- **Report to the impersonated company** — prefilled with the message + headers + the anomaly (e.g. security@coinbase.com for a fake Coinbase mail). The owner taps send from his own mail app; Bouncer never sends mail itself.
- **Report to the registrar** — the abuse desk of the domain's registrar (looked up on-device), with the evidence attached.
- **Report to the carrier** — forward the spam text to **7726** (SPAM) in one tap.
- **Report to the FTC** — prefilled report text for reportfraud.ftc.gov, ready to paste.
- Every report is logged with when, where, and what evidence went with it.

## 7. SCREENS (8, in order)

1. **Dashboard** — today's count (clear / held / blocked), the bouncer's status (watching / paused), one tap to the vault, one tap to the log.
2. **Quarantine vault** — held items, newest first, each with verdict + flags, Safe View on tap.
3. **Scan detail** — one item, every flag listed with its evidence, and the four actions: Clear / Delete / Block sender / Report.
4. **Senders** — allowlist (trusted), blocklist (blocked), family safe circle; add/remove.
5. **Log** — the local record, searchable, exportable.
6. **Reports** — report history: what was reported, where, when.
7. **Scam Hunter** — the training corner: the owner's lessons (Lesson 1 fingerprints, Lesson 2 link dissection), a "test yourself" quiz, and a practice mode that shows a fake scam message and asks him to spot the flags.
8. **Settings** — permissions (each with its plain-English reason and on/off), online lookups toggle (off by default), quarantine auto-delete time, daily digest on/off, export log, erase all data.

## 8. STANDING RULES (repeat at the door of every build — these are load-bearing)

- **No fake, ever.** If a function cannot be built, leave it out and list it under "can't do" with the reason. Never simulate a scan, never show a fake verdict, never present a demo as working.
- **Honesty with the owner:** every verdict shows its evidence. A flag without evidence is not shown.
- **Privacy:** message content never leaves the device without the owner's explicit tap. No cloud account, no analytics, no ads.
- **First-run Button Log test** in the first build (walkthrough of every button, FIRED/BLOCKED/FAILED/ERROR/SKIPPED, export on completion), plus in-app code analysis in the same export. Both REMOVED from the final build by default after test/export, unless keeping is decided and recorded.
- **Prelaunch functions test file** ships with the prompt, click-by-click pass/fail, opens first, Row 0 launch check, crash forces NOT READY.
- **Icon set from day one:** icon-512, icon-192, apple-touch-icon 180, favicon-32, site.webmanifest + head tags — so the app pins to a home screen with a real icon. (Applies to any companion page; the native app carries its launcher icon set.)
- **Light theme** for the owner's working tools. Condensed phone UI: horizontal menu with drop-down, one-line text boxes with expand arrow, buttons side by side or drop-selection past two, bottom padding above phone buttons.
- **Count from 1.** First item is item 1.
- **DELETE-FIRST:** before adding code, name the dead/duplicated code being removed in the same change; removals listed in delivery notes.
- **Act like God, never be God.** The app serves the owner; it does not rule him. It never deletes anything without his word, never blocks a sender permanently without his tap, never reports anything without his tap.
- **Later-phase functions stay grey** with their right name + "upgrade needed" + phase number, wired to registry/policy/BLOCKED — never simulated, never deleted.

## 9. CAN'T-DO LIST (honest limits, part of the delivery)

- **Cannot scan email inside Gmail/Outlook apps directly.** Android does not let a third-party app read another app's email. Email scanning works through Route 1 (§2A): the app signs into the mailbox itself and reads the mail on the device. This limit must be printed in the app's Help screen.
- **Cannot read WhatsApp, Messenger, or other chat apps' messages.** Same reason — no API. Notification content from those apps CAN be scanned via the Notification Listener.
- **Cannot block a call before it rings** on all carriers — it can flag and silence known-scam numbers, but carrier-level blocking varies.
- **Cannot guarantee catching a brand-new scam domain on day one** — no list knows it yet. The anomaly checks (domain mismatch, pressure language, last-changed date) are the day-one defense.
- **Link reputation and domain-age lookups need the network** and are off by default; with them off, verdicts rest on on-device checks only, and the app says so on each verdict.

## 10. DELIVERY

- Native Android app (Kotlin), installable APK.
- Version 1.0 ships: Dashboard, Quarantine vault, Scan detail, Senders, Log, Reports, Settings (7 screens); Scam Hunter training corner is Phase 2 grey (right name + "upgrade needed — Phase 2").
- Delivery notes list: what was built, what was removed (DELETE-FIRST), the can't-do list above, and the first-run Button Log export.
- Price? Buyer? Ask? — per the idea-to-sold gates, those are the owner's decisions, not the builder's. Nothing invented.
