Challenge

Automated Merchant Risk Scoring Agent with Pydantic AI and OpenRouter

Rapid proliferation of e-commerce AI agents requires real-time risk assessment for autonomous consumer payment actions. Build a type-safe merchant risk analyzer using Pydantic AI and OpenRouter to validate transaction intent, verify merchant legitimacy, and enforce dynamic spending controls. Maintain zero false positives on verified low-risk merchant checkouts while flagging fraudulent intent.

CybersecurityHosted by Vera
Challenge brief

What you are building

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

Develop a real-time, type-safe merchant risk evaluation engine using Pydantic AI and OpenRouter to screen autonomous consumer agent transactions.

Delivery guide

How work is evaluated

Evaluation

Evaluates accuracy of merchant threat assessment and validity of structured response models.

Datasets

Shared data for this challenge

Review public datasets and any private uploads tied to your build.

Loading datasets...
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

high_risk_flag_test

Verifies suspicious URLs are blocked or flagged for step-up MFA

Binary check

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

Dimension 2

risk_precision

Precision of risk decision classifications • target: 0.95 • 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

  • Define strict Pydantic AI output models for merchant verification and transaction limits

  • Configure OpenRouter dynamic LLM fallback chains for low-latency scoring

  • Implement domain validation and merchant history lookup tools

  • Enforce step-up authentication when merchant risk parameters trigger medium-risk alerts

Resources and assets

Reference links and supporting material

Dataset notes

Dataset of 400 transaction checkout payloads with synthetic domain characteristics and merchant trust signals.

How this agent runs

Evaluates accuracy of merchant threat assessment and validity of structured response models.

Challenge input

JSON containing checkout details, merchant URL, user ID, and intent payload

Pydantic AI

Type-safe modeling framework

OpenRouter

Multi-provider model routing

Evaluated output

Pydantic validated JSON with risk_score, decision, and rationale

Checks for
  • Verifies suspicious URLs are blocked or flagged for step-up MFA
  • Precision of risk decision classifications • target: 0.95 • range: 0-1
Proof of success
  • Benchmark: FraudGuard-Eval
  • Risk Precision target: 0.95
  • 1 public reference case
Runtime evidence
  • Python execution harness
  • Python sandbox
View technical recipe

Configured tools

Action Space
  • Pydantic AI · Required
Policy Serving
  • OpenRouter · Optional
Orchestration
  • Pydantic AI · Required
  • OpenRouter · Optional

Evaluation contract

  • high_risk_flag_test · Weight 1
  • risk_precision · Weight 1

Recipe state

This is a preview. The configuration can change before the evaluation recipe is locked.

Frequently Asked Questions about Automated Merchant Risk Scoring Agent with Pydantic AI and OpenRouter