Abir Market Sentinel is an AI-first insider trading detection engine that combines behavioral anomaly detection, intent analysis, and cross-source correlation, then secures flagged evidence with quantum-ready controls.
v1.0.1 โ Phase 1-3 hardened ยท 29 tests passing ยท 0.102s full pipeline ยท 7/7 pentest PASS
- What's New in v1.0.1
- At a Glance
- Verified Status
- Benchmark and Security Validation (May 2026)
- Latest Improvements (May 2026)
- System Flow
- Installation and Setup
- Run and Test
- Project Structure
- Roadmap Snapshot
- Governance and Security Docs
- Detailed Product Narrative (Original)
| # | Change | Category |
|---|---|---|
| 1 | Symbol-aware trade-to-news correlation โ MSFT news no longer matches AAPL trades | Bug Fix |
| 2 | Unique trade IDs using timestamp + sequence counter (no more ID collisions) | Bug Fix |
| 3 | Optional FinBERT intent engine with safe heuristic fallback | Enhancement |
| 4 | Untrained-model guardrail in API /detect endpoint (returns HTTP 400, not crash) |
Enhancement |
| 5 | Optimized correlation loop: precomputed timestamps reduce latency from 0.121s โ 0.091s | Performance |
| 6 | Tamper-evident audit chain indexing corrected โ deterministic verify across all chain sizes | Bug Fix |
| 7 | hmac import added to differential_privacy.py โ constant_time_compare now functional |
Bug Fix |
| 8 | Full timezone-aware UTC migration โ zero Python 3.14 deprecation warnings | Maintenance |
| 9 | Isolation Forest fallback (_FallbackIsolationModel) when scikit-learn absent |
Resilience |
| 10 | In-memory vault fallback (_FallbackVault) when abir-guard absent for dev/CI use |
Resilience |
Full benchmark (0.102s total, 241 trades) and penetration validation (7/7 PASS) documented below.
| Area | Current Status |
|---|---|
| Version | v1.0.1 โ Phase 1-3 hardened, benchmarked, pentest-validated |
| Detection Core | Behavioral anomaly detection (Isolation Forest) + intent analysis + symbol-aware correlation |
| Security | Tamper-evident audit chain, canary trades, key rotation, differential privacy, FIPS mode |
| Quantum Posture | Abir-Guard integration path with ML-KEM-1024 and hybrid KEM; fallback vault for dev/CI |
| API | Flask real-time endpoints โ /api/detect, /api/train, /api/health with guardrails |
| Runtime Resilience | Optional dependency fallbacks (sklearn, abir-guard) โ zero hard crashes in CI |
| Performance | 241-trade pipeline in 0.102s; correlation optimized to 0.091s |
| Test Health | 29 passed, zero warnings, Python 3.14.4 |
| Phases | Phase 1-3 + stabilization complete, Phase 4-5 planned |
This repository was validated locally on May 12, 2026 (v1.0.1):
- Test command:
/usr/bin/python3 -m pytest -q - Result:
29 passed, zero warnings - Python: 3.14.4 (system)
- Notes: All timezone-aware UTC, optional-dependency fallbacks active, Phase 1-3 fully functional.
Measured on the local development environment using the end-to-end Phase 1-3 path:
- Input size:
241 trades,48 test trades,2 news items,10 agent logs - Ingestion:
0.002220s - Model train:
0.005207s - Anomaly detect:
0.001858s - Correlation:
0.090947s - Intent + flag scoring:
0.001784s - Total pipeline time:
0.102017s
Validated controls and abuse-path checks:
- Audit log tamper detection:
PASS(modified entries invalidate chain) - Canary breach trigger path:
PASS - Key rotation misuse guard:
PASS(missing key usage raises) - Cross-symbol correlation isolation:
PASS - FIPS strict non-approved algorithm guard:
PASS - Side-channel noise injector behavior:
PASS - Vault encryption/decryption roundtrip:
PASS
- Added robust fallback model path in anomaly detection when
scikit-learnis unavailable. - Added in-memory vault fallback when
abir-guardis unavailable for local/dev reliability. - Fixed audit chain verification edge case to ensure deterministic tamper checks.
- Improved API detection endpoint with untrained-model guardrails and safe auto-training behavior.
- Added symbol-aware trade-to-news correlation for tighter intent context.
- Added optional FinBERT sentiment path with safe heuristic fallback.
- Migrated codebase and tests to timezone-aware UTC to remove Python deprecation warnings.
- Added real workflow badges for CI and publish pipelines.
Market Trades + News + Agent Logs
|
v
Behavioral AI Detection (anomaly + intent)
|
v
Correlation Engine (trade/news/agent link)
|
v
Risk Scoring + Flagging
|
v
Quantum/Security Layer (vault + audit + canary + key rotation)
|
v
Compliance and Alert Outputs
- Python 3.10+
pip- Optional:
abir-guardfor production-grade PQC backend
git clone https://github.com/Abiress/abir-market-sentinel.git
cd abir-market-sentinel
pip install -r requirements.txt
pip install -e "."/usr/bin/python3 src/main.py/usr/bin/python3 src/api/realtime_api.py/usr/bin/python3 -m pytest -qabir-market-sentinel/
โโโ src/
โ โโโ alerting/ # Risk scoring and trade flagging
โ โโโ api/ # Flask real-time API
โ โโโ behavioral_ai/ # Anomaly detector + intent analyzer
โ โโโ correlation/ # Trade-news-agent correlation
โ โโโ data_ingestion/ # Market/news/agent mock ingestion
โ โโโ quantum_security/ # Abir-Guard-backed (or fallback) vault
โ โโโ security/ # Audit, canary, FIPS mode, key rotation, privacy
โ โโโ main.py # End-to-end pipeline entry
โโโ tests/ # Unit + integration tests
โโโ config/ # Runtime configuration
โโโ examples/ # Example runner
โโโ PHASES.md # Phase-by-phase plan and progress
โโโ THREAT_MODEL.md # Zero-trust threat model
โโโ README.md # This document
| Phase | Status | Version |
|---|---|---|
| Phase 1 โ Foundation | โ Complete | v1.0.1 |
| Phase 2 โ Intelligence | โ Complete | v1.0.1 |
| Phase 3 โ Security Hardening | โ Complete | v1.0.1 |
| Phase 3.1 โ Stabilization | โ Complete | v1.0.1 |
| Phase 4 โ Scale and Performance | ๐ก Planned | v1.1.0 |
| Phase 5 โ Enterprise and Compliance | ๐ก Planned | v2.0.0 |
See PHASES.md for full milestone detail.
THREAT_MODEL.md: architecture-level threats and mitigationsSECURITY.md: reporting and response processCONTRIBUTING.md: development and PR conventionsCODE_OF_CONDUCT.md: community expectationsCITATION.cff: citation metadataLICENSE: MIT terms
The World's First AI-Powered Insider Trading Detection Engine with Quantum-Ready Security.
Built on top of Abir-Guard (NIST FIPS 203/204), this engine goes beyond rule-based detection by analyzing intent, not just activity.
Current insider trading detection is rule-based, not AI-behavioral. Banks use static thresholds (โtrade > $1M = flagโ), which misses:
- Sophisticated traders using slow-drip accumulation
- Rumor-based positioning before news breaks
- Cross-market manipulation across related symbols
- AI agents with prior knowledge injecting trades
Abir Market Sentinel detects intent-based market manipulation:
- โ Behavioral AI: Isolation Forest detects abnormal patterns
- โ Intent Analysis: NLP flags suspicious motivation (not just activity)
- โ Multi-Source Correlation: Links trades โ news โ agent actions
- โ Quantum-Safe: ML-KEM-1024 + AES-256-GCM via Abir-Guard
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DATA INGESTION โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Market Data โ โ News Feeds โ โ Agent Logs โ โ
โ โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ โ
โโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ BEHAVIORAL AI DETECTION ENGINE โ
โ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ Anomaly โ โ Intent โ โ
โ โ Detector โ โ Analyzer โ โ
โ โ (Isolation โ โ (FinBERT + โ โ
โ โ Forest) โ โ Keyword Scan) โ โ
โ โโโโโโโโโโฌโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโโ โ
โ โ โ โ
โ โโโโโโโโโโผโโโโโโโโโผโโโโโโโโโโ โ
โ โ Correlation Engine โ โ
โ โ โข Trade-News Linking โ โ
โ โ โข Agent Action Correlation โ โ
โ โโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ RISK SCORING & FLAGGING โ
โ Formula: risk = |anomaly|ร0.4 + intentร0.4 + newsร0.2 โ
โ Threshold: >0.6 โ Flag for investigation โ
โโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ QUANTUM-SAFE STORAGE (Abir-Guard) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ ML-KEM-1024 + X25519 Hybrid KEM โ โ
โ โ AES-256-GCM Envelope Encryption โ โ
โ โ Tamper-Evident Audit Log (SHA-256) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ALERTING & COMPLIANCE โ
โ โข Real-time notifications โ
โ โข SEC Rule 10b-5 compliance reports โ
โ โข MiFID II transaction reporting (Phase 5) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Feature | Traditional Solutions | Abir Market Sentinel |
|---|---|---|
| Detection Type | Rule-based (static thresholds) | AI-Behavioral (Isolation Forest) |
| Intent Analysis | โ None | โ NLP + Keyword Scanning |
| News Correlation | โ None | โ Time-window Linking |
| Agent Tracking | โ None | โ Cross-Agent Correlation |
| Encryption | AES-256 only | โ ML-KEM-1024 + AES-256-GCM |
| Quantum-Safe | โ Vulnerable to HNDL | โ NIST FIPS 203/204 Compliant |
| Audit Trail | Basic logs | โ Tamper-Evident SHA-256 Chain |
| Breach Detection | โ None | โ Canary Trades (Honeypots) |
Scenario: A trader consistently trades just hours before major earnings announcements with suspicious precision.
How Sentinel Helps:
- Behavioral AI flags unusual trade timing patterns
- Intent analyzer detects references to "confidential info" or "insider knowledge"
- Correlation engine links trades to upcoming earnings news
- Risk score exceeds 0.6 โ Trade flagged for investigation
# Example flagged output
{
"trade_id": "T0045",
"risk_score": 0.78,
"reason": "Behavioral anomaly; Suspicious intent identified; 3 related news events",
"flagged_at": "2026-05-04T10:30:00"
}Scenario: An agent spreads rumors about a company while simultaneously taking large positions.
How Sentinel Helps:
- Agent action correlation detects info requests before trades
- News sentiment analysis identifies rumor-based headlines
- Intent analysis flags "not public" keyword mentions
- Combined intent score triggers alert
Scenario: An attacker gains access to the trade database and starts querying flagged trades.
How Sentinel Helps:
- Canary trades (honeypots) planted in the database
- Any access to canary trades triggers breach alert
- Tamper-evident audit logs record the breach attempt
- Quantum encryption (ML-KEM-1024) protects data even if exfiltrated
Scenario: Financial institution needs to prove they monitor for insider trading.
How Sentinel Helps:
- Tamper-evident audit logs with SHA-256 hash chains
- Export reports in regulatory formats (Phase 5)
- Quantum-safe storage meets "Harvest Now, Decrypt Later" threats
- FIPS 140-3 compliance mode (NIST standards)
Scenario: Same actor manipulates multiple related stocks across different markets.
How Sentinel Helps:
- Trade-news correlation across multiple symbols
- Agent action tracking across markets
- Behavioral patterns detected even with small trade sizes
- Distributed detection (Phase 4) for multi-market coverage
- Python 3.10+
- abir-guard >= 3.1.0
# Clone the repository
git clone https://github.com/Abiress/abir-market-sentinel.git
cd abir-market-sentinel/
# Install abir-guard from source
bash install_abir_guard.sh
# Install dependencies
pip install -r requirements.txt
# Install in development mode
pip install -e ".[dev]"python src/main.pyExpected output:
======================================================================
Abir Market Sentinel - AI Insider Trading Detection Engine
Phase 1: Foundation | Phase 2: Intelligence | Phase 3: Security
======================================================================
[Phase 1] Ingesting market data...
Loaded 200 trades, 2 news items
[Phase 2] Detecting anomalies with intent analysis...
Found 5 anomalous trades
[Phase 3] Flagging suspicious activity...
FLAGGED: Trade T045 | Risk: 0.72
Reason: Suspicious intent identified; Multiple correlated news events
======================================================================
SUMMARY: 3 trades flagged out of 200
Quantum-secured storage active via Abir-Guard
Audit log entries: 8
Audit chain valid: True
Canary status: {'breach_detected': False, ...}
======================================================================
curl -X POST http://localhost:5000/api/detect \
-H "Content-Type: application/json" \
-d '{
"trades": [{"trade_id": "T001", "symbol": "AAPL", "volume": 10000}],
"news": [{"headline": "Apple earnings surprise"}]
}'Response:
{
"total_trades": 1,
"anomalies_detected": 1,
"flagged_trades": [
{"trade_id": "T001", "risk_score": 0.75, "reason": "..."}
]
}- ML-KEM-1024 (NIST FIPS 203) for key encapsulation
- ML-DSA-65 (NIST FIPS 204) for digital signatures
- AES-256-GCM for data encryption (128-bit quantum resistance)
- Hybrid KEM: ML-KEM + X25519 (both must break)
- Tamper-evident audit logs with SHA-256 hash chains
- Canary trades to detect data breaches
- Automated quantum key rotation
- FIPS 140-3 compliance mode
- Differential privacy with Laplace noise injection
This project aligns with:
| Mission | Badge | Description |
|---|---|---|
| ๐ฎ๐ณ Indian Quantum Mission | IQM | Quantum-resilient cryptography for India's NQM |
| ๐ Global Quantum Mission | GQM | NIST FIPS 203/204 compliant worldwide |
| ๐ฎ๐ณ๐ Indian AI Mission | IAI | Quantum-secure memory vaults for sovereign AI |
Abir Maheshwari
- Founder at Artificial Quantum Dyson Intelligence, Biro Labs, Aquilldriver
- AI Engineer | Quantum Computing Researcher
Connect
- Email: abhirsxn@gmail.com
- LinkedIn: abirmaheshwari
- Instagram: @anantraga31
- Medium: @abirmaheshwari
๐ฎ๐ณ Made in India, for the World.
Secured by NIST PQC, AES-256-GCM, Argon2id, ML-DSA-65, ML-KEM-1024 ยท v1.0.1 ยท Licensed under MIT 2026