From 7a32fb5a8fab7472b30a4c5bb67069a85dc0dbe9 Mon Sep 17 00:00:00 2001 From: Kunal Mittal Date: Wed, 28 Oct 2026 02:57:39 +0530 Subject: [PATCH 1/6] Add PRIVACY.md: what Nazar never does, what happens to a call step by step, the website exception --- PRIVACY.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 PRIVACY.md 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). From 0734131506802869c6dbf3006418c5efec830e8f Mon Sep 17 00:00:00 2001 From: Kunal Mittal Date: Wed, 28 Oct 2026 02:57:39 +0530 Subject: [PATCH 2/6] Add server privacy tests: localhost only, never prints call text, never writes files --- server/test_privacy.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 server/test_privacy.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) From 87147476b4596af74bf7663623d7205f3cb1c29b Mon Sep 17 00:00:00 2001 From: Kunal Mittal Date: Wed, 28 Oct 2026 02:58:05 +0530 Subject: [PATCH 3/6] Add page privacy tests: 30 s memory, wipe on Stop, alert without call text, no tracking, consent for cloud speech --- web/test_privacy.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 web/test_privacy.js diff --git a/web/test_privacy.js b/web/test_privacy.js new file mode 100644 index 0000000..97293ba --- /dev/null +++ b/web/test_privacy.js @@ -0,0 +1,17 @@ +// Privacy guards for the page: fails if a change could keep, send or track call content. +const fs = require("fs"); +const app = fs.readFileSync(__dirname + "/app.js", "utf8"); +const html = fs.readFileSync(__dirname + "/index.html", "utf8"); +let fail = 0; +function ok(name, cond) { if (!cond) { fail++; console.log("FAIL", name); } else console.log("ok ", name); } +const body = (fn) => { const i = app.indexOf("function " + fn + "("); let d = 0, j = app.indexOf("{", i); const s = j; do { if (app[j] === "{") d++; else if (app[j] === "}") d--; j++; } while (d); return app.slice(s, j); }; + +ok("call text is forgotten after 30 seconds", /MEMORY_MS = 30000/.test(app) && /setInterval\(\(\) => forgetLines\(MEMORY_MS\)/.test(app)); +ok("Stop wipes all call text", /forgetLines\(0\)/.test(body("stopListening"))); +ok("family alert never includes call text", !/session|lines|transcript|text/.test(body("familyText").replace(/textContent/g, ""))); +ok("no tracking or analytics code", !/google-analytics|gtag\(|googletagmanager|mixpanel|segment\.com|hotjar|facebook\.net|clarity\.ms/i.test(app + html)); +const urls = [...app.matchAll(/fetch\(\s*["'`]([^"'`]+)/g)].map((m) => m[1]); +ok("the page only talks to its own server and Telegram (alerts)", urls.every((u) => u === "/health" || u.startsWith("https://api.telegram.org/") || /\.(css|js|html|json)$/.test(u))); +ok("cloud speech needs the user's consent", /confirm\(".*cloud speech/i.test(app)); +console.log(fail ? `${fail} failed` : "PASS"); +process.exit(fail ? 1 : 0); From 4a3f1efd59f0c461a736057caefce55afcdd3cf2 Mon Sep 17 00:00:00 2001 From: Kunal Mittal Date: Wed, 28 Oct 2026 02:58:07 +0530 Subject: [PATCH 4/6] Run the privacy tests on every change (npm test and GitHub Actions) --- .github/workflows/test.yml | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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/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" }, From aded68228969b484dc155a94910d54c47a64ad0a Mon Sep 17 00:00:00 2001 From: Kunal Mittal Date: Wed, 28 Oct 2026 02:58:07 +0530 Subject: [PATCH 5/6] README: privacy promise as the first section, linked from the top --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 From 8ded18fa69a295d57ef4cdaae913ef7df05ad949 Mon Sep 17 00:00:00 2001 From: Kunal Mittal Date: Wed, 28 Oct 2026 02:58:18 +0530 Subject: [PATCH 6/6] App: link the full privacy promise from the privacy panel --- web/index.html | 1 + 1 file changed, 1 insertion(+) 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.