Software engineer · Blockchain · AI systems · Security

Mohamed Sarhan

I build AI, blockchain and backend software, and write about how to architect it.

Software engineer working in Python, C and TypeScript. Author of the book Clean Layer Architecture, creator of open-source LLM tooling, and credited by the ProFTPD maintainers for two upstream fixes.

Featured · Book · Under review

Clean Layer Architecture

A Modular Approach to Artificial Intelligence Systems

A 13-chapter book (2026) that argues AI systems need the same structural shift software went through from monoliths to services. It splits a system into separate layers: language, knowledge, safety, policy and orchestration, with safety that fails closed by design.

Status: under review at Mansoura University, Egypt. It is not published yet. The reference implementation is open source as CLA-Library.

Table of contents
  1. The Monolith Problem: Why AI Systems Need Architecture
  2. Principles of Clean Layer Architecture
  3. The Core Language Layer
  4. The Knowledge Layers: Reasoning, Retrieval, Confidence
  5. The Safety Layer: Fail-Closed by Design
  6. The Policy Layer: Compliance and Ethics as Code
  7. The Maestro Layer: Orchestration and Arbitration
  8. Fractal Architecture and Micro-Routing
  9. Supporting Layers: Memory, Persona, Context
  10. Engineering a CLA System: Reference Implementation
  11. Testing, Validation and Red-Teaming
  12. CLA at Scale: Production Operations
  13. The Future of Layered AI

Projects

Selected work

Open-source code on GitHub, grouped by area. Each card links to its repository.

AI and LLM internals

Marge-LLM

Merges AI models with 9 mathematical merge methods. Picks a strategy automatically, compares the source models, verifies the result and lets you chat with the merged model.

PythonLLMs

NeuroScalpel

Real-time, precise edits to LLM weights. Targets hallucinations, limits forgetting with LyapLock, and supports orthogonal abliteration.

PythonLLM internals

LLM-Abliteration-Suite

Toolkit for changing LLM behavior by editing internal weights.

PythonLLM internals

sira

Self-Improving Research Agent in pure Python, described in the SIRA paper: a verifier-grounded platform for autonomous AI self-learning.

PythonAgents

Doctor-LLm

AI model diagnostics, repair and monitoring system.

PythonLLM ops

CLA-Library

Full Python implementation of Clean Layer Architecture. Modular, with no hardcoded responses: all output comes from the model backend you plug in.

PythonArchitecture

Blockchain and crypto

RBF

RBF and mempool ancestry visualizer for Bitcoin Testnet. Shows parent and child transactions, replace-by-fee replacement and double-spend dynamics, with logs that explain each step.

PythonBitcoinFlask

RBF-GUI

Python scripts and a desktop GUI that build a parent transaction with RBF enabled, a dependent child, and a replacement that invalidates the chain.

PythonBitcoinRPC

RBF-Files

RBF monitoring and cancellation system. Watches mempool fee rates, builds replacement transactions and stops when they confirm.

PythonBitcoinMempool

CRYPTOA

Autonomous, AI-powered crypto trading platform with a desktop GUI. Integrates real-time market data and automated strategies.

PythonCryptoDesktop

Software engineering

movexBackend

Enterprise-scale backend engine for multi-vertical on-demand super apps, unifying several service types in one platform.

TypeScriptBackend

airport

Production-grade GraphQL API for an airport management system.

NestJSTypeORMBullMQGraphQL

GhostMeet.AI

AI meeting assistant that records, transcribes and summarizes conversations into notes and tasks.

TypeScriptAI

indrive-lite

Ride-sharing app where passengers set prices and drivers bid, with an admin panel.

ReactViteNode.js

Security tooling

VulnIntel

Autonomous vulnerability research platform. Watches vulnerability feeds, collects exploit intelligence, drafts proof-of-concept code and builds detection rules.

PythonSecurity

chimera-hanybot

Docker-ready network honeypot and active-defense system. Detects intruders, monitors them, sets traps and scans back.

PythonDockerNetwork security
Private

kaevex

The firewall of the future. Details are not public yet.

Security research

Vulnerabilities reported to ProFTPD

ProFTPD is a widely deployed open-source FTP server. Both items below are public and credit me by name in the maintainers' own words.

Authentication bypass · Nov 21, 2026

Authentication could succeed when a backend module hit an error

Some authentication modules return a positive error value on failure, and the core Auth API read any positive value as success. Under specific error conditions in mod_sql, mod_ldap and mod_auth_pam this let a login through. The fix hardens the Auth API and audits the modules.

ProFTPDCAuth APIIssue #2497 →
mod_copy · Nov 30, 2026

Recursive copy did not check every path against <Limit> policies

I pointed out additional edge cases where mod_copy could miss access policies on source and destination paths. The upstream fix checks each path and adds 553 lines of tests.

ProFTPDCmod_copyCommit aab3f55 →

Recognition

Certificates

Both certificates relate to the ProFTPD reports above. Click a certificate to open its proof on GitHub.

Certificate of Appreciation for the ProFTPD authentication bypass report, issue 2497
Certificate of Appreciation: ProFTPD authentication bypass. View issue #2497 →
Certificate of Recognition for the ProFTPD mod_copy contribution, commit aab3f55
Certificate of Recognition: ProFTPD mod_copy. View commit aab3f55 →

Certificates and training

Microsoft Learn achievements

Completed learning paths, each verifiable on my Microsoft Learn profile.

Microsoft Learn certificate: Secure Azure AI services, March 3, 2024
Secure Azure AI services, March 2024. View achievement →
Microsoft Learn certificate: Prepare to develop AI solutions on Azure, March 3, 2024
Prepare to develop AI solutions on Azure, March 2024. View achievement →
Microsoft Learn certificate: Introduction to DevOps, March 3, 2024
Introduction to DevOps, March 2024. View achievement →
Microsoft Learn certificate: Learn continuous integration with GitHub Actions, March 3, 2024
Learn continuous integration with GitHub Actions, March 2024. View achievement →

Training: Edraak, February 2024. Introduction to Cyber Security, Cyber Security Attack Techniques, Introduction to Python Programming, Java Programming 3, Building Website Using WordPress.

About

Software engineer from Egypt

I write software in Python, C and TypeScript. My work spans AI systems, blockchain and crypto tooling, backend engineering and security. I read source code closely, which is how I found the ProFTPD issues, and I build the tools I need.

I also write about architecture: my book Clean Layer Architecture lays out a layered design for AI systems, and my SIRA paper studies verifier-grounded self-improving agents.

Languages
Python, C, TypeScript, JavaScript
Focus
AI and LLM internals, blockchain, backend, security
Web
React, Next.js, NestJS, Tailwind CSS
Tools
Docker, Git, Linux
Spoken
Arabic, English, German

Contact

Open to work and collaboration

Email is the fastest way to reach me.