DEV Community

Muhammad Murtuza Hussain
Muhammad Murtuza Hussain Subscriber

Posted on Fully Autonomous

Not every ghost is here to scare you. Ward is the friendly one in your group chat

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

Thank you to the DEV team, and to everyone reading this. Thank you especially for keeping this challenge clean and open, because it meant we could go much more ambitious. So here is my project, and an approach to solving one of the problems in the world.

I almost built something else

I started this week with a couple of other ideas. I prototyped, built some of it, and it worked, but I wasn't satisfied. The theme was broad on purpose, and that gave me room to be more ambitious. I wanted to build something that could matter to someone who isn't me.

So I went looking for a problem instead of an idea. That's how I found World Solve: a site of real problems registered from around the world, open to anyone who wants to bring an approach, a framework or a first step towards solving one. One of them stopped me: WS05937, building effective interventions for cyberbullying harming children by 2030.

If you'd rather watch than read, here's the whole design-thinking journey in under three minutes, from that problem card to the first prototype and the bug that taught me the most:

Why cyberbullying, and why now

Everyone who grew up with social media can relate to this one. Social media and messaging gave us a lot: friends far away, work, community. It also came with a dark side, and while the algorithms got very good at keeping us scrolling, we've done far less to make these places safe for the kids in them.

Today the conversation about kids and social media is mostly about brain rot, screen time and attention spans. Those are real. But I want to be a little old-fashioned and talk about cyberbullying again, because it quietly dropped out of the conversation without going away.

I wanted to check that feeling against the data, and the data agrees it hasn't gone away:

  • 1 in 6 school-aged children in Europe and Canada were cyberbullied in WHO/Europe's latest study of 279,000 young people, up from 2018, while bullying at school stayed flat (WHO/Europe, 2024).
  • In 2025, a third of US teens said they'd been cyberbullied in the last 30 days alone (Cyberbullying Research Center, 2025).
  • Cyberbullying reports to Australia's eSafety Commissioner rose 455% in five years, and almost half were about children aged 13 or under (eSafety, 2025).
  • In Pakistan, Digital Rights Foundation's helpline saw cases involving minors rise 28% in 2025, and a third of all cases came from WhatsApp (The Friday Times, 2026).
  • And it's getting new weapons: 1 in 8 young people know someone targeted by deepfake nudes (Thorn, 2025).

Where governments act, it's mostly by taking the phone away. Australia banned social media for under-16s in December 2025; eight months later, eSafety's own survey found over 81% of under-16s still on at least one banned platform (Al Jazeera, 2026). Pakistan's Senate tried a similar ban and withdrew it as "nearly impossible to implement" (Digital Pakistan, 2025). Bans and parental controls are one answer. Neither teaches a 12 year old what to do the day it happens to them.

Step one: knowing what it is

Design thinking says you break a problem down before you build anything. For cyberbullying, the first step, before stopping it or reporting it, is understanding what it is and recognising it when it's happening to you.

I learned that one personally. I grew up in India, and English isn't my first language. For a long time I thought a "bully" was just someone who teased people and played pranks. Harmless. So once, chatting with a friend, I said something like, "Yeah, I used to be a bit of a bully in middle school." They stopped me and explained what the word actually means: someone whose "jokes" leave people with something that can last for years. I realised what I'd said, and that it wasn't funny at all.

If I didn't know what the word meant, a lot of kids don't either: not when they're on the receiving end, and not when they're the ones laughing along. Researchers find the same thing: children and teens have "a limited ability to apply" a definition of cyberbullying to real situations (Campbell and Xu, 2022). So Ward is built around one job first: helping a child see clearly what's happening in their chat, and name it.

The ghost on your side

This week's theme is Ghost in the Machine. Not every ghost is there to scare you. Think of Casper, the friendly ghost who just wanted to be a kid's friend.

In a group chat, the bully is the ghost haunting the machine. Ward is the ghost on your side: someone you can't see, who's there to help, to reassure, and to teach. A second pair of eyes.

