10 Oct 2025
Safaricom AI Sim Swap Application
An overview of a simple SIM swap management application I built — handling user requests, validation, and database-driven SIM swap processing.
Building a Simple SIM Swap Management Application
SIM swap processes are a critical part of telecom operations — allowing users to replace lost or damaged SIM cards while retaining their phone numbers. Safaricom receives so many call requests for swaps which are both sensitive and important but form a bulk of the daily operations a Safaricom Agent will work on on a typical day making them very tiring. Botched or illegal swaps are entry points to so many things including scams, money laundering, and many other forms of crime. Agents working on them are susceptible to social engineering, and errors due to fatigue. My solution tries to offload the burden of the process to an automated means. Link: https://safaricom-ai-sim-swap.streamlit.app
To understand the end-to-end flow behind these systems, I built a simple SIM swap management application that:
- Collects user details through a form
- Validates identity information
- Checks and updates records in a database
- Processes SIM swaps in a controlled way
In this post, I’ll walk through what the app does, how it’s structured, and why even a basic system like this is important in telecom environments.
Table of Contents
- What is a SIM Swap?
- Project Goal
- Application Overview
- System Architecture
- Database Design
- SIM Swap Processing Flow
- Key Features
- Challenges Encountered
- Future Enhancements
- Final Thoughts
What is a SIM Swap?
A SIM swap allows a mobile network operator to:
- Transfer a phone number from an old SIM card to a new one
- Maintain the user’s account, balance, and services
Common reasons include:
- Lost or damaged SIM cards
- Phone upgrades
- Network issues
Behind the scenes, this involves identity verification, database updates, and system-level number reassignment.
Project Goal
The goal of this project was to build a basic but functional SIM swap system that simulates how telecom operators handle these requests.
Specifically, I wanted to:
- Understand user verification flows
- Practice backend data handling
- Work with relational databases
- Implement secure request processing
Application Overview
The app provides a simple user interface where customers enter:
- Full name
- National ID number
- Phone number
- New SIM number
Once submitted, the system:
- Validates the input
- Checks if the user exists in the database
- Confirms the SIM is eligible for swap
- Updates records to assign the number to the new SIM
Challenges Encountered
For this enhancement, the customer needs to have express mastery of the exact account details especially the balances like money wallet balances. Should they mention a deviant value even with an off by one value, the system will pick that as false or wrong. It is therefore not flexible at the moment but just serves as a launch pad to what can be achieved should bits of AI be added to manage such inconsistencies to better suit the reality of daily usage of phones and mobile wallets.
Sketchy customers would abuse the system by retrying so many times but this can easily be managed by adding retrial limits and cool off periods. Banning or suspending requests from specific endpoints or even regions can be added once the core functionalities have been proved to fully and effectively work.
Final Thoughts
I honestly dont want to spend my entire day doing 50 percent swaps. That can be avoided because its tedious and it gets boring. Why not offload that to such solutions? As a business leader, you would be avoiding the risks of social engineering and erros due to fatigue brought about by swaps being managed by humans. Moreover, time spent on calls is greatly reduced and that is offloaded to systems that only read user input and analyze using underlying AI for factuality and proximity to accuracy.