Inspiration

When someone receives a threatening or blackmailing message, the hardest part is often not knowing how serious it is, what to do next, or how to keep evidence. In Pakistan, stigma and fear of not being believed stop many people from asking for help. We wanted something that anyone could open in seconds, paste a message into, and get calm, clear guidance from.

What it does

Hifazat reads a message the user pastes in English, Urdu or Roman Urdu and:

  • classifies it (harassment, threat, blackmail or sextortion, stalking, scam, or safe)
  • rates its severity
  • explains the red flags in plain language
  • gives clear next steps, and never blames the user or tells them to pay or confront the sender
  • shows a warning banner if the model detects immediate danger
  • generates a downloadable evidence summary the user can keep

How we built it

  • Interface: Streamlit
  • Model: Groq API with openai/gpt-oss-120b, called from one isolated function that returns structured JSON
  • Report: a report builder that turns the JSON into a downloadable evidence summary
  • Hosting: Streamlit Community Cloud

The model call is kept in a single function, so it can be swapped for another provider such as Amazon Bedrock without touching the interface. This swap is planned. It is not implemented in this version.

Challenges

  • Getting reliable structured JSON output from the model, and finding a model that was available on our account
  • Handling Roman Urdu, which has no standard spelling
  • Keeping the tone supportive and non-judgmental while still being direct about danger
  • Being careful with privacy: we do not run user accounts or store pasted messages in the app

What we learned

Safety tools need careful wording more than they need features. We also learned to keep the model layer separate from the interface, which made fixing model errors quick.

What's next

  • Move the model layer to AWS (Bedrock), with encrypted evidence storage
  • Verified, regularly updated reporting contacts for Pakistani authorities
  • Full Urdu interface
  • Image protection against AI misuse (a separate research prototype, planned future work)

Limitations

Hifazat is an AI assistant, not a legal or emergency service. Its analysis can be wrong. If someone is in immediate danger, they should contact local emergency services.

Built With

Share this project:

Updates

Submission history