Skip to main content
Loading navigation

Pydantic AI & Dify Anti-Money Laundering Sharing Agent

Build a Pydantic AI multi-party information sharing pipeline integrated into Dify to analyze cross-bank COSMIC platform ML/TF alerts with structured Pydantic validation. Achieve a 90%+ true-positive detection rate while enforcing zero data-leakage constraints.

Workflow AutomationHosted by Vera

What you are building

Construct a type-safe agent using Pydantic AI and Dify workflows to evaluate inter-bank COSMIC platform ML/TF intelligence securely.

How work is evaluated

Evaluation

Evaluates Pydantic AI models on structured validation accuracy, privacy leakage checks, and risk calculation accuracy.

Datasets

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

How submissions are scored

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

Pydantic Schema Validation

Ensures the response strictly adheres to the output schema without missing keys

Binary check

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

Dimension 2

detection_precision

Precision of high risk ML/TF detection • target: 0.9 • 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

  • Leverage Pydantic AI for strongly typed agent inputs, outputs, and validation rules

  • Integrate agent logic with Dify workflow orchestration engine

  • Process financial transaction logs while adhering to Singapore's COSMIC data privacy guidelines

  • Implement risk-based scoring for Money Laundering / Terrorism Financing (ML/TF)

Resources

Dataset notes

Anonymized COSMIC platform simulation dataset containing structured transaction graphs and ML/TF risk labels.

Challenge setup

Evaluates Pydantic AI models on structured validation accuracy, privacy leakage checks, and risk calculation accuracy.

Challenge input

JSON containing obfuscated transaction logs and counterparty metadata

Pydantic AI

Provides type-safe structured outputs and validation for compliance

Dify

Visual workflow builder and agent orchestration tool

Evaluated output

JSON matching Pydantic output model with risk_level, confidence, and flags

Evaluation checks
  • Ensures the response strictly adheres to the output schema without missing keys
  • Precision of high risk ML/TF detection • target: 0.9 • range: 0-1
Configured evaluation evidence
  • Benchmark: AMLBench
  • Detection Precision target: 0.9
  • 1 public reference case
Configured runtime
  • Python execution harness
  • Python sandbox (unavailable on Versalist)

Shows the first task, up to three tools, and up to three evidence items.

View technical recipe

Configured tools

Action Space
  • Dify · Required
  • Pydantic AI · Optional
  • Aim · Optional
Orchestration
  • Pydantic AI · Optional

Evaluation contract

  • Pydantic Schema Validation · Weight 1
  • detection_precision · Weight 1

Metrics

  • detection_precision · Target 0.9

Benchmarks

  • AMLBench
  • security

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: JSON containing obfuscated transaction logs and counterparty metadata

    Output: JSON matching Pydantic output model with risk_level, confidence, and flags

    Execution harness: Python

Evaluation tools

  • Pydantic AI · Agent Framework
  • Dify · Agent Systems

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Pydantic AI & Dify Anti-Money Laundering Sharing Agent