coinbase / coinbase/agentkit

Example: x402 pre-send guard before EVM agent transaction broadcast

Open
#1,167 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.3k
Forks
815
Avg merge
13h 31m
Merged PRs (30d)
2

Description

I published a small x402 package that fits the AgentKit transaction path as a pre-send guard:

- npm: https://www.npmjs.com/package/nishvault-preflight-buy
- discovery: https://api.nishvault.com/.well-known/x402
- first unpaid 402: https://api.nishvault.com/first-unpaid-402?autorun=1

The use case is narrow: before an autonomous EVM agent broadcasts a transaction, run one x402-paid preflight to inspect revert risk, fee context, and likely call outcome.

Suggested example shape:

```text
agent chooses action -> transaction payload built -> Nishvault pre-send guard -> wallet send/broadcast
```

The package exposes:

- `nishvault-guard-tx`
- `createViemPreflightGuard`
- `createEthersPreflightGuard`
- `createEip1193PreflightGuard`
- `createAgentGuardStep`

Would an example PR showing this as a pre-broadcast guard step be useful for the AgentKit examples/docs?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.