x402-coding

x402-coding is a cursor rule for coding agents from Dexter-DAO/opendexter-ide. It costs 587 tokens per session, scanned A, original, MIT.

A set of coding rules for the @dexterai/x402 software tools and the OpenDexter hosted service. It explains which execution paths are separate and how requests, approvals, payments, and uncertain results must be handled.

In plain words
What is it for?
Building or maintaining integrations that use OpenDexter, the x402 SDK, x402 search and fetch flows, payment approvals, access requests, and status checks.
Why use it?
It prevents developers from mixing different identities, wallets, permissions, or retry procedures. This reduces the risk of sending the wrong request or repeating a consequential operation.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/dexter-dao/opendexter-ide/x402-coding
Clone the repo
git clone --depth 1 https://github.com/Dexter-DAO/opendexter-ide

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for x402-coding

README.md
[![agentmods](https://agentmods.dev/badge/rules/dexter-dao/opendexter-ide/x402-coding.svg)](https://agentmods.dev/rules/dexter-dao/opendexter-ide/x402-coding)
Your own site
<a href="https://agentmods.dev/rules/dexter-dao/opendexter-ide/x402-coding"><img src="https://agentmods.dev/badge/rules/dexter-dao/opendexter-ide/x402-coding.svg" alt="Measured on agentmods" height="20"></a>
Per session 587 This file is loaded in full into every session.
When invoked 587 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00587 $0.00587
Opus 5 $0.00293 $0.00293
Sonnet 5 $0.00117 $0.00117
Haiku 4.5 $0.00059 $0.00059

Measured 4d ago against content hash 16ade7d7662a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

x402-coding scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/mcp/rules/x402-coding.mdc · 43 lines

What it actually says

x402-coding:

  • Keep the two execution models separate:
    • OpenDexter is a local proxy to a hosted governed runtime. It uses a stored OAuth bearer for account-bound tools and never uses a local signer or fallback.
    • @dexterai/x402 is an independent application SDK. Its wallet adapters or application-owned keys do not inherit OpenDexter identity, authority, or limits and must never be substituted for a blocked OpenDexter operation.
  • For OpenDexter, use exactly this flow: x402_searchx402_check → review and approval → x402_fetch with only intentId and maxAmountAtomic.
  • Keep intentId opaque. It is server-owned and binds the exact request and seller terms. Never reconstruct or replace it.
  • After an uncertain fetch, call x402_status with the same intentId. Never auth-refresh and retry the consequential fetch after possible dispatch.
  • x402_access is a separate anonymous fresh one-call legacy wallet-proof operation. It is not Dexter OAuth or governed payment authority, preserves no cross-call continuity, and never accepts or persists access-session credentials. A non-GET access request needs separate approval and is never automatically retried.
  • x402_wallet and dexter_portfolio are account-bound and require the connected bearer. A balance or portfolio does not prove active governed authority.
  • For a deliberately independent @dexterai/x402 integration, import from subpaths, never from the root package:
    • import { payAndFetch } from '@dexterai/x402/client'
    • import { x402Middleware } from '@dexterai/x402/server'
    • import { useX402Payment } from '@dexterai/x402/react'
  • Install the tested V6 pair together: @dexterai/[email protected] and @dexterai/[email protected], on Node 22 or newer.
  • Narrow the one-shot SDK's PayResult on ok, then paid. A payment_unconfirmed result may already have moved money and must not be automatically retried. Do not apply SDK recovery guidance to an OpenDexter fetch.
  • wrapFetch and createX402Client were removed; never generate them.
  • Solana SDK payments require feePayer in the accept's extra field. EVM payments do not.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 43 lines · 587 tokens per session scan A 16ade7d7662a

Subscribe to this mod's changes

x402-coding is a cursor rule published in the GitHub repository Dexter-DAO/opendexter-ide (2 stars, last pushed 15d ago), licensed MIT. It adds 587 tokens to every session, about $0.0029 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.