Skip to main content
Challenge

Build Type-Safe UPI Fraud Triage Agent with Pydantic AI

High-volume instant payment systems require ultra-reliable and strictly typed risk assessment to block fraudulent transfers. Build a type-safe fraud triage pipeline using Pydantic AI with dependency injection to evaluate merchant risk parameters with 0% runtime schema errors.

Business OperationsHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Build a type-safe UPI transaction risk triage agent using Pydantic AI validation models and dependency injection.

Delivery guide

How work is evaluated

Evaluation

Evaluates type safety compliance and fraud triage accuracy on live UPI payment streams.

Datasets

Challenge datasets

Public datasets, plus the private datasets you have access to.

Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

pydantic_schema_validation

Validates that response passes Pydantic model instantiation without ValidationError

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

fraud_detection_f1

F1-score on identifying synthetic fraud transaction signals • target: 0.94 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Build structured, type-safe AI agent workflows using Pydantic AI

  • Utilize Pydantic AI dependency injection for dynamic risk model loading

  • Enforce strict schema validation on UPI transaction fraud outputs

Resources and assets

Reference links and supporting material

Dataset notes

Synthetic stream of UPI transaction vectors with annotated device and merchant risk scores.

Challenge setup

Evaluates type safety compliance and fraud triage accuracy on live UPI payment streams.

Challenge input

JSON containing transaction_amount_inr, velocity_1h, merchant_category_code, device_fingerprint_match

Pydantic AI

Provides type-safe LLM outputs and dependency injection

Evaluated output

JSON matching FraudResult schema: risk_level, block_transaction, trigger_otp

Evaluation checks
  • Validates that response passes Pydantic model instantiation without ValidationError
  • F1-score on identifying synthetic fraud transaction signals • target: 0.94 • range: 0-1
Configured evaluation evidence
  • Benchmark: UPI-Fraud-Bench
  • Fraud Detection F1 target: 0.94
  • 1 public reference case
Configured runtime
  • Python execution harness
  • Python sandbox (unavailable on Versalist)

Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.

View technical recipe

Configured tools

Action Space
  • Pydantic AI · Required
  • Arize AI · Optional
  • Bland AI · Optional
Orchestration
  • Pydantic AI · Required

Evaluation contract

  • pydantic_schema_validation · Weight 1
  • fraud_detection_f1 · Weight 1

Metrics

  • fraud_detection_f1 · Target 0.94

Benchmarks

  • UPI-Fraud-Bench
  • security

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: JSON containing transaction_amount_inr, velocity_1h, merchant_category_code, device_fingerprint_match

    Output: JSON matching FraudResult schema: risk_level, block_transaction, trigger_otp

    Execution harness: Python

Evaluation tools

  • Pydantic AI · Agent Framework

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Build Type-Safe UPI Fraud Triage Agent with Pydantic AI