diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bdf1599..631184d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,3 +18,4 @@ jobs: python-version: "3.12" - run: pip install numpy fastapi uvicorn faster-whisper - run: python server/test_cutter.py + - run: python server/test_privacy.py diff --git a/PRIVACY.md b/PRIVACY.md new file mode 100644 index 0000000..7e0b626 --- /dev/null +++ b/PRIVACY.md @@ -0,0 +1,67 @@ +# Privacy: what Nazar does with your call + +Nazar listens to phone calls, the most private conversations people have. So privacy is not a feature here; it is the rule every part of Nazar is built around. + +> **In one line:** in the on-device version, your call never leaves your device, is never saved, and is forgotten as the call goes on. Nazar is a smoke detector, not a recorder. + +## What Nazar never does + +- ❌ **Never records** your call. There is no audio file and no transcript file, anywhere. +- ❌ **Never sends your call** to us, to a cloud, or to any company (on-device mode). +- ❌ **Never keeps** what was said. After 30 seconds, a line is reduced to its scam warning words, or erased completely. +- ❌ **Never tells your family what was said.** The alert only says that a call looks like a scam. +- ❌ **Never needs an account.** No sign-up, no login, no phone number collected by us. +- ❌ **Never shows ads or tracks you.** There is no analytics or tracking code in this project. + +## What happens to your call, step by step (on-device version) + +| Step | Where it happens | What is kept | +|---|---|---| +| 1. The laptop microphone hears the call on speaker | Your device | Nothing: audio goes straight to step 2, in memory | +| 2. Speech is turned into text, sentence by sentence (Whisper) | **Your device** (server bound to `127.0.0.1`, unreachable from the network) | Nothing: each audio sentence is discarded after it becomes text | +| 3. The text is checked for the scam pattern | Your browser, on your device | The text of the **last 30 seconds** only | +| 4. After 30 seconds | Your browser | Only the scam warning words of a line (e.g. "CBI · arrest warrant"); normal talk is erased | +| 5. You press Stop | Your browser | **Everything is wiped** | +| 6. If it is a scam | Your choice: WhatsApp, Telegram, copy or share | Only: *"possible scam call right now, risk 70/100, steps seen: authority, fear, time"* | + +## What the family alert contains + +``` +Nazar alert: possible scam call right now (for Rahul) +Risk: HIGH (70/100) +Steps seen: authority, fear +Time: 10:42 AM +Please call them now and tell them to hang up. Do not share any OTP. +``` + +That is all. No words from the call, no phone number of the caller, no recording. +The alert is only sent through the apps **you** set up (Telegram or WhatsApp), to the person **you** chose. + +## What is stored on your device + +Only your settings, in your own browser: the call language, text size, the family member's name, and your Telegram/WhatsApp details for alerts. +They never leave your device except when an alert is sent, and you can delete them by clearing the site's data in your browser. + +## The one exception: website mode, by your choice + +The website (nazar-codevators.vercel.app) cannot run the speech model, so live listening there uses your **browser's own speech service** (Google in Chrome), which means **audio goes to Google**. +Nazar never switches to this silently: you must choose "Browser speech (cloud)" yourself, and the page warns you first. The privacy badge then changes from 🔒 *On-device* to ⚠️ *Cloud speech*. +Sample calls and typed lines never use the microphone or any cloud service. Like any website host, Vercel may log page visits (not call data). + +## On a real phone (product design) + +- Nazar would listen **only to calls from unknown numbers**, never to saved contacts. +- It would turn on **only when a call starts** and stop when it ends. +- Everything above still applies: on the phone, nothing recorded, nothing sent. + +## How these promises are checked + +Promises are only worth something if they are tested. `npm test` and `python server/test_privacy.py` run on every change (GitHub Actions) and fail if: + +- the speech server listens on anything other than `127.0.0.1`, +- the server prints or writes call text, or opens files for writing, +- the 30-second memory or the wipe on Stop is removed, +- the family alert starts including call text, +- tracking or analytics code is added to the page. + +Found a way Nazar could leak your call? Please report it privately: see [SECURITY.md](SECURITY.md). diff --git a/README.md b/README.md index 2ebab47..b4695ce 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@

+ Privacy · Problem · How it works · Results · @@ -35,6 +36,19 @@ --- +## 🔒 Your privacy comes first + +Nazar listens to phone calls, so privacy is the rule everything is built around: + +- 🎙️ **Your call never leaves your device.** Speech is turned into text on your own laptop; the speech server cannot even be reached from the network. +- 💾 **Nothing is recorded or saved.** No audio files, no transcripts. Each sentence is discarded once it has been checked. +- ⏱️ **Nazar forgets as it goes.** After 30 seconds only scam warning words are kept; pressing Stop wipes everything. +- 👨‍👩‍👧 **Your family is told *that* it is a scam, never *what* was said.** +- 🚫 **No account, no ads, no tracking.** +- ✅ **Tested, not just promised:** privacy tests run on every change and fail if any of this is broken. + +Full details, including the one exception (the website's optional cloud speech, used only if you choose it): **[PRIVACY.md](PRIVACY.md)** + ## 🚨 The problem In a "digital arrest" scam, a caller poses as CBI, police, customs or a court, says you are part of a crime, @@ -104,7 +118,7 @@ All test calls are fictional and written by our team, so these are not real-worl | Wiped when the call ends | Stopping listening forgets all call text | | Alerts carry no conversation | Family sees risk level, steps and time, never what was said | -More: [docs/privacy.md](docs/privacy.md) +More: [PRIVACY.md](PRIVACY.md) · technical notes in [docs/privacy.md](docs/privacy.md) ## ✨ Features diff --git a/package.json b/package.json index 0761c10..1555f4a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Live scam-call detector for digital-arrest scams (Team CodeVators, Code Yudh 2026)", "private": true, "scripts": { - "test": "node web/test.js && node web/test_addressed.js && node web/test_fold.js && node web/test_score.js && node web/test_aware.js", + "test": "node web/test.js && node web/test_addressed.js && node web/test_fold.js && node web/test_score.js && node web/test_aware.js && node web/test_privacy.js", "e2e": "node web/e2e_live.js demo-audio/S1_full.wav", "serve": "python server/server.py" }, diff --git a/server/test_privacy.py b/server/test_privacy.py new file mode 100644 index 0000000..7815a67 --- /dev/null +++ b/server/test_privacy.py @@ -0,0 +1,32 @@ +"""Privacy guards for the speech server: fails if a change could leak call audio or text.""" +import ast, os, re, sys + +src = open(os.path.join(os.path.dirname(__file__), "server.py"), encoding="utf-8").read() +tree = ast.parse(src) +fail = [] + +# 1. Only reachable from this machine. +hosts = re.findall(r'host\s*=\s*"([^"]+)"', src) +if hosts != ["127.0.0.1"]: + fail.append(f"server must listen on 127.0.0.1 only, found {hosts}") + +# 2. Never prints the transcribed text. +for node in ast.walk(tree): + if isinstance(node, ast.Call) and getattr(node.func, "id", "") == "print": + names = {n.id for n in ast.walk(node) if isinstance(n, ast.Name)} + if "text" in names: + fail.append(f"line {node.lineno}: print() uses the call text") + +# 3. Never writes files (no recordings, no transcripts). +for node in ast.walk(tree): + if isinstance(node, ast.Call) and getattr(node.func, "id", "") == "open": + mode = node.args[1].value if len(node.args) > 1 and isinstance(node.args[1], ast.Constant) else "r" + if any(c in mode for c in "wax+"): + fail.append(f"line {node.lineno}: open() for writing") +if re.search(r"\b(sf\.write|wavfile\.write|soundfile|\.tofile\(|np\.save)", src): + fail.append("server writes audio or arrays to disk") + +for f in fail: + print("FAIL", f) +print("PASS" if not fail else f"{len(fail)} failed") +sys.exit(1 if fail else 0) diff --git a/web/index.html b/web/index.html index d92126b..5ba01f3 100644 --- a/web/index.html +++ b/web/index.html @@ -72,6 +72,7 @@

The call

🔒 On-device · nothing recorded

+

Read our full privacy promise: what Nazar never does, and what happens to your call step by step.

Put the phone call on speaker next to this laptop, or read a scam script aloud. Speech is turned into text by your browser's speech service (Chrome or Edge). Nazar's scoring runs here on this page.