Skip to content

Example: pre-pay check of an x402 endpoint in a CrewAI agent - #10

Open
rumangsanya wants to merge 1 commit into
agent402-dev:mainfrom
rumangsanya:example-crewai-prepay-check
Open

rumangsanya wants to merge 1 commit into
agent402-dev:mainfrom
rumangsanya:example-crewai-prepay-check

Conversation

@rumangsanya

Copy link
Copy Markdown

/claim #2

Adds a CrewAI example: a custom tool that runs the pay-server pre-pay check (npx -y @agent402-dev/pay-server check --json) and hands the JSON verdict to the agent. The agent is instructed to refuse payment whenever fixes > 0. Non-https URLs are refused before the check runs (localhost excepted, matching the check engine's own exception).

Includes a small local broken-402 server so the refusal path can be tried offline.

Tested at tool level with crewai 1.15.50: local broken server returns fixes: 1 (agent refuses to pay), a public http URL is refused before the check runs, and a live x402 endpoint returns fixes: 0. Note: the tool runs npx from a temp cwd to avoid the npm-workspace bin clash when working inside this repo clone — see README.

@opirebot

opirebot Bot commented Dec 5, 2026

Copy link
Copy Markdown

👀 We've notified the reward creators here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant