Skip to content

Repository files navigation

🛡️ PhantomShield (IntelliTrace 2026)

Architecture & Prompt Engineering Strategies for Multi-Tier SCF Fraud Detection

Hackathon Banking Tech

A Blueprint for the Indian Banking Ecosystem to achieve real-time, explainable, and privacy-preserving Deep-Tier Supply Chain Finance (DTSCF) fraud detection at a national scale.


🚨 The Challenge: $47 Million Vulnerability

The Indian MSME sector contributes 30% to national GDP but faces a massive credit gap. While digital public infrastructure like TReDS and GSTN alleviate liquidity bottlenecks, they have also expanded the attack surface for financial crimes.

In the IntelliTrace: Protect – Detect – Prevent Fraud scenario, lenders are exposed to a catastrophic multi-tier cascading fraud where a Tier 1 supplier fabricates 340 "phantom" invoices, inflicting $47 million in losses. Traditional 3-way matching and rule-based systems are blind to this because the isolated documentation looks entirely legitimate, and malicious actors use complex "layering" strategies.

✨ Our Solution: The Agentic GNN Architecture

We propose a paradigm shift from reactive monitoring to predictive, network-aware, and autonomous architectures. PhantomShield is a meticulously prompt-engineered "digital detective" powered by Multi-Agent Large Language Models (LLMs), Graph Neural Networks (GNNs), Zero-Knowledge Proofs (ZKPs), and the Indian Digital Public Infrastructure (DPI).

🏗️ Complete Architecture Diagram

graph TD
    Client["Tier 1 Supplier Uploads 340 Invoices"] --> API["Ingestion API"]
    
    subgraph Multi-Agent LLM Orchestration
        API --> Orchestrator["Orchestrator Agent<br/>(Context-Aware Decomposition)"]
        Orchestrator <--> DV["Data Validation Agent<br/>(OCR & Metadata Formatting)"]
        Orchestrator <--> EI["External Intelligence Agent<br/>(External API Queries)"]
        Orchestrator <--> NA["Network Analytics Agent<br/>(Topology Mapping)"]
        Orchestrator <--> QA["QA & Compliance Agent<br/>(Bias Check & XAI Audit)"]
    end

    %% External Connections
    EI <-->|GSTIN / HSN Verification| GSTN["Indian DPI: GSTN & IRP Portal"]
    EI <-->|Fraud Analytics| BIFA["DGARM BIFA Analytics"]

    %% Security & GNN
    subgraph Cryptographic & Graph Intelligence
        DV ----> Fingerprint["Cryptographic Hashing"]
        Fingerprint --> ZKP["Zero-Knowledge Proofs Engine"]
        ZKP <--> TReDS["TReDS Cross-Lender Registry"]
        
        NA <--> GNN["Spatial-Temporal GNN<br/>(Circular Trading / Spikes)"]
    end
    
    QA --> Dashboard["Explainable AI Dashboard<br/>(SHAP / LIME Plain-Language)"]
    Dashboard --> Block["Halt Disbursement & Generate SAR Report"]
Loading

🛠️ Cutting-Edge Technological Pillars

1. Advanced Prompt Engineering (2026 Standards)

We abandon basic chat manipulation in favor of Bento-Box architectures, structurally isolating data from commands to combat prompt injections using the following patterns:

  • Context-Aware Decomposition (CAD): Breaking down analysis by metadata, GST history, and logistics routing independently.
  • Recursive Self-Improvement Prompting (RSIP): Iterative verification loops of temporal and geographic anomalies.
  • Multi-Perspective Simulation (MPS): Simulating perspectives of an auditor, logistics coordinator, and defense lawyer concurrently.
  • Tree of Thoughts (ToT): Calculating confidence limits with strict separation of facts, assumptions, and unknowns.

2. Multi-Agent System (MAS)

Achieves sub-100 millisecond latency discipline using highly specialized personas:

  • Orchestrator Agent: Synthesizes findings and defines the execution sequence.
  • Data Validation Agent: Pre-processing, exact-match bounding, and JSON conversion.
  • External Intelligence Agent: Integrates tightly with Indian DPI (GST Verification, IRN & QR validation, HSN matching, and BIFA metrics).
  • Network Analytics Agent: Graph neural embeddings.
  • QA Agent: Autonomous auditing of biases and generating the final trail.

3. Graph Neural Networks (GNNs) for Deep-Tier Correlation

Because Phantom Invoices hide at the network tier, tabular ML models fail. We use Spatial-Temporal GNNs (ST-GNNs) equipped with neighborhood aggregation to:

  • Instantly flag Circular Trading & Fake ITC loops.
  • Identify Dense Synthetic Clusters and shell entities.
  • Track multi-tier Risk Contagion (Tier 3 → Tier 1 exposure).

4. Zero-Knowledge Proofs (ZKPs) & Federated Learning

Solving cross-bank duplicate financing over TReDS exchanges without compromising MSME privacy. Let's prevent double-financing:

  • Reverseless hashing on normalized invoice attributes allows cross-referencing deduplication without exposing actual invoice content using zk-SNARKs.
  • Federated Learning builds comprehensive global models continuously refining fraud detection across banking consortiums cleanly.

5. Explainable AI (XAI)

To stay regulatorily compliant with RBI standards, algorithms cannot remain "black-boxes":

  • Employs SHAP & LIME to mathematically quantify the exact contribution of each flag (e.g. GSTIN history mismatch vs circular topology warning).
  • Agentic auto-summarization translates this into perfectly readable, evidence-backed Suspicious Activity Reports (SARs) for risk committees.

🎬 Execution Diagram: Halting the $47 Million Hackathon Case

  1. Ingestion: 340 fabricated invoices are uploaded natively. Data agent validates XML structs perfectly.
  2. Context Mismatch via DPI: The External Intelligence agent confirms gov. IRNs are valid but the volume exceeds the supplier's declared historic HSN capabilities.
  3. ZKP Hits: Fingerprints check against the TReDS decentralized registry. Result: Massive duplication overlap found down in Tier 2 & Tier 3 chains.
  4. Topology Map Overlay: GNN spots a rapid flow cycle pointing to shell corporational routing to pad volume.
  5. Agent Synthesis & Stop: The Orchestrator calls the block. XAI summarizes exactly why in a readable dashboard preventing the disbursement perfectly.

🚀 Quickstart & Engineering (Local Prototype)

Our team has designed this repository to run the foundational ingestion and proof of concept logic locally.

  1. Create Virtual Environment & Install Dep:
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt
  1. Start the Fast API Network Services:
uvicorn src.main:app --reload --port 8000
  1. In a separate terminal, trigger the cascading duplicate samples:
python sample_data/generate_sample.py --count 340
  1. Verify The Block! Check the Agentic Output / Status:
curl http://127.0.0.1:8000/alerts

Built for the Future of Secure Working Capital.
Empowering MSMEs. Stopping Financial Syndicates.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages