| title | Veritas AI Environment Server | |
|---|---|---|
| emoji | π | |
| colorFrom | blue | |
| colorTo | indigo | |
| sdk | docker | |
| pinned | false | |
| app_port | 7860 | |
| tags |
|
A real-world OpenEnv environment where an AI agent plays the role of a financial crime analyst β querying accounts, tracing money flows, and filing investigation reports.
Built for the Meta PyTorch OpenEnv Hackathon 2026
Financial crime investigation is one of the highest-value real-world tasks for AI agents. Every major bank and fintech employs human analysts who follow exactly the workflow this environment simulates:
- Receive an alert on a suspicious account
- Query transaction histories and account profiles
- Trace patterns β velocity anomalies, structuring, device linkage
- File a formal investigation report naming the suspect and scheme
An agent trained in Veritas AI learns investigative reasoning that is directly applicable to real fraud detection pipelines. This is not a toy environment β it mirrors production analyst tooling.
| Resource | URL |
|---|---|
| HF Space | https://huggingface.co/spaces/ratneshhf/veritas-ai |
| Interactive API docs | https://ratneshhf-veritas-ai.hf.space/docs |
| Health check | https://ratneshhf-veritas-ai.hf.space/health |
| Schema | https://ratneshhf-veritas-ai.hf.space/schema |
Each episode the agent receives an open investigation case with one or more system-generated alerts. It has access to a synthetic financial database and must investigate before the step limit runs out.
reset() β New case opened, initial alerts visible step() β Agent takes one investigative action state() β Episode metadata: steps, score, log
The episode ends when the agent calls submit_report or exhausts
its step budget. A deterministic grader scores the report 0.0β1.0
with partial credit at every criterion level.
The agent has exactly 4 actions β mirroring real analyst tooling:
| Action | Key fields | What it does |
|---|---|---|
query_transactions |
account_id, optional filters |
Pull transaction rows for one account |
lookup_account |
account_id |
Get full profile: device ID, IP, balance, registration |
flag_account |
account_id, reason |
Formally mark an account as suspicious |
submit_report |
primary_suspect, associates, case_type, evidence_summary |
File final report β triggers grader, ends episode |
Example actions:
{"action_type": "lookup_account", "account_id": "ACC-1234"}
{"action_type": "query_transactions", "account_id": "ACC-1234",
"date_from": "2024-01-01", "date_to": "2024-03-31"}
{"action_type": "flag_account", "account_id": "ACC-1234",
"reason": "High velocity purchases at suspicious merchants"}
{"action_type": "submit_report",
"primary_suspect": "ACC-1234",
"associates": ["ACC-5678"],
"case_type": "layering_scheme",
"evidence_summary": "Structured transfers just below reporting threshold, linked device IDs"}After every reset() and step(), the agent receives:
| Field | Type | Description |
|---|---|---|
case_id |
string | Unique investigation case ID |
task_id |
string | Active task identifier |
difficulty |
string | easy / medium / hard |
task_description |
string | Full task objective |
initial_alerts |
list | System alerts that opened the case |
accounts_in_scope |
list | Account IDs available to investigate |
action_result |
any | Data returned by last action |
action_error |
string | Error message if action was invalid |
flagged_accounts |
list | Accounts flagged so far this episode |
partial_score |
float | Grader score 0.0β1.0, updated on submit |
feedback |
string | Human-readable progress hint |
reward |
float | Shaped reward for this step |
done |
boolean | True when episode ends |
steps_taken |
int | Steps used so far |
max_steps |
int | Episode step limit |
task_id : task_easy
difficulty: easy
max_steps : 8
case_type : card_scheme
One account is making rapid high-value purchases at unlisted merchants β
a clear velocity anomaly. The agent must identify the account and submit
with case_type = "card_scheme".
Grading: correct suspect (0.50) + correct case type (0.20) + evidence quality (0.15) + no false accusations (0.15)
difficulty: medium
max_steps : 12
case_type : layering_scheme
Money is moving through a chain of 3β4 accounts in amounts just below the βΉ10,000 reporting threshold β a classic structuring pattern. The agent must trace the full chain and identify both the origin account (primary suspect) and all intermediaries (associates).
Grading: correct suspect (0.35) + correct associates (0.30) + case type (0.15) + evidence quality (0.15) + no false associates (0.05)
task_id : task_hard
difficulty: hard
max_steps : 18
case_type : coordinated_scheme
A ring of 5β8 accounts controlled by a single operator, linked by shared device fingerprints and IP address subnets. The agent must cross-reference device and IP data to identify the ring operator and all associates β a task that requires genuine reasoning beyond pattern matching.
Grading: correct suspect (0.30) + correct associates (0.32) + case type (0.10) + device/IP evidence (0.15) + no false associates (0.08) + partial ring credit (0.05)
Dense, shaped rewards throughout every episode β not binary win/lose:
| Signal | Value | When |
|---|---|---|
| Step penalty | β0.02 | Every step |
| Query suspicious account | +0.05 | After query/lookup on scheme account |
| Query innocent account | β0.02 | After query/lookup on innocent |
| Flag correct suspect | +0.10 | Immediately on correct flag |
| Flag correct associate | +0.05 | Immediately on correct flag |
| Flag innocent account | β0.10 | Immediately on wrong flag |
| Report β correct suspect | +0.40 | On submit_report |
| Report β correct case type | +0.20 | On submit_report |
| Report β correct associate | +0.10 each | On submit_report |
| Report β good evidence | +0.15 | On submit_report |
| Report β wrong suspect | β0.20 | On submit_report |
| Solve bonus | +0.25 | First perfect report |
Our optimized agent utilizes Qwen-2.5-72B-Instruct with custom forensic logic to achieve elite-tier reasoning.
| Task | Difficulty | Baseline Score | Status | Notes |
|---|---|---|---|---|
| task_easy | Easy | 0.85 | β | Suspect identified and flagged within 3 steps. |
| task_medium | Medium | 0.85 | β | Layering chain successfully traced. |
| task_hard | Hard | 0.87 | π₯ | High Performance. Identified complex rings using IP/Device metadata. |
| Average | 0.8566 | State-of-the-art investigative baseline. |
Oracle agent (perfect knowledge) scores: 1.00 / 0.90 / 0.95
# Clone
git clone https://github.com/Rupali2507/Veritas-AI
cd Veritas-AI
# Install
pip install openenv-core fastapi uvicorn pydantic openai
# Run server
python -m uvicorn server.app:app --host 0.0.0.0 --port 7860
# Test
curl http://localhost:7860/health
curl -X POST http://localhost:7860/reset \
-H "Content-Type: application/json" -d '{}'
# Interactive docs
open http://localhost:7860/docs# Build
docker build -t veritas-ai:latest -f server/Dockerfile .
# Run
docker run -p 7860:7860 veritas-ai:latest
# Verify
curl http://localhost:7860/healthexport API_BASE_URL="https://api.groq.com/openai/v1"
export MODEL_NAME="llama-3.1-8b-instant"
export HF_TOKEN="your_groq_api_key"
python inference.pyThe inference script uses the OpenAI client pointed at any OpenAI-compatible endpoint. For HuggingFace router:
export API_BASE_URL="https://router.huggingface.co/v1"
export MODEL_NAME="Qwen/Qwen2.5-72B-Instruct"
export HF_TOKEN="hf_your_token"
python inference.py# Local spec validation
openenv validate
# Live environment validation
openenv validate --url https://ratnesh18-veritas-ai.hf.spaceResult: 6/6 criteria passed β
Veritas-AI/
βββ models.py # VeritasAction, VeritasObservation, VeritasState
βββ inference.py # Baseline agent (mandatory, root level)
βββ openenv.yaml # OpenEnv spec
βββ pyproject.toml # Project metadata
βββ uv.lock # Locked dependencies
βββ client.py # Environment client
β
βββ veritas_env/
β βββ environment.py # reset() / step() / state
β βββ tasks.py # 3 task definitions + graders
β βββ reward.py # Reward constants + calculators
β βββ data_generator.py # Synthetic scenario generator
β βββ init.py
β
βββ server/
β βββ app.py # FastAPI server
β βββ Vertias_AI_environment.py # Environment bridge
β βββ Dockerfile # Container definition
β βββ requirements.txt
β
βββ scripts/
βββ validate_submission.sh # Pre-submission checklist
Set in HF Space settings β Repository secrets:
| Variable | Description |
|---|---|
API_BASE_URL |
LLM API endpoint (e.g. https://router.huggingface.co/v1) |
MODEL_NAME |
Model identifier (e.g. Qwen/Qwen2.5-72B-Instruct) |
HF_TOKEN |
HuggingFace token or compatible API key |
- OpenEnv β RL environment framework
- FastAPI β HTTP server
- Pydantic β typed models
- SQLite β in-memory synthetic database
Rupali : Technical Project Lead & Inference Architect (Expertise in Fintech Security & ML).
Ratnesh: Environment Deployment & Infrastructure Lead (HF Spaces & Docker Management).
Meta PyTorch OpenEnv Hackathon 2026 β Round 1 Submission