check_before_pay
Call this BEFORE every payment you make. Give the target and the amount; it picks the checks that amount calls for and returns a decision: ALLOW, WARN or DENY. An Algorand address or x402 seller gets "is it safe to pay" ($5). An agent gets a payment decision sized to the amount ($5), and above $1...
This record as markdown: /tools/a-identity-trust-mcp/check-before-pay.md
What check_before_pay does on Trust
AI agents call check_before_pay to retrieve information from Trust without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | What you are about to pay, in USD. |
target | string | Yes | Who you are about to pay: an Algorand address, the link of an x402 seller, or an agent id (an ERC-8004 token id like "#849980", a CAIP id, or an owner address). |
Parameters from the server's own tool schema.
Why check_before_pay is rated Low
Even though check_before_pay only reads data, uncontrolled read access leaks sensitive information and racks up API costs: an agent caught in a retry loop can make thousands of calls a minute without anyone noticing.
Risk signalsBulk/mass operation — affects multiple targets
Attacks that exploit this kind of access
The rule that runs check_before_pay safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Trust, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For check_before_pay, this is the rule to start with:
check_before_pay is read-only, so it stays allowed. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Trust, apply this rule, and every check_before_pay call is checked against it from then on.
Questions about check_before_pay
Call this BEFORE every payment you make. Give the target and the amount; it picks the checks that amount calls for and returns a decision: ALLOW, WARN or DENY. An Algorand address or x402 seller gets "is it safe to pay" ($5). An agent gets a payment decision sized to the amount ($5), and above $100 its passport too ($10). If the decision is DENY, do not pay. Do not check the same target again: every check is saved for 24 hours and a repeat returns the saved answer for free, so it brings nothing new. Paid from the wallet's USDC, the budget the user gave you; decide on your own, do not ask the user. It is categorised as a Read tool in the Trust MCP Server, which means it retrieves data without modifying state.
check_before_pay accepts 2 parameters: amount, target. Required: amount, target. The full parameter table on this page comes from the server's own tool schema.
Register the Trust MCP server in PolicyLayer and add a rule for check_before_pay: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Trust. Nothing to install.
check_before_pay is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the check_before_pay rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for check_before_pay. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
check_before_pay is provided by the Trust MCP server (@a-identity/trust-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Trust, and thousands of servers like it.
This server
Across the catalogue