x402-coding

x402-coding is a cursor rule for Cursor from Dexter-DAO/opendexter-ide. It costs 780 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 for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Building or maintaining integrations that use OpenDexter, the x402 SDK, x402 search and fetch flows, payment approvals, access requests, and status checks.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/dexter-dao/opendexter-ide/x402-coding
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.

Clone the repo
git clone --depth 1 https://github.com/Dexter-DAO/opendexter-ide

Made for: Cursor.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for x402-coding

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 780 This file is loaded in full into every session.
When invoked 780 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00780 $0.00780
Opus 5.5 $0.00312 $0.00312
Sonnet 5.5 $0.00156 $0.00156
Haiku 4.5 $0.00078 $0.00078

Measured 1mo ago against content hash 10710acb94c4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 56 lines

What it actually says

x402-coding:

  • Current OpenDexter source registers eight tools before connection. Published 1.24.1 exposes seven; dexter_report_work is the added source tool.
  • 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_search → x402_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.
  • Use dexter_report_work for meaningful work updates with the stored OAuth bearer bound to the same agent. Reporting needs no spending grant or funding. After rejection or possible dispatch, the proxy does not refresh authentication and resend the report automatically. Keep private data, credentials and control characters out of summaries. Server-assigned observedAt and expiresAt describe statement freshness.
  • After an uncertain report response, preserve the same operationId and identical fields. On a revision conflict, inspect currentReport and currentRevision; a deliberate update uses a new operationId and that currentRevision as expectedRevision. Financial outcomes retain their own receipts.
  • 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. 1mo ago Changed · +13 lines · +193 tokens per session 10710acb94c4
  2. 1mo 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 21d ago), licensed MIT. It adds 780 tokens to every session, about $0.0031 per session on Opus 5.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.