AWS Builder Center
ScamShield

ScamShield

We built ScamShield, an AI-powered scam detection platform that analyzes suspicious messages, URLs, and screenshots and explains the warning signs behind its assessment. For our AWS build, we integrated the AWS Strands Agents SDK to add a second-pass agentic workflow that validates scan results, generates safety checklists, and creates investigation briefs—making scam analysis more structured, explainable, and actionable.

We Built ScamShield: An Explainable AI Agent for Detecting Online Scams

Scams have become increasingly difficult to recognize.
A message can look like it came from a bank. A job offer can look completely legitimate. A link can use a familiar brand name. A screenshot can contain all the right logos and still be designed to trick someone into clicking, paying, or sharing sensitive information.
That made us want to build something simple:
What if you could check suspicious content before acting on it?
That idea became ScamShield — an AI-powered scam-awareness web application that analyzes suspicious messages, links, and screenshots and explains why something may be risky instead of simply saying "scam" or "safe."
For the AWS First Commit build, we also added an AWS Strands Agents SDK layer that performs a second-pass investigation on ScamShield's existing analysis.



The Problem

Many scam warnings are too vague.
If an application simply says:
"This looks suspicious."
the user still has to figure out what was suspicious and what they should do next.
We designed ScamShield around three questions:
  1. What makes this suspicious?
  1. How risky does it appear to be?
  1. What should I do next?
The application can analyze messages, URLs, and screenshots and return a structured report containing a risk score, risk level, category, confidence, warning signals, explanation, and recommended actions.
The goal isn't to claim absolute certainty. It is to help someone pause and verify before acting.



What We Built

The current ScamShield application has several analysis modes.

💬 Message Analysis

A user can paste a suspicious SMS, WhatsApp message, email, job offer, banking notification, or payment request.
For example:
URGENT: Your bank account will be blocked today.
Verify your account immediately using this link.
ScamShield looks for patterns such as:
  • Urgency and pressure
  • Requests for sensitive information
  • Payment or fee requests
  • Account/KYC threats
  • Suspicious links
The result isn't just a label. It provides the signals that contributed to the assessment.



🔗 URL Analysis

Users can submit a URL for inspection.
The backend can retrieve publicly accessible page content and provide relevant page information to the AI analysis process.
The system also deliberately avoids automatically following redirects during inspection.
That was an important design decision because a URL should be treated as something to investigate carefully rather than something to blindly trust.



🖼 Screenshot Analysis

Scams aren't always plain text.
People receive screenshots of fake bank pages, fake payment confirmations, fake job offers, impersonation messages, and other deceptive content.
ScamShield therefore supports screenshot analysis through a multimodal AI path.
The system asks the model to examine visible text, sender information, URLs, buttons, payment requests, and other warning signals without inventing information that cannot actually be read.



How the Current Architecture Works

The production web application currently follows this architecture:
User
↓
GitHub Pages
↓
Supabase Edge Function
↓
Groq / Qwen
↓
Structured Scam Report
The browser never receives the Groq API key.
Instead, the frontend sends the scan request to the Supabase Edge Function. The backend handles the AI request and returns a normalized result to the application.
This also gives the backend a place to perform things like:
  • CORS validation
  • Request rate limiting
  • Input validation
  • URL inspection
  • Screenshot validation
  • AI fallback handling
If the AI service isn't available, ScamShield also contains a transparent rule-based fallback that checks common scam patterns.
We liked having this fallback because the application can still explain why a message triggered a warning instead of simply failing.



Where AWS Comes In

For the AWS build, we didn't want to rewrite a working application just to attach an AWS service to it.
Instead, we added an agentic verification layer using the AWS Strands Agents SDK.
The AWS portion lives inside:
aws/strands-agent/
The architecture becomes:
ScamShield Scan
↓
Existing Scan Report
↓
Strands Agent
├── Validate Scan Report
├── Generate Safety Checklist
└── Investigation Brief
The important idea is that this is a second-pass investigation.
The first system produces the initial scam assessment.
The Strands agent then takes that structured report and asks:
Is the report internally consistent, what safety actions follow from the evidence, and what should a user investigate next?



Building Custom Agent Tools

