Skip to content

[Feat]: Add examples and guidance for handling failure states and enforcing mandate constraints #44

@zeelsheladiya

Description

@zeelsheladiya

Is your feature request related to a problem? Please describe.

Currently, the AP2 repo provides mandate types and sample flows, but it does not cover how agents should behave when real-world conditions diverge from the original mandate.
For Ex:

  1. Merchant rejects part of the cart (out of stock).
  2. Price increases beyond the mandate’s limit.
  3. Payment fails or PSP declines transaction.
  4. Mandate expires during a multi step flow.

These are common real-world cases and crucial for ensuring that agents respect user intent while keeping the protocol trustworthy.

Describe the solution you'd like

  1. Add sample scenarios showing failure handling (merchant rejection, price drift, payment decline).
  2. Show how agents should check that actions remain within mandate constraints.
  3. Provide guidance on whether agents should automatically retry, prompt the user, or revoke/update the mandate.

Describe alternatives you've considered

Define a standard error/rollback format that can be used across implementations.

Additional context

Sample agents: samples/ (all appear to follow only success paths)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions