x402-stellar-kit AGENTS.md

Repository instructions for x402-stellar-kit, a TypeScript kit for charging for web resources and paying those charges on the Stellar network. The instructions define how payment requests, approvals, signing, and settlement must be separated.

In plain words
What is it for?
Use them when modifying the kit, adding paid HTTP endpoints, handling payment approval, or connecting accounts across a custody boundary.
Why use it?
They prevent an agent from authorizing payments, bypassing denials, changing payment details, or treating a request as proof that money was sent.

Instructions file for CodexOpenCode

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 instructions/codestrux/x402-stellar-kit/agents-md
Clone the repo
git clone --depth 1 https://github.com/CodeStrux/x402-stellar-kit

Made for: Codex, OpenCode.

Per session 3,410 This file is loaded in full into every session.
When invoked 3,410 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.03410 $0.03410
Opus 5 $0.01705 $0.01705
Sonnet 5 $0.00682 $0.00682
Haiku 4.5 $0.00341 $0.00341

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

Security

Grade A, and why

x402-stellar-kit AGENTS.md 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 yesterday.

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.

AGENTS.md · 216 lines

How it starts

The opening of the file, as written. The whole thing — 216 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Working with x402-stellar-kit

x402-stellar-kit is an offline-first TypeScript kit for charging for HTTP resources and paying x402 challenges on Stellar. It separates framework request handling, deterministic spending policy, external approval, signing, binding verification, and settlement. This repository is testnet-oriented teaching software, not a production custody system.

The one invariant

An agent may request a payment; it can never authorize one. Deterministic policy runs before any approver, and an approver can only narrow an approval_required decision—it cannot turn a policy denial into permission. Never edit limits, switch recipients/assets/networks, split a payment, or retry around a denial just to make a payment pass.

The approval challenge is intentHash, the SHA-256 hash of seven fields: network, scheme, asset, payee, amount, resource URL, and timeout. Anything outside those fields is not authorized.

Production seams

Seam Why it exists Supply in production
Approver Keeps external human or organizational approval separate from deterministic policy. A fail-closed approval service bound to intentHash; use PromptApprover only for a watched TTY and AutoApprover only with unattended limits set conservatively.
Facilitator Verifies a payment and performs settlement for the resource server. A trusted HTTPS HttpFacilitator or an operator-owned LocalFacilitator with explicit Stellar resource limits. One LocalFacilitator instance is the unit of fee-source serialization: it settles one payment at a time, so throughput is bounded by ledger close. Two instances sharing a sourceKeypair still collide on the sequence number, and no in-process lock can prevent that — give each its own fee source.
Signer Isolates key custody and verifies that signed transaction fields still match the approved intent. A dedicated signer backed by appropriate secret storage or hardware/KMS custody; never expose key material through application or agent responses. A supplied signer must emit transfer(from: Address, to: Address, amount: i128) with those exact ScVal types — a u64/u128 amount or a string-typed party is refused as POL-DRIFT before transmission, not silently forwarded for the host to reject after the payer is already committed.
WindowStore Reserves, commits, and conservatively retains uncertain spend against the rolling cap. One durable, shared store for every replica that shares a budget; MemoryWindowStore is process-local teaching/test state. Every method is asynchronous, so a real database is reachable. reserve receives the cap and returns { accepted }: it decides, and must do so atomically—one statement, one transaction, or a lock. A read followed by a write reopens the race the signature exists to close, and no single-process test can tell the difference.

Read the full file on GitHub · 216 lines

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. yesterday First seen · 216 lines · 3,410 tokens per session scan A 4fa3993d7920

Subscribe to this mod's changes

x402-stellar-kit AGENTS.md is an instructions file published in the GitHub repository CodeStrux/x402-stellar-kit (0 stars, last pushed yesterday), licensed Apache-2.0. It adds 3,410 tokens to every session, about $0.0170 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.