wiqilee.dev
← All writing
16 March 202612 min readVoxGuard

I Built VoxGuard, an AI Agent That Detects and Disrupts Scams in Real Time

A real-time multimodal system for scam detection and live intervention, powered by Gemini Live and Rust-based WebAssembly

AI agentsGemini LiveReal-time audioSecurity
Illustration: A father caught in a high-pressure scam call, in the brief moment when trust collapses into urgency and fear.
Illustration: A father caught in a high-pressure scam call, in the brief moment when trust collapses into urgency and fear.

Last year, my neighbor’s father wired $12,000 to someone impersonating a bank representative. He knew scams were everywhere. He had seen the warnings, read the advice, and understood the basics. But when the caller said his account would be frozen within ten minutes and asked for his one-time password, he handed it over immediately.

I kept thinking about that moment. Not because of the money, but because of what it revealed: most anti-scam advice fails at the exact moment it matters. He had a phone, life experience, and enough caution to know better. None of that helped in the thirty seconds when pressure, fear, and urgency took over.

And that gap is far bigger than one family. According to the FBI’s IC3 2024 Annual Report, reported internet crime losses in the United States hit $16.6 billion in 2024. In its 2024 report, the Global Anti-Scam Alliance estimated that consumers worldwide lost more than $1.026 trillion to scams.

Concept illustration: The VoxGuard landing interface, designed to position scam detection as a live, real-time defense system rather than a post-incident warning.
Concept illustration: The VoxGuard landing interface, designed to position scam detection as a live, real-time defense system rather than a post-incident warning.
Live screenshot: VoxGuard’s real-time monitoring dashboard, where scam signals, threat scoring, and intervention logic work together during a live call.
Live screenshot: VoxGuard’s real-time monitoring dashboard, where scam signals, threat scoring, and intervention logic work together during a live call.

So I built VoxGuard: a real-time multimodal AI agent that listens to live conversations, detects scam patterns as they emerge, and intervenes before the damage is done. Not after the call. Not the next day. Right at the moment the scammer asks for your one-time password.

In this article, I’ll show you what VoxGuard does, how it works, and why I believe it points to a fundamentally different approach to scam protection.

The Gap Nobody Is Filling#

The real gap is not awareness. It is intervention.

Most anti-scam tools are designed for one of two moments: before a conversation starts, or after the damage is already done. Truecaller blocks known scam numbers. Hiya flags suspicious callers. ScamShield in Singapore filters reported contacts. These systems are useful, but they are optimized for screening and reporting, not live defense.

What they generally do not do is listen inside the interaction itself: the moment a scammer shifts tactics, creates urgency, asks for an OTP, or pressures someone into acting before they can think. That is where scams become effective. And that is the gap I wanted to build for.

But here is the real problem: once the conversation starts, you are on your own. The moment a scammer says,

“Your account will be frozen in ten minutes unless you verify your identity right now,”

there is no system listening in real time. No intelligence layer analyzing what is being said. No safety net between your panic and your bank account.

That is the gap VoxGuard is built to fill.

What VoxGuard Actually Does#

VoxGuard runs directly in the browser alongside virtually any calling platform, whether that is a phone call, WhatsApp, Zoom, or Teams. It does not replace your calling app. Instead, it works alongside it, listening in real time.

It operates in two modes.

Demo Mode lets anyone experience VoxGuard instantly, with no microphone, backend, or API key required. After clicking START and selecting a demo script, users hear a simulated scam conversation with realistic two-way dialogue while VoxGuard surfaces real-time alerts and triggers live interventions as risk emerges.

Live Mode provides protection during actual calls. After starting a session, users click LIVE MIC, grant microphone permission, and place their phone on speaker. VoxGuard captures live microphone audio at 16 kHz mono PCM through the Web Audio API, preprocesses it with the Rust WASM engine, streams it to the backend over WebSocket, and sends it to Gemini for real-time analysis. Live Mode requires a running backend on Google Cloud Run and a valid Gemini API key. Demo Mode and Live Mode can also run side by side.

