Next-Generation AI Security & Intelligence Infrastructure for African Finance.
"Security that disappears when you're safe. Shows up hard when you're not."
Problem โข Solution โข Agents โข Architecture โข Setup โข Demo Guide โข API Docs
Every bank's fraud system kicks in after the user hits send. By then, the scammer has already won.
In the modern digital banking eraโparticularly across emerging African markets like Nigeriaโscams no longer happen inside the banking apps themselves. The technological perimeters (2FA, biometric logins, hardware tokens) are generally secure against brute force. Instead, the human is the vulnerability.
Scams happen on WhatsApp, phone calls, and cloned websites in the five minutes before the transaction. They manifest as:
- Social Engineering & Impersonation: Scammers posing as family members in distress.
- Deepfake Voice Clones: AI-generated audio bypassing the "I know their voice" heuristic.
- Urgency Scripts: Crafted messages in local dialects (like Nigerian Pidgin) designed to trigger panic and bypass rational thought.
- Business Email Compromise (BEC): Fake supplier invoices routing funds to mule accounts.
Because the user themselves is convinced to authorize the transfer, traditional rule-based fraud systems (which only look for credential stuffing or geographic anomalies) fail. They see a legitimate user, on a legitimate device, entering a legitimate OTP.
To the bank, it looks like a perfect transaction. To the user, it is a catastrophic loss.
Fable is an API-first AI security and intelligence infrastructure layer that sits dynamically between the user and the transaction.
Rather than looking solely at the technical payload, Fable looks at the context. While existing platforms focus on Identity Intelligence (answering "Is this person who they say they are?"), Fable focuses on Behavioral Intelligence (answering "Is this person acting under manipulation or duress?").
It knows each user's genuine behavioral habits so deeply that safe transfers go through with zero friction, while anomalous, suspicious transfers get caught before money leaves the account.
- Behavioral over Identity: We assume the user is logged in perfectly. We secure their intent, not just their credentials.
- Security Without Friction: Safe users get fewer prompts than today, not more.
- Context, Not Just Payload: It reads the "room" (device velocity, recipient age, narration semantics).
- Transparency by Design: Every intervention is explained in plain English. No black-box rejections.
- Containment over Cancellation: When users override warnings, Fable contains the blast radius rather than failing open.
Fable doesn't use a monolithic risk engine. It relies on a multi-agent system executing in under 200ms before the transaction clears the central switch (e.g., NIBSS).
| The Personalization Engine | The Threat Defense | The Containment Layer |
|
Always On, Passive. Analyzes historical transactions, trusted channels, and payment hours. Builds a unique mathematical baseline for every user. If a transaction matches the baseline, it is approved silently. Zero friction. Example: Ada paying her landlord on the 1st of the month. |
Real-Time Interception. Catches social engineering, deepfakes, and channel anomalies. Evaluates payload semantics (e.g., "urgent help abeg" in Pidgin). When it blocks a transaction, GPT-4o generates a plain-English explanation without blaming the user. |
Blast-Radius Containment. If a user overrides a Shield block, Ghost holds the funds in an isolated Smart Container for a 15-minute cooling window. The scammer gets nothing. Once the adrenaline wears off, the user can cancel safely. |
When a transaction is analyzed, Shield computes a risk score (0.0 to 1.0) using multiple concurrent signal layers:
- Transaction Anomalies: Is this amount 10x higher than their 90-day average?
- Identity Signals: Is the recipient a newly created account?
- Social Engineering Context: Does the narration match our JSON-backed Nigerian Scam Pattern library?
- Network Intelligence: Has this recipient been flagged across the Fable network?
- Channel Weights: Was this initiated via a high-risk channel like USSD?
Fable is structured as a powerful monorepo containing a high-performance Python AI backend and a Next.js full-stack frontend.
fable/
โโโ api/ # ๐ง FastAPI Python Backend (Intelligence Layer)
โ โโโ agents/ # Core Agent Logic
โ โ โโโ copilot/ # Baseline profiling
โ โ โโโ ghost/ # Account containment holds
โ โ โโโ shield/ # Real-time risk scoring
โ โ โโโ watch/ # Passive continuous monitoring
โ โโโ intelligence/ # Fraud graphs and scam pattern JSONs
โ โโโ middleware/ # Rate limiting, auth, latency tracking
โ โโโ main.py # Uvicorn entry point
โ โโโ db.py # SQLite database connector
โ โโโ requirements.txt # Python dependencies
โ
โโโ prisma/ # ๐๏ธ Database ORM Layer (Next.js)
โ โโโ schema.prisma # Data models (Institution, User, Transaction)
โ โโโ seed.ts # DB seeding scripts
โ
โโโ src/ # ๐ป Next.js 16 Frontend (Platform)
โ โโโ app/
โ โ โโโ (marketing)/ # Public landing site
โ โ โโโ dashboard/ # B2B Institution console
โ โ โโโ demo/ # Mobile-first banking app simulation
โ โโโ components/ # Reusable UI (Tailwind, Framer Motion)
โ โโโ lib/ # Fable client SDKs and utils
โ โโโ globals.css # Global styling
โ
โโโ public/ # Static assets & Brand Logos
- Backend API: Python 3.12, FastAPI, SQLite
- AI Integration: OpenAI GPT-4o (Explainability), Scikit-learn (Isolation Forests), Gemini Vision (Document Analysis)
- Frontend App: Next.js 16 (App Router), React 19, TailwindCSS v4
- UI Components: Phosphor Icons, Radix UI primitives, Framer Motion, Sonner
- Database (Frontend): Prisma ORM with
better-sqlite3native bindings
Spin up the entire Fable ecosystem locally with just a few commands. The system is designed to run locally with minimal friction for development and testing.
- Node.js 20+
- Python 3.12+
pnpmornpm- An OpenAI API Key (Required for Shield explanations)
The backend runs on port 8010 and handles all AI logic.
# Navigate to the API directory
cd api
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Setup Environment Variables
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY
# Run the server
uvicorn main:app --port 8010 --reload๐ Interactive API Documentation is automatically generated and available at: http://localhost:8010/docs
The Next.js frontend runs on port 3000 and hosts the Demo Bank and Dashboard.
# In a new terminal window at the repository root
npm install
# Initialize the Prisma SQLite database
npm run db:setup
# Setup Environment Variables
cp .env.local.example .env.local
# Edit .env.local if you changed the backend port, default is http://localhost:8010
# Start the development server
npm run dev๐ The Platform is now available at: http://localhost:3000
Want to see Fable in action? We built a simulated mobile-first banking app right into the platform. Open http://localhost:3000/demo and follow these precise cheat codes:
Testing Fable Copilot's ability to remove friction for genuine transactions.
- On the demo app home screen, tap Transfer.
- Select Recipient: Choose a known contact like
Mum,Landlord, orChioma. - Amount: Keep it typical (e.g.,
โฆ10,000). - Narration:
food money - Tap:
Analyze & Send - Result: Copilot clears it silently. You will see an instant green flash. The risk score is extremely low (e.g.,
0.04). Security disappears when you're safe.
Testing Fable Shield's ability to intercept social engineering in real-time.
- Go back and initiate a new Transfer.
- Select Recipient: Choose
Unknown Contact. - Amount: Make it anomalous (e.g.,
โฆ500,000). - Narration: Enter the exact phrase:
urgent help abeg(This triggers the Pidgin scam pattern detection). - Channel: Change to
USSD. - Tap:
Analyze & Send - Result: Shield intercepts the transaction instantly. The risk score spikes to
0.94. An interactive UI appears explaining exactly why it was blocked using GPT-4o (amount anomaly, new recipient, urgency keyword detected).
Testing Fable Ghost's containment layer when users ignore warnings.
- On the blocked screen from Scenario 2, locate the secondary button.
- Tap:
Send Anyway โ Ghost Protection - Result: The funds are not sent to the scammer. Instead, they are routed to an isolated
GhostContainerin the database. A 15-minute real-time countdown begins. - During this window, you can safely tap Cancel & Get Money Back.
Fable is built API-first. Institutions integrate Fable by calling our REST endpoints before allowing a transaction to process.
The core interception endpoint. Evaluates a transaction payload and returns an action.
Request Payload:
{
"user_id": "usr_12345",
"transaction": {
"amount": 500000,
"currency": "NGN",
"recipient_account": "0123456789",
"recipient_bank": "Zenith",
"narration": "urgent help abeg",
"channel": "mobile_app"
},
"device": {
"fingerprint": "fp_abc123"
}
}Response Payload:
{
"risk_score": 0.94,
"risk_level": "HIGH",
"action": "BLOCK",
"signals": [
"amount_anomaly: 8x above user baseline",
"new_recipient: first transaction to this account",
"scam_pattern: urgency keyword detected"
],
"explanation": "This transfer was flagged because the amount is 8 times larger than your usual transfers, the recipient is someone you have never paid before, and the note matches patterns common in Nigerian social engineering scams.",
"agent": "fable-shield-v1"
}POST /v1/ghost/create- Initializes a ghost container for a blocked transaction.POST /v1/ghost/{id}/cancel- Refunds the held money back to the user.POST /v1/ghost/{id}/confirm- Releases the held money to the recipient.GET /v1/copilot/transparency/{user_id}- Returns everything Fable knows about the user's baseline.
The Next.js application uses Prisma to model the institution data, customers, and transactions.
model Transaction {
id String @id @default(cuid())
amount Float
currency String @default("NGN")
direction String @default("debit")
channel String @default("app")
narration String @default("")
customerName String
recipientName String
recipientBank String
recipientAccount String
status String @default("completed") // completed | blocked | cancelled | held | released
live Boolean @default(false)
createdAt DateTime @default(now())
institution Institution @relation(fields: [institutionId], references: [id])
institutionId String
user User? @relation(fields: [userId], references: [id])
userId String?
evaluation RiskEvaluation?
ghost GhostContainer?
}Every transaction is inherently tied to a RiskEvaluation (if analyzed by Shield) and optionally a GhostContainer (if overridden).
We welcome contributions to Fable! If you're interested in improving the African Fintech Security landscape:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/new-scam-pattern. - Add tests for your logic (especially for API agents).
- Ensure the Next.js build passes:
npm run build. - Submit a Pull Request.
Fable was designed, architected, and built from scratch during an intense 7-day sprint for the ECX HackX 6.0 Hackathon.
Team Fable:
Kenzy (Lead Engineer) โข Natty / Conqueror909 (Backend Engineer) โข Blessing / Katalysttt (Frontend Engineer & Product)
Trust by receipts, not promises.