Skip to main content

What is the ACP plugin?

The @mandate.md/acp-plugin package adds Mandate policy enforcement to ACP (Agent Commerce Protocol) by Virtuals Protocol. Before your agent approves an ACP job payment, the plugin validates the USD spend amount against your Mandate policies. If the policy blocks the payment, the job is automatically rejected.

Installation

No additional peer dependencies. The package uses @mandate.md/sdk internally.

Usage

The createAndPay method handles the entire flow: creates the job, polls until the provider responds with a price, validates the USD amount against Mandate, and approves or rejects the payment.

How validation works

ACP payments go through ACP’s smart wallet, not a direct EVM transaction. The plugin creates a synthetic ERC20 transfer payload (USDC on Base Sepolia) that represents the USD spend amount. This synthetic payload is validated against your Mandate policies, giving you the same spend limit enforcement as direct transfers.
  1. Agent calls createAndPay() or payJob()
  2. Plugin extracts the USD value from paymentRequestData.budget
  3. Plugin converts USD to raw USDC units (1 USD = 1,000,000 units)
  4. Plugin validates the synthetic transfer against Mandate
  5. On allowed: approves the ACP payment
  6. On blocked: rejects the ACP payment with the block reason

Methods

Exports

Next Steps

Integrations Overview

Compare all Mandate integration options.

Validate Transactions

Understand how Mandate validates every spend request.

GAME SDK Plugin

Use Mandate with GAME SDK for direct on-chain actions.