One of the most interesting parts of this build was turning pieces of normal application logic into tools an agent could use.
The project currently includes custom tools for:

 validate_scan_report 

This checks whether the existing ScamShield report has the expected structure and whether important risk fields are consistent.
For example, it can verify that:
  • The risk score is valid
  • The risk level is valid
  • Required analysis fields exist
  • Evidence and recommendations have the expected structure



 generate_safety_checklist 

The second tool converts the analysis into concrete safety actions.
Instead of only returning technical information, the agent can produce a checklist around actions such as:
  • Don't click suspicious links
  • Don't share sensitive information
  • Verify through an official channel
  • Preserve relevant evidence
  • Report suspicious activity when appropriate
This keeps the focus on what a person can actually do with the result.



The Investigation Brief

After the tools run, the Strands agent produces a second-pass investigation brief.
The brief focuses on:
  • Risk
  • Evidence
  • Uncertainty
  • Safety actions
  • What should be investigated next
This creates an important separation:
Initial AI Analysis
↓
Validation
↓
Safety Checklist
↓
Second-Pass Investigation
Instead of treating one AI response as the final answer, the agent workflow adds another reasoning and verification stage.



Why We Chose This Approach

We could have moved the entire application to a new AWS architecture.
But that would have changed the scope of the project significantly.
Instead, we wanted to experiment with something we could actually understand and demonstrate:
How can an agent make an existing AI application more useful without rebuilding the entire application?
That led to the additive architecture.
The production ScamShield application remains unchanged, while the AWS Strands layer adds an agentic workflow around its structured output.
This also makes the architecture easier to experiment with because the agent isn't tightly coupled to the frontend.



Running the AWS Layer

The AWS layer can be run locally from the repository:
cd aws/strands-agent
npm install
npm run check
npm run demo
The project uses Node.js and the Strands Agents SDK, with an OpenAI-compatible model integration for the local agent workflow.
The repository also includes an example scan report so that the agent workflow can be reproduced without manually creating a new scan every time.



What We Learned

The biggest thing we learned from this project wasn't simply how to call an AI model.
It was how much more useful an AI system becomes when its output is structured and reusable.
Once a scam analysis is represented as structured information such as:
risk_score
risk_level
category
why
explanation
action_plan
confidence
that result can become input for another system.
That's what made the Strands integration possible.
The first AI system detects and explains.
The agent then validates, organizes, and investigates.
That separation makes the overall system easier to reason about.



Security Was Also Part of the Build

Because ScamShield deals with potentially sensitive messages and screenshots, we didn't want API credentials sitting in frontend JavaScript.
The Groq API key is kept server-side as a Supabase secret.
The repository also explicitly avoids putting secret keys into the frontend or GitHub.
The application includes authentication through Supabase Auth, and the analysis endpoint expects an authenticated user session.
These details might not be as flashy as the AI output, but they're an important part of building something that handles potentially sensitive user input.



What's Next?

There is still a lot we want to improve.
Some future directions include:
  • More sophisticated URL intelligence
  • Better scam-pattern detection
  • Stronger abuse and rate-limit controls
  • Persistent scan history
  • Better community reporting
  • More agent tools for evidence verification
  • Additional multimodal analysis
  • More AWS-native deployment experiments
We'd also like to explore how the Strands agent could evolve from a second-pass reviewer into a more capable investigation workflow while keeping the system transparent about uncertainty.



Final Thoughts

ScamShield started with a simple idea:
Give people a moment to pause before they click, pay, or reply.
Building it also gave us a chance to explore something we hadn't worked with before: agentic AI.
The AWS Strands layer showed us that an agent doesn't necessarily have to replace an existing application.
Sometimes the better approach is to give an existing system another layer of reasoning.
In ScamShield, that means:
Detect
↓
Explain
↓
Validate
↓
Investigate
↓
Act Safely
That's the direction we want to keep exploring — building AI systems that aren't just impressive when they work, but are also understandable and useful when people actually need them.
Repository:  sampreetialive/Opteryx 
Project: ScamShield
Built with: GitHub Pages, Supabase Edge Functions, Groq/Qwen, Supabase Auth, and AWS Strands Agents SDK.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article