Here is what happens during a live conversation.

First, a Rust WebAssembly audio engine captures microphone input and processes it in under 80 milliseconds. It performs noise reduction, spectral analysis, and voice activity detection, then downsamples the audio to 16 kHz mono PCM before streaming it to the backend in 250-millisecond frames.

Second, the backend Audio Analyzer buffers the preprocessed audio in two-second intervals with voice activity detection, encodes it as base64, and sends it to gemini-2.5-flash through the standard Gemini API using generate_content_async with inline audio data. The model returns structured JSON containing real-time transcription, scam indicators, manipulation tactics, and lie-detection signals.

Third, this is where VoxGuard moves beyond transcription and into behavioral analysis. Using Cialdini’s six principles of influence, scarcity, authority, fear, reciprocity, isolation, and commitment, alongside content-analysis techniques inspired by Criteria-Based Content Analysis, the system evaluates the psychological structure of the manipulation attempt. It looks not only at what the caller is saying, but also at how it is being said and which psychological triggers are being activated.

Fourth, when the threat score crosses a threshold or a fatal pattern is detected, such as a request for a one-time password or a demand for gift card payments, VoxGuard triggers an intervention. A full-screen overlay takes over. The conversation pauses. A natural voice generated by gemini-2.5-flash-preview-tts warns the user in their own language. An explanation card makes the risk immediately clear. A Safe Exit button lets them disconnect at once.

Fifth, after Safe Exit, VoxGuard becomes a recovery coach. The Guided Action Agent generates a personalized, step-by-step response plan based on the scam type, the user’s country, and the severity of the threat. Each step includes a checkbox so progress is easy to track. The plan also includes country-specific emergency contacts and reporting channels across nine countries.

Three Tiers of Intervention#

Not all scam attempts are equal. A caller creating mild urgency is very different from one demanding your one-time password. VoxGuard is designed to respond to that difference through three escalating levels of intervention.

WARN is triggered when the threat score rises above 55 or when a high-risk manipulation pattern is detected. The user sees an amber overlay with options to verify the caller, exit safely, or continue with caution. The system delivers a calm, advisory voice warning using the Kore voice profile.

BLOCK is triggered when the score reaches 75 or when a fatal pattern is detected. Fatal patterns include one-time password extraction, so-called safe account transfers, gift card demands, and cryptocurrency transfer requests. In these cases, there is no Continue button. The overlay shows Safe Exit only. A firm, authoritative voice using the Puck voice profile tells the user exactly what is happening.

LOCKDOWN is triggered at a score of 90 or higher. At that point, the system treats the interaction as a confirmed scam. A 30-second countdown begins, and the call is disconnected automatically. A commanding voice using the Charon voice profile delivers the final warning.

Some patterns are so dangerous that they trigger an immediate BLOCK, regardless of the cumulative score. If a caller asks for a one-time password, VoxGuard does not wait for the score to reach 75. It intervenes immediately. This behavior works consistently across all nine fully supported languages. If someone asks for a one-time password in Indonesian, Japanese, Korean, or Arabic, VoxGuard blocks the interaction instantly.

Why Psychological Scoring Changes Everything#

Most scam detection systems rely on keyword matching. If a caller says “transfer money” or “gift card,” the system flags it. That works for the obvious cases.

But sophisticated scammers rarely speak that directly. They build trust over time. They establish false authority. They manufacture urgency. They isolate the victim from friends and family. By the time the actual request arrives, the victim often complies willingly because their psychological defenses have already been worn down.

VoxGuard is designed to catch that progression in real time. It maps six psychological vectors as the interaction unfolds: Scarcity (“This offer expires in 10 minutes”), Authority (“I’m calling from the fraud department”), Fear (“Your account will be frozen”), Reciprocity (“We already helped you, now you need to help us”), Isolation (“Do not tell your family about this”), and Commitment (“You already agreed to verify your identity”).

On top of that, VoxGuard tracks five deception indicators inspired by behavioral analysis: inconsistencies in the caller’s story, strategic vagueness when challenged, excessive unsolicited detail, deflection when asked direct questions, and pressure to act before the victim has time to verify.

These scores are not there just for display. They feed directly into the intervention system. High panic combined with high authority can trigger earlier intervention. The system adapts in real time to the manipulation as it unfolds.

The Technical Stack#

VoxGuard: Real-time multimodal AI scam detection architecture
VoxGuard: Real-time multimodal AI scam detection architecture
VoxGuard: Database and Storage Architecture
VoxGuard: Database and Storage Architecture
VoxGuard’s backend is deployed on Google Cloud Run in production
VoxGuard’s backend is deployed on Google Cloud Run in production

VoxGuard is built as a four-layer system.

At the browser layer, a Rust WebAssembly audio engine compiled to roughly 45 KB handles Wiener noise reduction, spectral subtraction, voice activity detection, and RMS normalization, all with zero-copy memory management. The React frontend, built with Vite 5, renders the five main tabs, Monitor, Psych, Patterns, Report, and About, along with the intervention overlay and the action agent. WebSocket provides bidirectional communication, with exponential backoff reconnect logic and keepalive pings to prevent Cloud Run idle timeouts.

The backend is built as a Python FastAPI application on Google Cloud, powered by three core services. Cloud Run hosts the auto-scaling backend and its seven parallel analysis services. Cloud Firestore persists session data, forensic reports, and intervention history across sessions. Cloud Storage stores session audio recordings captured through Live Mic mode for forensic export and replay.

Those seven analysis services include an Audio Analyzer for real-time transcription and analysis through the Gemini Live API using gemini-2.5-flash; a Vision Analyzer for detecting fake login pages, fraudulent dashboards, and malicious QR codes from screen captures using gemini-2.5-flash; a Psych Analyzer for psychological profiling from the running transcript, returning Cialdini vectors, CBCA-inspired deception indicators, user vulnerability scores, and an intervention recommendation in a single call; a TTS Service for generating natural intervention audio through gemini-2.5-flash-preview-tts with three voice profiles; an Explanation Service for combining audio and visual signals into multimodal explanation cards; an Action Agent for generating personalized recovery plans with country-specific emergency contacts across nine countries; and a Threat Engine for running a weighted composite scoring cycle every 500 milliseconds.

The threat engine scores each alert using a weighted formula: 45 percent for language analysis, 35 percent for behavioral signals, and 20 percent for visual analysis when screen sharing is active. It evaluates every alert against both score thresholds, 55, 75, and 90, and instant-trigger pattern matches such as one-time password extraction, gift card demands, cryptocurrency transfer requests, and so-called safe account transfers.

The intervention system generates natural voice warnings through Gemini TTS with three voice profiles matched to the level of urgency: Kore for calm advisory messages, Puck for firm warnings, and Charon for commanding lockdown alerts. Scenario-based verification challenges are tailored to the detected scam type across seven scenarios: bank, government, tech support, investment, family, prize, and urgency. The entire system is fully localized across nine languages.

All 50-plus detection patterns are grounded in published reports from the FBI IC3, the FTC, GASA, MAS, the ACCC, Interpol, and nine national authorities. Nothing is hallucinated. Nothing is synthetic. Every detection is traceable to a specific source. In production, the entire system runs on three Google Cloud services: Cloud Run for compute, Cloud Firestore for session persistence, and Cloud Storage for audio recordings.

Audio Recording#

VoxGuard includes a REC button for capturing live microphone audio as part of its forensic export workflow. Recording is available only in Live Mic mode, where audio is captured directly from the device microphone through the Web Audio API. In Demo Mode, the REC button is disabled because browser security restrictions prevent the app from recording audio generated through browser speech synthesis or other programmatic playback paths.

When Live Mic and REC are enabled at the same time, the session audio is saved as a WebM or MP4 blob and embedded in the forensic report. Exported HTML reports also include a built-in audio player for session replay.

