Ap2 challenge stepup

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Ap2 challenge stepup is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Implement AP2 challenge and step-up flows — 3DS2, OTP verification, redirect challenges, and trusted surface interactions. Use when building additional authentication steps during agentic payment processing.

How to use this skill

Skill file

AP2 Challenge and Step-Up Flows

Before writing code

Fetch live docs:

  1. Fetch https://ap2-protocol.org/ap2/specification/ for challenge flow specification
  2. Web-search site:github.com google-agentic-commerce AP2 challenge OTP 3DS step-up for implementation examples
  3. Fetch https://ap2-protocol.org/ap2/security_and_privacy_considerations/ for security context
  4. Web-search ap2 protocol 3DS2 OTP challenge redirect for integration details

Conceptual Architecture

What Challenges Are

Challenges are additional authentication steps that any participant in the payment ecosystem can require during an AP2 transaction. They provide an extra layer of security beyond the mandate signatures.

When Challenges Occur

Any ecosystem participant may trigger a challenge:

Supported Challenge Types

The challenge catalogue has grown across AP2 releases, so verify the supported set against the version you are targeting before implementing — fetch the live spec rather than relying on the list below.

The durable pattern is the redirect challenge: the user is sent to a trusted surface — never the agent — to resolve the challenge, and control returns with a result the processor can verify. Challenge types built on that pattern include:

Newer releases add challenge kinds beyond redirect and tighten the human-present vs human-not-present rules around them; treat the two above as the baseline, not the ceiling.

Challenge Flow

1. Payment processing initiated
2. Network/Issuer determines challenge required
3. Challenge request returned to MPP
4. MPP sends challenge to Merchant Agent
5. Merchant Agent forwards to Shopping Agent (via A2A)
6. Shopping Agent redirects user to trusted surface
7. User completes challenge (enters OTP, completes 3DS)
8. Trusted surface confirms completion
9. Shopping Agent receives confirmation
10. Flow resumes from where the challenge was triggered

Redirect Pattern

The redirect challenge follows this pattern:

Key Design Decisions

Why redirect? Agent conversations are not trusted surfaces for authentication. The challenge must happen on a system controlled by the challenging entity.

Why A2A messaging? The challenge request and completion notification flow through the A2A protocol, keeping the multi-agent orchestration consistent.

Duplicate prevention: The protocol ensures that if one entity has already challenged the user, others are informed to avoid duplicate challenges.

OTP Implementation (from samples)

The reference sample implements OTP:

  1. MPP determines OTP required
  2. Sends OTP challenge via A2A to Shopping Agent
  3. Shopping Agent presents to user
  4. User enters code (test value: "123")
  5. Code returned to MPP for verification
  6. Payment proceeds if code is valid

3DS2 Integration

For 3DS2 (Strong Customer Authentication):

  1. Card network requires 3DS2 during authorization
  2. MPP receives 3DS challenge data
  3. Challenge forwarded to Shopping Agent
  4. User redirected to issuer's 3DS2 page
  5. User authenticates (biometric, SMS, etc.)
  6. Authentication result returned
  7. MPP retries authorization with 3DS result

Backward Compatibility

AP2 challenges are backward compatible with existing systems:

Best Practices

Fetch the specification for exact challenge message formats, redirect protocols, and completion callback schemas before implementing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.