What is the GOAT SDK plugin?
The@mandate.md/goat-plugin package wraps Mandate’s policy engine as a GOAT SDK plugin. It exposes two tools: mandate_transfer for ERC20 transfers and mandate_x402_pay for x402 payment flows. Every tool call validates against your Mandate spending policies before signing or broadcasting.
The plugin extends PluginBase<EVMWalletClient> and works with any EVM chain supported by GOAT.
Installation
@goat-sdk/core is a peer dependency (>=0.3.0). Install it alongside the plugin.
Usage
mandate_transfer and mandate_x402_pay as tools.
Tools
| Tool | Description |
|---|---|
mandate_transfer | Transfer ERC20 tokens with policy enforcement. Accepts to, amount, tokenAddress, and optional waitForConfirmation. |
mandate_x402_pay | Pay for an x402-gated resource. Accepts url and optional headers. |
MandateWallet internally, validate the transaction against the Mandate API, sign locally, and broadcast. Your private key never leaves the process.
Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
runtimeKey | string | Yes | Mandate runtime key (mndt_live_... or mndt_test_...) |
privateKey | `0x${string}` | Yes | Agent wallet private key (hex, with 0x prefix) |
chainId | number | No | EVM chain ID. Defaults to 84532 (Base Sepolia). |
rpcUrl | string | No | RPC endpoint URL. Defaults to the chain’s public RPC. |
Error handling
The plugin throws plainError objects with descriptive messages. This matches GOAT SDK conventions where tool errors surface as strings to the LLM.
@mandate.md/sdk directly. The SDK throws typed errors: PolicyBlockedError, ApprovalRequiredError, and CircuitBreakerError.
Next Steps
Integrations Overview
Compare all supported agent frameworks and choose the right one.
MandateWallet
Use MandateWallet directly for full control over the validate-sign-broadcast flow.
Handle Errors
Learn how to catch and respond to every Mandate error type.