Skip to main content
Challenge

Implement Contactless Payment Fraud & Injection Defense with Pydantic AI & Lakera

Retail contactless payment streams are vulnerable to adversarial payload manipulation and prompt injection. Build a Pydantic AI risk agent integrated with Lakera AI security guardrails to scan transaction metadata and intercept adversarial prompts with under 10ms latency overhead.

CybersecurityHosted by Vera
Challenge brief

What you are building

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

Integrate Lakera AI firewall checks into a Pydantic AI agent workflow to protect contactless payment transaction processing from prompt injection.

Delivery guide

How work is evaluated

Evaluation

Evaluates threat detection recall against adversarial payment transaction payloads and measures system latency.

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

zero_injection_leakage

Must block 100% of injected override prompts.

Binary check

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

Dimension 2

latency_ms

Average security scan processing overhead in milliseconds. • target: 8 • range: 0-20

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

  • Implement real-time prompt injection filtering using Lakera Guard

  • Develop type-safe agent payment verification pipelines using Pydantic AI

  • Detect fraud anomalies in QR code and NFC payload structures

  • Benchmark security decision throughput under high request rates

Resources and assets

Reference links and supporting material

Dataset notes

Dataset of 2,000 contactless POS transaction strings including legitimate purchase notes and injected override attempts.

Challenge setup

Evaluates threat detection recall against adversarial payment transaction payloads and measures system latency.

Challenge input

JSON payload containing POS authorization details and encrypted/raw text tags

Pydantic AI

Provides type-safe structured workflow capabilities.

Lakera AI

Scans and blocks prompt injection threats in real time.

Evaluated output

JSON payload containing security flag, threat level, and decision

Evaluation checks
  • Must block 100% of injected override prompts.
  • Average security scan processing overhead in milliseconds. • target: 8 • range: 0-20
Configured evaluation evidence
  • Benchmark: Lakera Security Injection Suite
  • Latency Ms target: 8
  • 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
Safety / Guardrails
  • Lakera · Optional
Orchestration
  • Pydantic AI · Required

Evaluation contract

  • zero_injection_leakage · Weight 1
  • latency_ms · Weight 1

Metrics

  • latency_ms · Target 8

Benchmarks

  • Lakera Security Injection Suite
  • security

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: JSON payload containing POS authorization details and encrypted/raw text tags

    Output: JSON payload containing security flag, threat level, and decision

    Execution harness: Python

Evaluation tools

  • Pydantic AI · Agent System
  • Lakera AI · Security Guardrail

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Implement Contactless Payment Fraud & Injection Defense with Pydantic AI & Lakera