Screen Share Detection#

With explicit user consent, VoxGuard captures screen frames every two seconds through the getDisplayMedia API and sends them to the backend for Gemini-powered visual analysis. The Vision Analyzer is designed to detect fake bank login pages, fraudulent investment dashboards, malicious QR codes, and spoofed government portals.

Screen share detection is fully opt-in, available only on desktop, and active only in production mode with a running backend.

40 Languages, 35+ Regional Variants#

Scam patterns vary dramatically across cultures. Indonesia’s Mama Minta Pulsa, in which a family member supposedly asks for emergency mobile credit from a hospital, looks very different from Japan’s Ore Ore Sagi, where a caller impersonates a son and demands urgent cash, or Korean voice phishing, where scammers pose as financial authorities and pressure victims to transfer money to a so-called safe account.

VoxGuard supports 40 languages through the Gemini API, with nine fully localized experiences spanning demo scripts, alerts, voice TTS, and the action agent: English, Indonesian, Chinese, Japanese, Korean, Spanish, French, Hindi, and Arabic. Malay and Portuguese also have partial native support, including localized demo scripts and TTS.

The pattern library includes more than 35 country-specific variants grounded in local regulatory and law enforcement sources, including OJK and Bareskrim in Indonesia, the NPA in Japan, the FSS in Korea, the MPS in China, MHA Cybercrime in India, INCIBE in Spain, PHAROS in France, SAMA in Saudi Arabia, and Interpol for international patterns.

Try It Now#

VoxGuard includes a full demo mode that requires no microphone, no backend, and no API key. After clicking START and selecting a demo script, users can watch the system detect scam patterns in real time through two-way dialogue, complete with caller and victim voices, a live transcript, rising threat scores, and intervention overlays that appear automatically when the interaction crosses the line.

For real call protection, users can enable Live Mic mode by clicking the microphone button, granting permission, and placing their phone on speaker. VoxGuard then listens to the live call and analyzes it in real time. This mode requires a running backend and a valid Gemini API key.

Demo scripts cover a wide range of scam scenarios, including bank fraud, tech support scams, government and tax fraud, AI voice-cloning scams, digital arrest scams, family emergency impersonation, crypto scams, and fraudulent job offers, all available across nine languages.

What I Learned Building This#

Latency matters more than raw accuracy. A 95 percent accurate alert delivered in 80 milliseconds is far more valuable than a 99 percent accurate alert delivered three seconds too late. By the time a slower alert fires, the victim may already have shared the code.

Intervention is as much a UX problem as it is a detection problem. The first version used a simple warning banner, and users dismissed it without reading. The second blocked the screen but offered no context, which left users confused. The final three-tier system, with scenario-based challenges, contextual explanation cards, natural voice warnings through Gemini TTS, and a forced Safe Exit for fatal patterns, came from treating intervention as a design problem rather than only a detection problem.

Psychological scoring changes the detection paradigm. Keyword matching catches the obvious scams. Mapping Cialdini vectors catches the ones where the caller never explicitly says “transfer money” but steadily builds authority, fear, and isolation until the victim complies on their own.

This Is Not a Side Project#

I did not build VoxGuard as a weekend experiment. I built it because the gap between knowing about scams and recognizing one in real time may be one of the most expensive gaps in consumer technology.

Most existing tools treat scam protection as something to solve before the call begins or after it ends. VoxGuard is designed for the moment in between. It listens while the conversation is happening. It intervenes when someone is about to make a mistake. And after the call ends, it helps guide the recovery process.

The live demo is available on Vercel, the source code is on GitHub, and the full video walkthrough is available on YouTube. VoxGuard was built for the Gemini Live Agent Challenge 2026.

More than anything, VoxGuard was built to protect the people who need it most. Follow VoxGuard on X for project updates.

Also on Medium

I publish every article on Medium too. Follow me there to get new posts in your feed, or leave a clap if this one helped.

Wiqi LeeData scientist, AI/ML researcher and software engineer. More about me.