Project Info
Inspiration
Online shopping has become a high-stakes trust decision made in seconds with almost no usable information. Is this store real? Is this "sale" legitimate? Is the seller verified? The penalty for guessing wrong isn't a mild inconvenience — it's a drained bank account, identity theft, or a package that never ships. And the impacts are very real: $12.5B lost to fraud in 2024 (25% increase year-to-year) 859,000 complaints with $16B in losses recorded by the Internet Crime Complaint Center 1 in 5 US adults have lost money to an online scam 75% of victims never report it to law enforcement People over 60 suffered nearly $5B in losses alone What makes this uniquely dangerous is that scam sites don't look like scams anymore. They have polished storefronts, convincing checkout flows, and social proof indistinguishable from the real thing. "Safe shopping" today requires the user to cross-reference domain age, SSL validity, safety databases, community sentiment, and seller verification — work most people don't have the time or expertise to do under pressure from countdown timers and urgency language. We built Sniff to close that gap: turn safety from a burden into an automatic agentic layer of commerce without sacrificing price intelligence. What It Does Just tell Sniff what you want. It goes to work. Guided Discovery: Sniff starts a conversation, not a search. It asks the right clarifying questions (gender, style, budget, brand) to understand exactly what you need before searching. Multi-Retailer Search: Searches across Google Shopping, pulling real product listings from Amazon, Best Buy, Walmart, Nordstrom, and dozens more. Dead links get filtered out before you ever see them. 5 Parallel Fraud Checks per Listing: Retailer Reputation: WHOIS domain age, registrar signals, suspicious TLDs Safety Database: Google Safe Browsing + ScamAdviser threat intelligence Community Sentiment: Reddit post mentions, scam reports, real user experiences Brand Impersonation: Detects typosquatting and lookalike domains Page Red Flags: Urgency tactics, missing policies, suspicious payment methods Retailer Reputation: WHOIS domain age, registrar signals, suspicious TLDs Safety Database: Google Safe Browsing + ScamAdviser threat intelligence Community Sentiment: Reddit post mentions, scam reports, real user experiences Brand Impersonation: Detects typosquatting and lookalike domains Page Red Flags: Urgency tactics, missing policies, suspicious payment methods Live-Streaming Results: Products appear, fraud checks fill in, verdicts land — all in real time via Server-Sent Events. You watch the investigation happen. Trust Verdict: Every listing gets a verdict (trusted/caution/danger) and a trust score (0–100). Sniff recommends the best pick — the cheapest option among the safest options. Dramatic Cleanup: Tap "PURGE CURSED" and flagged listings get eliminated in a black hole animation. Remaining safe results shuffle into price order. The best deal gets crowned. How We Built It Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS, Framer Motion, Zustand, Vercel Backend: Next.js API Routes with Server-Sent Events streaming. Each investigation spawns a parallel tool pipeline — WHOIS lookup, Google Safe Browsing, ScamAdviser, Reddit search, brand impersonation detection, page scraping — that streams structured findings as they complete. AI: OpenAI powers the core agent loop. gpt-5-mini handles structured fraud analysis and tool orchestration via function calling. gpt-4o-mini drives the multi-turn query refinement engine. Every tool call returns structured output that the agent reasons over before deciding what to do next. Web Data: Bright Data SERP API for Google Shopping results with real product images and prices. Browserbase + Stagehand for AI-powered browser automation — navigating real retailer pages, extracting structured product data, and verifying prices without brittle CSS selectors. Perplexity Sonar for cross-retailer price research when SERP data isn't enough. Fraud Scoring: 150+ verified retailers allowlist for instant trust decisions. Weighted scoring with normalization across 5 independent signals. Fatal flags for malware/phishing short-circuit to danger regardless of other signals. Early URL validation filters dead links before users ever see them. The Agent Loop Sniff is a multi-turn agent that accumulates context and adapts across steps. Turn 1 — Understand Intent: The query refiner decides if the user's request is specific enough to search, or asks the highest-information-gain clarifying question. Each user answer is fed back as context for the next decision. The agent tracks which dimensions it's already covered (budget, brand, style) and picks the most useful unanswered one. Turn 2 — Search & Validate: Once intent is clear, the agent searches across retailers, validates every URL for reachability, and streams results. It holds all products in working memory while fraud checks run in parallel. Turn 3 — Investigate & Score: For each listing, the agent orchestrates 5 independent tools concurrently, collects their structured outputs, and computes a weighted trust verdict. It uses the full set of results as context — price anomaly detection compares each listing against the trusted-retailer median, so a $49 pair of headphones only gets flagged if trusted retailers sell it for $250+. Turn 4 — Recommend: The agent synthesizes everything — trust scores, prices, fraud signals — and recommends the best deal. The entire chain streams to the frontend as it happens. Challenges We Ran Into Unreliable web data: Listings vary by site and many are JS-rendered, so we had to combine search APIs, scraping, proxies, and browser automation while still normalizing everything into clean, typed results. Real-time agent orchestration: Coordinating a multi-step pipeline (search → checks → verdict → stream) to stay fast, stable, and understandable under SSE was non-trivial. Animation under React Compiler: With reactCompiler: true, re-render-based animations broke, forcing us to re-engineer complex sequences (BlackHoleWipe, ShuffleSort) in pure CSS keyframes. Accomplishments We're Proud Of End-to-end agentic commerce pipeline: multi-turn clarify → streaming search → parallel fraud validation → price-optimized recommendation Modular fraud toolkit (WHOIS, SSL, Safe Browsing, Reddit, seller verification, brand impersonation) wired through a shared type contract Real-time SSE streaming where users watch the investigation happen, not just a loading spinner Polished pixel-art UI with a persistent saved-items dashboard that stores full fraud-report snapshots across sessions What We Learned Fraud detection is fundamentally a calibration problem — the hard part isn't catching scams, it's not flagging legitimate businesses Multi-turn query refinement dramatically improves search relevance vs. raw keyword search Real-time SSE streaming with complex frontend state machines requires careful orchestration — out-of-order events and race conditions are the norm Pixel art is surprisingly time-consuming What's Next for Sniff Chrome Extension — Investigate any link in browser before you buy Image Search — Snap a photo, Sniff finds it and validates sellers Deeper Seller Verification — Crawl seller profiles with Stagehand and Browserbase, verify physical addresses, extract business registration data Price Tracking — Monitor prices over time and alert when trusted deals drop
The Problem
Online shopping is a trust decision made in seconds with almost no usable information.
- $12.5B lost to online fraud in 2024 - up 25% year-over-year (FTC)
- 859,000 complaints with $16B in losses (Internet Crime Complaint Center)
- 1 in 5 US adults have lost money to an online scam
- 75% of victims never report it
Scam sites don't look like scams anymore. They have polished storefronts, real-looking checkout flows, and fake social proof indistinguishable from the real thing. "Safe shopping" today requires cross-referencing domain age, SSL validity, safety databases, community sentiment, and seller verification - work nobody has time to do while a countdown timer pressures them to buy.
Sniff closes that gap. Safety becomes an automatic layer of commerce, not a burden.
What It Does
Tell Sniff what you want. It goes to work.
Guided Discovery
Sniff starts a conversation, not a search. It asks the right clarifying questions - gender, style, budget, brand - to understand exactly what you need before searching. Each answer feeds back into the agent's understanding.
Multi-Retailer Search
Searches across Google Shopping, pulling real listings from Amazon, Best Buy, Walmart, Nordstrom, and dozens more. Dead links get filtered before you ever see them.
5 Parallel Fraud Checks Per Listing
| Check | What It Does |
|---|---|
| Retailer Reputation | WHOIS domain age, registrar signals, suspicious TLDs |
| Safety Database | Google Safe Browsing + ScamAdviser threat intelligence |
| Community Sentiment | Reddit mentions, scam reports, real user experiences |
| Brand Impersonation | Detects typosquatting and lookalike domains |
| Page Red Flags | Urgency tactics, missing policies, suspicious payment methods |
Real-Time Streaming
Products appear, fraud checks fill in, verdicts land - all live via Server-Sent Events. You watch the investigation happen, not a loading spinner.
Trust Verdict
Every listing gets a verdict (trusted / caution / danger) and a trust score (0-100). Sniff recommends the best pick - the cheapest option among the safest options.
Purge & Sort
Tap PURGE CURSED and flagged listings spiral into a black hole. Safe results shuffle into price order. The best deal gets crowned.
How It Works
User Query
│
▼
┌─────────────────────┐
│ Guided Discovery │ gpt-4o-mini decides: specific enough to search,
│ (Multi-Turn Agent) │ or ask the highest-info-gain clarifying question?
└─────────┬───────────┘
│ query refined
▼
┌─────────────────────┐
│ Product Search │ Bright Data SERP → Google Shopping
│ │ Perplexity Sonar fallback
└─────────┬───────────┘
│ N products
▼
┌─────────────────────────────────────────────┐
│ Parallel Fraud Validation (×N) │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
│ │ WHOIS │ │ Safe │ │ Reddit │ │
│ │ Lookup │ │ Browsing│ │ Sentiment │ │
│ └──────────┘ └──────────┘ └──────────────┘ │
│ ┌──────────────┐ ┌────────────────────────┐ │
│ │ Brand │ │ Page Red Flags │ │
│ │ Impersonation│ │ (Scraping) │ │
│ └──────────────┘ └────────────────────────┘ │
└─────────────────────┬───────────────────────┘
│ scored & verdicted
▼
┌───────────────┐
│ Best Pick │ cheapest × safest
│ Recommendation│
└───────────────┘
All steps stream to the frontend as they happen via SSE.
The Agent Loop
Sniff isn't a single API call - it's a multi-turn agent that accumulates context and adapts across steps.
Turn 1 - Understand intent: The query refiner decides if the request is specific enough to search, or asks the highest-information-gain clarifying question. It tracks which dimensions it's covered (budget, brand, style) and picks the most useful unanswered one.
Turn 2 - Search & validate: Searches across retailers, validates every URL for reachability, streams results. Holds all products in working memory while fraud checks run in parallel.
Turn 3 - Investigate & score: Orchestrates 5 independent tools concurrently per listing, computes weighted trust verdicts. Price anomaly detection compares each listing against the trusted-retailer median - a $49 pair of headphones only gets flagged if trusted retailers sell it for $250+.
Turn 4 - Recommend: Synthesizes trust scores, prices, and fraud signals to recommend the best deal. The entire chain streams live.
Tech Stack
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router), React 19, TypeScript (strict) |
| Styling | Tailwind CSS 4, Framer Motion, pixel-art game aesthetic |
| State | Zustand |
| AI | OpenAI gpt-5-mini (fraud analysis, tool orchestration), gpt-4o-mini (query refinement) |
| Search | Bright Data SERP API (Google Shopping), Perplexity Sonar (price research fallback) |
| Scraping | Bright Data Web Unlocker, Browserbase + Stagehand (AI browser automation) |
| Safety APIs | Google Safe Browsing, ScamAdviser |
| Deployment | Vercel (SSE streaming, edge-optimized) |
React Compiler enabled for production performance. 150+ verified retailer allowlist for instant trust decisions on major domains.
Architecture
src/
├── app/
│ └── api/
│ ├── shop/ POST - SSE stream: product search + fraud checks
│ │ └── refine/ POST - JSON: guided discovery query refinement
│ ├── investigate/ POST - SSE stream: full URL investigation
│ ├── compare/ POST - SSE stream: agentic price comparison
│ └── deepen/ POST - SSE stream: drill deeper on a finding
├── lib/
│ ├── shopping-agent.ts Multi-step shopping pipeline orchestrator
│ ├── agent.ts OpenAI Responses API agent loop
│ ├── query-refiner.ts Guided Discovery engine
│ ├── scoring.ts Threat score calculation
│ ├── known-domains.ts 150+ trusted retailer allowlist
│ ├── stream.ts SSE streaming utilities
│ └── tools/
│ ├── validate-product.ts 5-check fraud validation per product
│ ├── fraudCheck.ts Fraud check orchestrator
│ ├── serpSearch.ts Bright Data SERP → Google Shopping
│ ├── seller-check.ts Two-step seller page extraction
│ ├── whois.ts Domain registration analysis
│ ├── ssl.ts Certificate validation
│ ├── safe-browsing.ts Google Safe Browsing API
│ ├── scamadviser.ts ScamAdviser trust score
│ ├── reddit.ts Reddit sentiment search
│ ├── brand-impersonation.ts Typosquatting / lookalike detection
│ ├── scraper.ts Page red flag scanning
│ ├── priceSearch.ts Perplexity price comparison
│ ├── browserbase.ts Stagehand AI browser automation
│ └── brightdata.ts Bright Data structured scraper
├── components/ Pixel-art UI components, React Flow board
└── types/ Shared TypeScript interfaces
Getting Started
git clone https://github.com/thenerd31/sniff.git
cd sniff
npm install
Set up environment variables:
OPENAI_API_KEY=
BRIGHT_DATA_API_KEY=
BRIGHT_DATA_SERP_ZONE=
BRIGHT_DATA_UNLOCKER_ZONE=
PERPLEXITY_API_KEY=
GOOGLE_SAFE_BROWSING_KEY=
SCAMADVISER_API_KEY=
BROWSERBASE_API_KEY=
BROWSERBASE_PROJECT_ID=
npm run dev # → localhost:3000
Testing
# Library-level E2E (no server required)
npm run test:pipeline
# HTTP-level (requires dev server running)
npm run test:api shop "Sony WH-1000XM5 headphones"
npm run test:api investigate "https://example.com"
npm run test:api refine "I want a jacket"
What's Next
- Chrome extension - investigate any link in-browser before you buy
- Image search - snap a photo, Sniff finds it and validates sellers
- Deeper seller verification - Stagehand-powered crawling of seller profiles, business registration, physical address verification
- Price tracking - monitor prices over time, alert when trusted deals drop
Team
Built at TreeHacks 2026 by Aswin, Davyn, Manraj, and Yifan.
Analysis
View
Metric
- 23
- 14
- 6
- 1
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- Next.jsIn code
- OpenAIIn code
- PythonIn code
- ReactIn code
- Tailwind CSSIn code
- TypeScriptIn code
- VercelClaimed
7 of 8 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- Claude CodeConfig
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
652 KB
Source files
92
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
thenerd31/sniff
112 files · 1.3 MB · @ 364f974
Structure
Interface
34 files · 30%Screens, components and styles rendered to the user.
API & routing
9 files · 8%Request entry points: routes, handlers and controllers.
Application logic
21 files · 19%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- TypeScript85%
- Markdown9%
- CSS4%
- Python2%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
package.json
npm · 32- @browserbasehq/sdk
- @browserbasehq/stagehand
- @radix-ui/react-dialog
- @radix-ui/react-slot
- @radix-ui/react-tooltip
- @reactflow/background
- @reactflow/controls
- @reactflow/core
- class-variance-authority
- clsx
- framer-motion
- lucide-react
- next
- openai
- puppeteer-core
- react
- react-dom
- reactflow
- +14 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.