Risk and settlement for Solana agent payments.
jup.sh is an early side project exploring the intersection of Solana DeFi,
AI, and payments.
The idea:
Agents pay with any verified token.
Recipients settle in USDC.
Policy decides when humans step in.This repository contains the jup-sh 1.0 npm CLI, a static product site, a
hosted Risk Review prototype, a local Intent API, and a source-only TypeScript
SDK prototype.
The 1.0 CLI can execute real Jupiter swaps from the user's machine when the user explicitly provides a local Solana keypair. The hosted review site and local transaction request server never custody keys.
Live site:
https://www.jup.shDeveloper docs:
https://jerrywang33.github.io/jup/The current version is an npm CLI plus static Risk Review prototype:
init
-> policy trust/set
-> payment intent
-> mock or Jupiter quote
-> quote-aware policy checks
-> local intent store
-> local read-only intent status/API
-> local review approval/rejection state
-> transaction request runtime gate
-> transaction request preflight
-> unavailable receipt scaffold
-> local intent event log
-> intent expiry/replay gate
-> transaction request token gate
-> wallet account binding gate
-> quote freshness gate
-> real Jupiter swap transaction creation
-> local keypair signing and RPC submission
-> confirmed receipt persistence
-> review URL shortcut
-> hosted Risk Review pageThe SDK path mirrors the same risk layer:
create intent
-> policy profile
-> trusted recipient check
-> Jupiter quote estimate
-> policy explanation
-> Risk Review URL when neededThe server path returns unsigned Solana Pay transaction requests for wallet
authorization. The CLI path can sign and submit only when a user provides a
local keypair with jup-sh intent execute.
jup.sh is designed as a Jupiter-powered risk and settlement layer for Solana
agent payments.
The intended flow:
agent intent -> policy decision -> Jupiter settlement -> authorize or reviewThe default path should be automatic. Human review should appear only when policy or risk signals require it.
Run the npm CLI:
npx jup-sh init
npx jup-sh doctorThen configure policy and create a payment intent:
npx jup-sh policy trust api.vendor.example
npx jup-sh pay --agent deepseek --token SOL --amount 6 --settle USDC --recipient api.vendor.example --jsonThe CLI returns a structured local payment intent. Agents should branch on the exit code:
0 = auto_pay
2 = review_required
1 = rejected or command failureExecution boundary:
Server: no signing, no custody, no private keys.
CLI: signs and submits only with an explicit local keypair.For source development, install dependencies:
npm installShow the default local policy:
npm run cli -- policy showCreate a local policy file:
npm run cli -- policy initCreate a payment intent with the default mock quote provider:
npm run cli -- pay --agent deepseek --token SOL --amount 20 --settle USDCCreate a payment intent with a real Jupiter quote:
npm run cli -- pay --agent deepseek --token SOL --amount 20 --settle USDC --quote-provider jupiterList saved local intents:
npm run cli -- intent listExport a saved intent as a Risk Review URL:
npm run cli -- intent export intent_xxxUse the review shortcut:
npm run cli -- review intent_xxxShow a saved intent:
npm run cli -- intent show intent_xxxThe CLI saves generated intents locally:
.jup-sh/intents/<intent_id>.jsonV1 includes:
- A pay.sh-inspired landing page.
- A command-first agent payment concept.
- A Risk Review prototype.
- A public npm package:
jup-sh. - Real Jupiter swap execution through local
jup-sh intent execute. - A minimal TypeScript SDK prototype in
sdk/. - SDK policy profiles for
sandbox,balanced, andstrictrisk posture. - SDK trusted-recipient helper for known API/vendor destinations.
- SDK policy decision explanations for agent logs and Risk Review.
- A static product shell for the current positioning.
- Changelog in
CHANGELOG.md. - Product notes in
docs/product.md. - Technical architecture and design diagrams in
docs/architecture.md. - CLI release plan in
docs/cli-release-plan.md. - SDK technical design in
docs/sdk-technical-design.md. - CLI JSON contract in
docs/cli-json-contract.md. - Agent integration guide in
docs/agent-integration.md. - npm release checklist history in
docs/npm-alpha-release-checklist.md. - 1.0.0 real execution release notes in
docs/releases/1.0.0.md. - Draft alpha release notes in
docs/releases/0.1.0-alpha.0.md. - Alpha.1 release notes in
docs/releases/0.1.0-alpha.1.md. - Alpha.2 npm release notes in
docs/releases/0.1.0-alpha.2.md. - Alpha.3 init release notes in
docs/releases/0.1.0-alpha.3.md. - Alpha.4 policy tuning release notes in
docs/releases/0.1.0-alpha.4.md. - Alpha.5 review shortcut release notes in
docs/releases/0.1.0-alpha.5.md. - Alpha.6 doctor release notes in
docs/releases/0.1.0-alpha.6.md. - Alpha.7 review handoff release notes in
docs/releases/0.1.0-alpha.7.md. - Draft Alpha.8 transaction request skeleton release notes in
docs/releases/0.1.0-alpha.8.md. - Draft Alpha.9 Intent API/status model release notes in
docs/releases/0.1.0-alpha.9.md. - Draft Alpha.10 persisted review decision release notes in
docs/releases/0.1.0-alpha.10.md. - Draft Alpha.11 transaction request runtime gate release notes in
docs/releases/0.1.0-alpha.11.md. - Draft Alpha.12 transaction request preflight release notes in
docs/releases/0.1.0-alpha.12.md. - Draft Alpha.13 receipt scaffold release notes in
docs/releases/0.1.0-alpha.13.md. - Draft Alpha.14 intent event log release notes in
docs/releases/0.1.0-alpha.14.md. - Draft Alpha.15 intent expiry/replay gate release notes in
docs/releases/0.1.0-alpha.15.md. - Draft Alpha.16 transaction request token gate release notes in
docs/releases/0.1.0-alpha.16.md. - Draft Alpha.17 wallet account binding release notes in
docs/releases/0.1.0-alpha.17.md. - Draft Alpha.18 quote freshness gate release notes in
docs/releases/0.1.0-alpha.18.md. - GitHub Pages developer docs in
docs/. - Jupiter quote-only design in
docs/jupiter-quote-design.md. - Risk Review export design in
docs/risk-review-export-design.md. - Transaction request skeleton design in
docs/transaction-request-skeleton-design.md. - X / Twitter content notes in
docs/x-content.md.
Current npm flow:
npx jup-sh init
npx jup-sh doctor
npx jup-sh policy trust api.vendor.example
npx jup-sh pay --agent deepseek --token SOL --amount 6 --settle USDC --recipient api.vendor.example --jsonReview-required shortcut:
npx jup-sh review intent_xxxSource development command:
npm run cli -- pay --agent deepseek --token SOL --amount 20 --settle USDCLocal TypeScript SDK example:
npm run sdk:check
npm run sdk:smoke
npm run sdk:jupiter:liveimport { createPaymentIntent } from "./sdk/index.js";
const intent = await createPaymentIntent({
agent: "deepseek",
token: "SOL",
amount: 20,
settle: "USDC",
});SDK Jupiter quote-only provider:
import { createJupiterQuoteProvider, createPaymentIntent } from "./sdk/index.js";
const intent = await createPaymentIntent(
{
agent: "deepseek",
token: "SOL",
amount: 20,
settle: "USDC",
},
{
quoteProvider: createJupiterQuoteProvider(),
}
);sdk:jupiter:live is skipped by default. Set JUP_SH_LIVE_JUPITER=1 to call
Jupiter's quote API.
SDK Risk Review URL export:
import { createPaymentIntent, createRiskReviewUrl } from "./sdk/index.js";
const intent = await createPaymentIntent({
agent: "deepseek",
token: "SOL",
amount: 20,
settle: "USDC",
});
const reviewUrl = createRiskReviewUrl(intent, {
reviewBaseUrl: "https://www.jup.sh",
});This uses the same base64url fragment payload as jup-sh intent export.
SDK policy profiles:
import { createPaymentIntent, getPolicyProfile } from "./sdk/index.js";
const intent = await createPaymentIntent(
{
agent: "deepseek",
token: "SOL",
amount: 20,
settle: "USDC",
},
{
policy: getPolicyProfile("sandbox"),
}
);Available profiles are sandbox, balanced, and strict. balanced matches
the default alpha policy.
Trusted recipient helper:
import {
createPaymentIntent,
getPolicyProfile,
withTrustedRecipients,
} from "./sdk/index.js";
const policy = withTrustedRecipients(getPolicyProfile("balanced"), [
"api.vendor.example",
]);
const intent = await createPaymentIntent(
{
agent: "deepseek",
token: "SOL",
amount: 2,
settle: "USDC",
recipient: "api.vendor.example",
},
{ policy }
);Policy decision explanation:
import {
createPaymentIntent,
explainPolicyDecision,
getPolicyProfile,
} from "./sdk/index.js";
const intent = await createPaymentIntent(
{
agent: "deepseek",
token: "SOL",
amount: 20,
settle: "USDC",
},
{
policy: getPolicyProfile("balanced"),
}
);
const explanation = explainPolicyDecision(intent);
console.log(explanation.summary);Alpha wrapper smoke test:
npm run alpha:smokeAlpha npm package dry run:
npm run alpha:packRelease gate:
npm run release:checkJSON output for agents or scripts:
npm run --silent cli:alpha -- pay --agent deepseek --token SOL --amount 20 --settle USDC --jsonThe CLI returns a structured local payment intent with:
status:ready_for_authorization,review_required, orrejected.decision:auto_pay,review_required, orrejected.nextAction:ready_for_authorization,open_review, orrejected.riskLevel:low,medium, orhigh.policyChecks: deterministic local checks over intent fields and quote risk.reviewUrl: full Risk Review URL with#intent=payload when review is required.reviewCommand: local CLI shortcut, such asnpx jup-sh review intent_xxx.
For pay, exit codes are part of the agent contract:
| Exit code | Meaning |
|---|---|
0 |
The intent is inside policy and ready for local authorization. |
2 |
The intent is valid, but policy requires Risk Review. |
1 |
The intent is rejected or the command failed. |
The default quote provider is mock. Use jupiter for executable real routing:
npm run cli -- pay --agent deepseek --token SOL --amount 20 --settle USDC --quote-provider jupiter --recipient-token-account <RECIPIENT_USDC_TOKEN_ACCOUNT>
npm run cli -- intent execute intent_xxx --keypair ~/.config/solana/id.json --rpc-url https://api.mainnet-beta.solana.com --jsonSet JUPITER_API_KEY or pass --jupiter-api-key if the Jupiter endpoint
requires an API key.
Useful local commands:
npm run cli -- init
npm run cli -- policy show
npm run cli -- policy show --json
npm run cli -- policy init
npm run cli -- intent list
npm run cli -- intent list --json
npm run cli -- intent export intent_xxx
npm run cli -- intent export intent_xxx --payload-only
npm run cli -- intent show intent_xxx
npm run cli -- intent show intent_xxx --jsonExample policy override:
{
"maxAutoSettleUSDC": 10,
"maxAllowedSettleUSDC": 250,
"maxPriceImpactBps": 100,
"reviewHighPriceImpact": true,
"verifiedTokens": ["USDC", "SOL", "JUP", "BONK"],
"trustedRecipients": ["jup-sh-demo"],
"reviewUnknownRecipients": true
}Save it as jup.policy.json, then run:
npm run cli -- pay --agent deepseek --token SOL --amount 2 --settle USDC --recipient jup-sh-demoInstall dependencies:
npm installRun locally:
npm run devOpen:
http://localhost:5173Run checks:
npm run checkThe alpha-to-1.0 path is documented in docs/complete-version-roadmap.md.
The current release notes are in docs/releases/1.0.0.md.
jup.sh is an independent community-built tool.
It is not affiliated with, sponsored by, or endorsed by Jupiter Exchange, Solana Foundation, or pay.sh.
References to Jupiter are about using Jupiter API/routing as infrastructure.
MIT — see LICENSE.