The task is canceled, but money is still moving. What you are facing is simple: canceling the task is not the same as revoking the payment authorization.
Think of it this way: you stop a delivery truck, but you do not take back the driver's key. The driver can still open the door and unload at the destination. Stopping the task does not always kill the signing key the agent holds.
Why payments continue after the task is stopped
An AI agent can pay because it holds a "session key." That key's permissions are separate from the task.
Canceling a task only stops the instructions for what the agent should do. The key itself is still registered on-chain and is not revoked. If the agent's code does not check whether the task was canceled before continuing, or if you did not revoke the key when canceling, it can still sign payments.
The core problem: you stopped the plan, not the permission.
Three steps to stop pending payments now
Step 1: Revoke the agent's payment authorization (fastest)
[What to do] Immediately invalidate that key. No matter how the code runs, if the key cannot be used, it cannot pay.
[How to do] It depends on the wallet tool you use:
Nevermined: In the Dashboard, click revoke, or call
DELETE /api/v1/delegation/{delegationId}. There is no cache or grace period. Revocation takes effect immediately. Any in-flight verification or settlement request will returnDELEGATION_INACTIVE. (Source: Nevermined official docs)CHIPI SDK: Call
revokeSession(). This sends an on-chain transaction to mark the session as revoked. You can check the returnedtxHashto confirm the on-chain status. (Source: CHIPI SDK docs)General rule: In the Dashboard or backend admin, find "session management" or "payment authorization," and delete or disable the agent's authorization record.
[Done when] The session status shows revoked or inactive. If the agent is trying to pay, it will receive an authorization error like DELEGATION_INACTIVE.
Step 2: Block through lifecycle hooks (if your framework supports it)
If you use the x402 protocol, you can intercept payment requests for a specific task without revoking the key.
[What to do] Intercept the running payment flow in code, so requests from a canceled task are stopped before payment.
[How to do] Use x402 client hooks or MCP hooks:
client.onBeforePaymentCreation(async ({ taskId, amount }) => {
// check if this task has been canceled
if (await isTaskCancelled(taskId)) {
return { abort: true, reason: "Task was cancelled" };
}
});Or use the MCP client's onPaymentRequired hook to intercept before a tool call triggers payment:
mcpClient.onPaymentRequired(async ({ toolName, paymentRequired }) => {
if (blocklist.has(toolName) || taskCancelled) {
return { abort: true };
}
});(Source: x402 official docs)
[Done when] When a canceled task tries to pay, logs show abort: true and the payment is not submitted.
Step 3: Check wallet balance changes
[What to do] Confirm the revocation is working and nothing slipped through.
[How to do]
Check the agent wallet transaction history. See if there are any new charges after the revocation time.
If there are none, the block worked.
If there are still charges, the agent may be using another key that was not revoked, or the payment request was already submitted on-chain before revocation.
High-risk warning: already signed transactions cannot be stopped. If the agent already signed a transaction with the key before revocation but had not broadcast it yet, it can still broadcast that signed transaction after you revoke the key. Revocation only stops new signatures; it does not take back checks that were already signed. If you see a charge after revocation, check the transaction timestamp. It may have been signed before the revocation.
Final checks
In the Dashboard, confirm the session status changes from
activetorevokedorinactive.Check the wallet transaction history. No new payments after the revocation time.
If you used hooks, logs show
abortrecords.
Verification channel: After task cancellation, trigger a test payment if it is safe. Confirm you get an authorization error instead of a successful payment.


