khushiks21/fraud-investigation-env
0
Fraud Investigation RL Environment
An OpenEnv-compatible reinforcement learning environment where LLM agents learn to detect financial fraud across three progressively harder tasks.
Motivation
Financial fraud costs banks billions annually. This environment simulates real investigator workflows: gather evidence, form hypotheses, make decisions. Unlike toy environments, every case mirrors real-world fraud patterns used by fraud ops teams.
Tasks
Episode Design (2-step)
- Step 1 — Investigate Agent sees account profile + transactions only. Calls
investigateto reveal login events, account changes, and system signals.
- Step 2 — Decide Agent sees full data and submits final fraud decision.
Action Space
{
"action_type": "investigate | submit_decision",
"is_fraud": true,
"fraud_type": "card_fraud | account_takeover | money_mule | bust_out | legitimate",
"confidence": 0.91,
"evidence": ["geo_impossible", "card_not_present"],
"attack_vector": "geo_impossible",
"action": "block_card | freeze_account | allow | file_SAR | hold_for_review | escalate",
"flagged_accounts": ["ACC-1001"],
"hub_account": null,
"regulatory_action": "SAR | law_enforcement | none",
"reasoning": "Transaction from Lagos 224 mins after Mumbai swipe — physically impossible."
}Observation Space
{
"case_id": "CC-001",
"task": "task_easy",
"step": 1,
"account": { "account_id": "...", "name": "...", ... },
"transactions": [...],
"login_events": [...],
"account_events": [...],
"linked_accounts": [...],
"additional_signals": { "distance_km": 8200, ... },
"reward": 0.01,
"done": false,
"feedback": "..."
}Reward Design
Baseline Scores
Quick Start
1. Clone and set up
git clone https://github.com/khushiks2021/RL-env
cd RL-env
cp .env.example .env
# Edit .env and add your GROQ_API_KEY2. Start the environment server
docker build -t fraud-env .
docker run -p 8000:8000 fraud-envOr with docker-compose:
docker-compose up -d3. Run inference
pip install -r requirements.txt
python inference.py