That matters because kids mostly don't tell their parents what happens in their group chats. Parents can overreact. The phone can get taken away. Sometimes the child isn't sure it "counts". In one survey, 60% of 8 to 12 year olds said they'd never tell their parents, and losing the phone was one of the reasons they gave (Barnardos via RTÉ, 2022). I'm not trying to solve that with an app that reports to parents. The Ward app never reports anything to anyone. It's on the child's side, and it stays private.

And I didn't want an AI that plays counsellor and tells a child exactly how to fix their life. Ward's job is to say: you're not imagining this, here's what it's called, keep the proof, and here's who can help. Then it points to people: a trusted adult, a teacher, a helpline, the app's own report button. Ward drafts the message to the adult, but the child sends it, or doesn't.

What I Built

Ward is a small, friendly ghost that lives on a child's own phone or computer. It reads the chat they share with it, in the languages they actually type (English, Roman Urdu, Hinglish and Bangla), and tells them what's happening in words that fit their age.

For the child (Android, desktop, web; English and اردو):

  • Share to Ward. In WhatsApp, Export chat → Ward. Or paste messages.
  • The Haunting. The chat with the attacks lit up and everything ordinary folded away, and the pattern in plain words: the same person again and again, a pile-on, accounts added only to attack, being left out, messages after 11pm, and anything dangerous.
  • Coach. Don't reply, save it, block and report (with steps for each app), and a message to a trusted adult, drafted in a kid's voice. Ward never sends anything itself.
  • Get help now. Anything dangerous puts helplines first, plus Take It Down for images. If Ward isn't sure, it still shows the help, and every calm result has an "It still feels wrong" button.
  • It listens to the child too. If the child's own message says they want to die or hurt themselves, Ward leads with care and helplines, not a verdict. And a child who writes "he told me to …, what do I do?" isn't counted as the bully. (It still misreads a quote when the ask for help comes in a separate message; that's on the list.)
  • Evidence vault. Encrypted with a PIN, every message fingerprinted when it's saved.
  • The Resilience Path. Short daily lessons and 21 branching chat stories where you choose: laugh along, stay quiet, speak up, tell someone. Read aloud for the youngest.

For the adults a child chooses to tell: a guide for the parent ("don't take the phone away"), Class mode and a school kit for teachers, and a report a helpline can check, with an offline viewer.

In Discord, where a lot of teenagers actually are: right-click any message → Check with Ward, save it as evidence in your own DMs, and turn it into the same report. Only the teen sees Ward's answer, and Ward keeps nothing.

Right-click → Apps Only you see the answer
Right-click a Discord message, then Apps, then Check with Ward or Save as evidence Ward replies privately: this is unkind, what it is, and what you can do
Saved as evidence, with a fingerprint Help that's always one command away
A message saved as evidence in the DMs with Ward, with sender, time, link and a SHA-256 fingerprint /ward help lists free, confidential helplines for the country, plus Find A Helpline and Take It Down

And when Ward isn't sure, it says so instead of guessing:

Ward isn't sure about this one: only the small model noticed something, and you know how it was meant better than Ward does

Check The verdict, in Urdu The Resilience Path
Ward's Check screen A Ward result in Urdu The Resilience Path

Demo

Try it in your browser: try-ward.onrender.com (no sign-up). Tap one of the three sample chats on Check, or paste your own. The demo runs the word lists and Ward Lite inside your browser, so the chat you paste never leaves the page. If you want the close read, tap Read it with Gemma (demo): that one opt-in button sends the chat through Ward's demo relay to Gemma 4 on Google AI Studio, and says so on screen. The relay keeps no copy. It takes about a minute. On a computer, the desktop app runs Gemma locally through Ollama instead.

The demo is a single static page, and it scores 100 for performance, accessibility, best practices and SEO on Lighthouse, which matters for a site that has to work on a cheap phone on a slow connection.

PageSpeed Insights for try-ward.onrender.com: 100 performance, 100 accessibility, 100 best practices, 100 SEO

Android APK (Ward Lite runs on any phone) and desktop installers: https://github.com/MuhammadMurtuzaHussain/ward/releases/tag/v0.1.0 (a signed preview release).

One honest thing you'll see on the pile-on sample: Ward Lite reads Zara, who's defending her friend ("guys stop, ye theek nahi hai"), as dangerous too. I left it in. That's exactly the kind of mistake the next version needs to fix.

Code

GitHub logo MuhammadMurtuzaHussain / ward

A guardian on a child's own device: spots cyberbullying in English, Roman Urdu, Hinglish and Bangla with open-weight Gemma, keeps the evidence, and trains them to bounce back. Nothing leaves the device.

Ward, a small friendly ghost

Ward

A guardian that lives on a child's own device. It spots cyberbullying in English, Roman Urdu,
Hinglish and Bangla, keeps the evidence, coaches the next step, and trains kids to bounce back.
Open-weight Gemma, running locally. No server and no account: a child's messages never go to us or to any AI company.

Try Ward in your browser

The demo runs entirely in your browser: Ward Lite and the word lists load from the page, and the chat you paste is never sent anywhere.

Download for Android Desktop installers

v0.1.0 is a preview. Read the safeguarding policy below before giving it to a child.

Checking an example group chat: pick who you are, and Ward says this is serious, then lists what it noticed   Picking a night light: Lantern, Moonlit, Firefly, Ember, Aurora   A branching story: a group chat about Saturday bowling where one classmate is left out

Check a chat · Pick your night light · Live a story. Recorded from the browser demo.

The bully is the ghost haunting the chat. Ward is the ghost on your side.

Before you put Ward in front of a child, read the draft safeguarding policy: what Ward will never do, what hasn't…

How I Built It

Can open models read the chats kids actually send?

That was the first thing I measured. Children in Pakistan, India and Bangladesh text in Roman Urdu, Hinglish and Bangla, mixed with English and emoji. An English-first safety model goes almost blind: on a balanced sample, ShieldGemma 2B caught 14% of Roman Urdu abuse. Gemma 4 E4B, on a computer, caught 88%.

Caught (precision) Word lists ShieldGemma 2B Phone: lists + Ward Lite Computer: Gemma 4 E4B
Roman Urdu 59% (94%) 14% (70%) 83% (86%)† 88% (84%)
Bangla 10% (83%) 14% (93%) 46% (79%) 67% (77%)
English 10% (91%) 19% (73%) 85% (67%)† 36% (65%)

† Ward Lite trained on the train splits of these two datasets, so those cells are in-distribution. Bangla is the fair comparison, and there Gemma 4 on a computer still leads. With 100 abusive messages per language, read small gaps as ties.

Scoring the whole chat, not one message

A single-message score isn't what a child sees. So I wrote 128 labelled chats in four languages (friendly banter, pile-ons, exclusion, lone threats in a DM) and scored the verdict Ward actually shows: calm, watch, bullying or urgent.

Word lists Phone Computer (Gemma 4)
Right level 38% 39% 72%
Missed an urgent chat (of 28) 23 14 3
Called a calm chat urgent (of 100) 5 21 11

That's the clearest case for open weights I found all week: with Gemma reading the whole conversation, Ward misses 3 dangerous chats in 28, not 14. It's also the clearest to-do: the phone needs to read context too.

Gemma as the teacher, Ward Lite as the student

Gemma 4 E4B is too big for a cheap phone, and the phone-sized E2B caught only about a third when asked to judge. So Gemma 4 became a teacher: it wrote and labelled thousands of synthetic, kid-style chats (never a real child's messages), and I distilled that plus public datasets into Ward Lite, a 38 MB multilingual classifier that reads a message in about 8 ms, offline. It has raise-only authority: it can catch what the word lists miss, but it can never talk Ward out of a warning.

The bug that taught me the most

Building the Discord bot, I typed "see you tomorrow" and Ward Lite called it dangerous, at 0.99. Its synthetic threats leaned on "tomorrow", "later" and "after school", so it had learned the words, not the threat. I fixed it with data, not by tuning against the test: friendly look-alikes, threats without those words, and a held-out set of 329 everyday messages. Everyday false alarms fell from 25% to 5%, and "urgent" false alarms from 16% to 2%.

Bullying is a pattern, not a message

One mean message is rude. Bullying is the same person again and again, five people in an hour, or accounts that join a group only to attack. Ward's engine looks across the whole chat for that, and anything dangerous makes it urgent whatever else is going on.

What Ward isn't, yet

I'd rather say this myself than have you find it:

  • No child-protection professional has reviewed it yet, and that comes before any pilot.
  • On a phone, without Gemma, half the dangerous chats in my benchmark never reach "urgent". It's also weakest on Bangla, sarcasm, and friends defending each other. Every failure is published in the red-team report.
  • The Roman Urdu, Hinglish and Bangla phrases and labels were written by one person and still need native speakers to review them.
  • It measures whether Ward reads abuse, not whether children are better off. That needs a school pilot, and the plan is in the roadmap.

Why Does Open Innovation Matter?

  • Privacy is the product. A child's chats can't go to a vendor's API. Open weights on the device are the only way to read them with a real language model and keep that promise.
  • It works with the lights off. No account, no subscription, no data plan after install.
  • Open models could learn our languages. I couldn't fine-tune a closed safety API on Roman Urdu. With open weights, Gemma 4 became the teacher and Ward Lite the student.
  • Communities own the words. Slang lists are plain JSON a language community can review and grow.
  • It can't disappear. MIT licensed, self-hostable down to the Discord bot.

My Agent Session

I built Ward with Claude Code over four days, from the problem card to the films. Here's the curated thread: my prompts as I typed them, and what came out of each. The sessions behind it are also checkpointed on Entire.

Building Ward with Claude Code: from a World Solve problem card to a friendly ghost in the group chat
You

I tried it. Is that all? Is that what the game has to offer?

Agent

Honestly, not much yet. Phantom Archive, a noir ghost-detective game, had a beautiful filmed intro and a thin game behind it. That night (29 Oct) the week's entry changed.

You

WS05937 | World Solve. See this problem: building effective interventions for cyberbullying harming children by 2030. Any way we could improvise to solve it?

Agent

Proposed Ward: a guardian that lives on the child's own phone, reads the chats they actually send (Roman Urdu, Hinglish, Bangla, English) with open-weight Gemma, keeps the proof, and never reports the child to anyone. The first measurement set the direction: an English-first safety model barely reads Roman Urdu.

You

Let's build Ward. Don't worry about the time, we'll make a great app that actually solves the problem, with a Duolingo kind of feature that helps them be more cyber resilient. The UI should be different for different genders, and let's have a good desktop app and an optimised phone app, even an APK when the build is final.

Agent

Built the engine and the app the same night: chat parser, slang packs, a pattern engine and Gemma judges; onboarding, Check, the Haunting timeline, Coach, an encrypted vault and the Resilience Path. Instead of a gender question, a gallery of looks the child picks from, with the age band setting the tone. Night-light mood, and a friendly ghost on your side.

You

Look, we can't just build a world problem in one prompt and claim that we solved it. I think we have an MVP and an approach. Read the problem again and think about how this could be tackled at a much larger scale.

Agent

Reframed Ward as an MVP plus an approach, and built the pieces that bridge to real people: Share to Ward straight from WhatsApp, a trusted-adult guide and a teacher class mode, a report a helpline can check, and a roadmap with a measurement plan.

You

Start Phase 2: shared-phone profiles with quick exit, read-aloud with ElevenLabs narration in English and Urdu, and the Urdu UI. ... I think I may not have credits on ElevenLabs at the moment, let's take a different approach and move on.

Agent

Shared-phone profiles with a quick exit, the full Urdu UI with right-to-left layout, and 107 English narration clips bundled so read-aloud works offline. Urdu narration waits for credits.

You

Next phases, one at a time: caseworker viewer, branching stories, school kit, counsellor mode.

Agent

An offline case viewer that can't make a network request, 21 branching chat stories where the child chooses, a printable school kit, and a counsellor mode for the adult a child chooses to tell.

You

A lot of teenagers use Discord. Can we have the bot deployed to Discord? Keep it open source and relevant to the challenge.

Agent

Ward for Discord: right-click any message, then Apps, then Check with Ward or Save as evidence. Only the teen sees the answer, and Ward keeps nothing.

You

False alarms: how do we solve this? I suppose it depends on context. I tried the Discord app, it works great, but after a few messages it stopped working.

Agent

Typing 'see you tomorrow' made Ward Lite say dangerous at 0.99: its synthetic threats leaned on 'tomorrow' and 'after school', so it learned the words, not the threat. Fixed with data, not by tuning against the test.

You

Run an audit of the project and tell me how to make this amazing. Don't be limited by the submission window.

Agent

An 18-finding audit, harm to children first. Parallel sessions then fixed the worst: an unsure danger still shows help, Ward notices the child's own distress, a child quoting abuse to ask for help isn't counted as the bully, helplines never guess a country, Ward Lite ships in every build, a lite APK installs on any phone, long chats save to the vault.

You

Now let's loop back to the partner technology we planned. Where is the project deployed?

Agent

Render: the web demo as a static site with strict security headers, and a web service running the Discord bot. DigitalOcean was dropped: the account's tier blocked both GPU and 16 GB droplets.

You

There should be a real demo that uses Gemma. Can we use DigitalOcean or Google AI Studio for it?

Agent

An opt-in 'Read it with Gemma (demo)' button: the one place a chat leaves the browser, and it says so. It goes through a locked-down relay on the bot service (origin allow-list, no chat logging) to Gemma 4 on Google AI Studio, with one retry on server errors.

You

Let's do that. I want to explore more technologies, therefore we are being ambitious.

Agent

Eval history on Tiger Data: every benchmark run Ward ever committed, backfilled into a Timescale table, and CI fails any push that makes a language's score worse. Plus pnpm helpcheck: SerpApi finds each app's help page, Browserbase loads it, and Ward's block and report steps are checked against it.

You

I think I feel confident to close the Ward project. Tell me the state: is anything broken? Then a video about the problem and how we approach it.

Agent

Main clean, tests passing, CI green, the demo live, and v0.1.0 out with both APKs and the desktop installers. Then the film: three wildly different drafts built in parallel (a HyperFrames cinematic, a Remotion pixel RPG, a three.js clay diorama). The diorama won, narrated by Kokoro-82M, an open-weight voice model running locally.

You

Build the design-thinking film in the illustrated explainer style. Keep it high quality and not AI slop.

Agent

'Designing Ward': a 2:48 design journal on a desk at night. Empathise, define, ideate, prototype and test as tabs, drawn on by pen, stamped and taped, with the real screens taped in.

You

There are some audio issues right away, look into it.

Agent

The sound effects were normalised to full scale on their own, then mixed in almost as loud as the voice. Rebuilt the pen scratch as a soft stroke and set every effect well under the narration in both films.

You

Here are screenshots, in no particular order.

Agent

One showed a real bug: three old local copies of the bot, started during testing, were still running beside the deployed one, and two predated the safeguarding fixes. They were stopped; only the deployed bot answers now.

You

So far this was my solution for the week, and it doesn't stop here. On to the next phase, iterating on the project and seeing how far I can go as a problem solver.

Agent

Where Ward stands: 145 commits from 29 Oct to 1 Nov, MIT, an app for Android, desktop and the web, a Discord bot, a live demo, two films, and an honest list of what it isn't yet.

The Spirit of It

The moment this landed for me was a test in Discord. A friend agreed to play the bully and sent "Haider is very stupid". I right-clicked it, and Ward saved it as evidence in my own DMs: who sent it, when, where, and a SHA-256 fingerprint of the message. When I checked an insult, only I could see the answer: This is unkind. What it is: insults. Keep proof first. No adult was alerted and nothing was kept. It was what my friend did for me years ago, when they stopped me and told me what "bully" really means: someone on my side, telling me plainly what it was.

Prize Categories

  • Best Use of Gemma: Gemma 4 E4B reads whole chats with context on computers (Ollama, or built into the desktop app), and powers the web demo's opt-in close read. Gemma 4 E2B runs on Android through LiteRT-LM. Gemma 4 wrote and labelled the synthetic chats that taught Ward Lite, and ShieldGemma is the baseline on the scorecard. The live demo's close read runs Gemma 4 31B and 26B through Google AI Studio:

Google AI Studio usage for the Ward project: requests and tokens for Gemma 4 26B and Gemma 4 31B

  • Best Use of Render: the web demo is a Render static site with strict security headers (try-ward.onrender.com), and a Render web service runs the Discord bot plus a locked-down Gemma relay (origin allow-list, no logging of chats) for the demo.

Ward on Render: try-ward and ward static sites and the ward-discord web service, all deployed
try-ward's six response headers on Render, including a strict Content-Security-Policy

  • Best Use of Tiger Data: every benchmark run Ward has ever committed (scorecard, red-team, chats, everyday false alarms) is backfilled into a Timescale table on Tiger Cloud, 897 data points across 16 runs. CI records each new run and fails a push that makes any language's score worse. It already caught 11 Gemma regressions I'd have missed (eval history). Only scores go there, never test sentences or chats. Here's the latest F1 for every system, straight from Tiger with TimescaleDB's last():

A query in Tiger Cloud's SQL editor returning each system's latest F1 in Roman Urdu, Bangla and English

  • Best Use of SerpApi and Best Use of Browserbase: the Coach tells a child exactly which buttons to press to block and report on Instagram, TikTok, Snapchat, WhatsApp and Discord. Apps move those buttons. pnpm helpcheck uses SerpApi to find each app's official help page and Browserbase to load it, then checks Ward's steps against the page. Its first run found 5 stale steps, which I fixed in English and Urdu.

SerpApi search log: site-restricted searches for block, report and save-chat help pages on Discord, Snapchat, TikTok, Instagram and WhatsApp
A Browserbase session replay loading Discord's help page during the help-page check

  • Best Use of GitHub Copilot (GitHub Actions): Ward is automated end to end with five workflows. CI runs every test and the Tiger regression check on each push; the Android workflow builds both APKs and boots an emulator that receives a real WhatsApp share; the desktop workflow builds installers for macOS, Windows and Linux; the release workflow turns a v* tag into a release with signed APKs, installers and a checksum file; and the Pages workflow redeploys the GitHub Pages copy of the demo.
  • Best Use of ElevenLabs: 107 English narration clips bundled in the app, so read-aloud works offline for the youngest children.
  • Best Use of Entire: the 14 agent sessions that built Ward, from the first idea to the release, are checkpointed with Entire on the public repo (browse the sessions): 334 checkpoints, so anyone can see how each change was reasoned about, not just the diff. Session copies were redacted before import, so no keys or signed links went public.

Ward's agent sessions on Entire, each with its model and checkpoint count

What's next

So far, this was my solution for the week, and it doesn't stop here. On to the next phase: iterating on the project and seeing how far I can go as a problem solver.

I thank you all again for this challenge. It gave me the curiosity, and the honour, of being a contributor towards this project.


The films: narration by Kokoro-82M (open-weight, Apache-2.0) running on my laptop; music "Touching Moments Two - Higher" and "Eternal Hope" by Kevin MacLeod (incompetech.com), CC BY 4.0; 3D scenes in three.js and an illustrated journal in HyperFrames, with Ward's real screens.

On AI in this post: I built Ward with Claude Code and shaped this post with it from my own recorded notes, and checked every number against the repo. Ward's training data is synthetic (written by Gemma 4) plus public datasets; no real child's messages were used anywhere.

Top comments (0)