Skip to content

Releases: AetherCore-Dev/ag402

v0.1.20 — Fix double-decompression & data truncation behind CDN

15 Mar 11:38

Choose a tag to compare

What's Changed

Critical Bug Fixes

  • Double-decompression crash — when upstream responses include Content-Encoding: gzip (e.g. behind Cloudflare/CDN), the middleware re-wrapped the already-decoded body with the original encoding headers, causing zlib error: incorrect header check. Payment succeeded but the response body was unreadable.

  • Silent data truncationContent-Length header reflected the compressed wire size, not the decoded body size. Consumers reading Content-Length bytes would silently lose 50-90% of response data. No error raised — data simply disappeared.

  • 2 missed response paths — the post-payment retry success/failure paths (the highest-frequency production code paths) still used raw headers, affected by the same bug.

Additional Fixes

  • Forward proxy: added content-encoding to header strip list (defense-in-depth)
  • requests monkey-patch: set url and encoding on constructed Response (prevents raise_for_status() crash and charset detection issues)

Added

  • _decoded_headers() helper — strips content-encoding, transfer-encoding, content-length from all 9 MiddlewareResult construction paths
  • 3 regression tests covering gzip, transfer-encoding, and content-length mismatch scenarios

Impact

All users behind CDN/reverse proxy (Cloudflare, AWS ALB, nginx with gzip) were affected. After payment, responses would either crash with zlib error or silently return truncated data.

775+ tests passing across 4 packages.

Full Changelog: https://github.com/AetherCore-Dev/ag402/blob/main/CHANGELOG.md

v0.1.19 — Production Hardening

14 Mar 09:17

Choose a tag to compare

Changes

Security & CI Hardening

  • CI least-privilege: Added permissions: contents: read to CI workflow
  • Coverage enforcement: Added --cov-fail-under=80 for protocol and core tests
  • X402_MODE warning: load_config() now warns when X402_MODE is unset (prevents accidental test mode in production)
  • Examples debug off: All TypeScript examples now default to debug: false

Dependency Safety

  • Added version upper bounds to all Python dependencies (<1.0.0, <44.0.0 for cryptography)
  • Prevents future breaking changes from silently breaking installs

Version Alignment

  • All packages unified to v0.1.19 (core, protocol, adapters, npm)
  • Fixed npm @ag402/fetch and @ag402/solana publish (previously stuck at 0.1.0)

v0.1.18 — Security audit fixes + test fix

14 Mar 04:22

Choose a tag to compare

What's Changed

Fixed

  • 3-round multi-expert security audit — 30 fixes across 16 files (from v0.1.17 → v0.1.18)
  • CI test fixtest_gateway_refuses_production_without_verifier now provides explicit address param to match gateway's address-before-verifier validation order
  • Improved onboarding docs, error messages, and production TS example
  • MCP server verification via glama.json

Security

  • Header injection sanitization for chain/token/address fields
  • Atomic wallet file writes with proper permissions
  • Gateway rate limiting per IP
  • Password strength validation (min 12 chars)
  • SSRF protection for target_url
  • Explicit X402_MODE requirement to prevent accidental test deployment

Full Changelog: v0.1.17...v0.1.18

@ag402/solana v0.1.0

12 Mar 06:41

Choose a tag to compare

@ag402/solana v0.1.0

Real Solana USDC on-chain payment provider for @ag402/fetch.

Added

  • SolanaPaymentProvider — implements PaymentProvider for real Solana USDC on-chain payments
  • fromEnv() — construct provider from SOLANA_PRIVATE_KEY; accepts rpcUrl, usdcMint, confirmationLevel options
  • confirmationLevel option — "confirmed" (default) or "finalized" for high-value payments
  • MAINNET_USDC_MINT — exported constant for the mainnet USDC mint address
  • SPL Token transfer_checked instruction with Ag402-v1|{requestId} Memo for server-side idempotency
  • ESM + CJS dual build

Security

  • On-chain transaction failure detection: confirmTransaction().value.err checked — throws on failure to prevent wallet deduction without USDC transfer
  • Mainnet + devnet USDC mint mismatch guard: constructor throws when rpcUrl contains "mainnet" but usdcMint defaults to devnet address
  • Zero-lamport guard: amounts smaller than 0.000001 USDC round to 0 lamports and throw before any RPC call
  • Self-payment guard: throws when recipient address equals payer address
  • ATA creation order: recipient ATA created first to minimise wasted SOL on failure
  • getAddress() strips CR/LF/quotes to prevent HTTP header injection

Install

```bash
npm install @ag402/solana @ag402/fetch
```

@ag402/fetch v0.1.0 — TypeScript buyer SDK

11 Mar 03:42

Choose a tag to compare

@ag402/fetch v0.1.0

First release of the TypeScript buyer-side SDK for the x402 auto-payment protocol.

Install

npm install @ag402/fetch

What's in this release

  • createX402Fetch() — wraps native fetch() to auto-handle HTTP 402 Payment Required
  • InMemoryWallet with micro-unit arithmetic (IEEE 754 float-safe)
  • Wallet / PaymentProvider interfaces for custom implementations
  • MockPaymentProvider with production-env warning
  • X402Config: per-call limit, total spend cap, chain/token allowlist, debug
  • paymentTimeoutMs: provider.pay() timeout with wallet rollback
  • Protocol utilities: parseWwwAuthenticate, buildAuthorization, parseAmount, etc.
  • 100 tests; dual ESM+CJS; zero runtime deps; Node.js 18+

Security

  • Header injection prevention (CR/LF/quote rejection in all build fns)
  • 8 KB header size limit in parseWwwAuthenticate
  • All construction options validated fail-fast
  • buildAuthorization fallback on unsafe provider.getAddress() return value
  • InMemoryWallet rejects NaN/Infinity initial balance

Notes

  • No real Solana payment in this release — @ag402/solana coming soon
  • Not safe for concurrent Promise.all calls on the same instance

v0.1.17 — Prepaid recovery, TOCTOU fix, security hardening

10 Mar 14:40

Choose a tag to compare

What's Changed

Added

  • ag402 prepaid recover — self-service credential recovery after gateway timeout; auto-reads ~/.ag402/pending_purchase.json so no arguments needed in the common case
  • ag402 prepaid pending — shows current in-flight purchase waiting for recovery
  • Idempotent /prepaid/purchase — same tx_hash always returns the identical credential (same expiry, same signature); safe to retry after any failure
  • Prepaid issuance ledgerprepaid_issued SQLite table persists across gateway restarts; auto-purged after 366 days on startup

Fixed

  • TOCTOU race conditionINSERT OR IGNORE + rowcount check ensures only one credential issued per tx_hash even under concurrent requests
  • Pending file security0600 permissions, HMAC-SHA256 integrity tag, 30-day expiry, explicit failure warning
  • Windows compatibilitysocket.gethostname() replaces os.uname() in _pending_hmac; os.getlogin() fallback for containers
  • README prepaid syntax — corrected buy command, added recover documentation

Full Changelog: https://github.com/AetherCore-Dev/ag402/blob/main/CHANGELOG.md

v0.1.16 — prepaid hardening, docs, security fixes

10 Mar 11:55

Choose a tag to compare

What's Changed

Security Fixes

  • Credential dir permissions: ~/.ag402/ set to 0o700 on Unix — prevents world-readable credential files
  • Corrupt credentials backup: corrupt file backed up to .json.bak before starting fresh — no silent data loss
  • Weak signing key warning: gateway warns when --prepaid-signing-key < 32 chars, includes keygen hint
  • to_header_value() guard: malformed stored credential now rolls back deduction + falls through to on-chain instead of crashing
  • CLI JSON guard: prepaid buy handles non-JSON / non-dict gateway responses gracefully

Docs & Examples

  • README: prepaid buyer/seller quick start (CLI commands, seller gateway setup)
  • llms.txt: prepaid commands, AG402_PREPAID_SIGNING_KEY, package ID reference table
  • examples/prepaid_demo.py: complete working end-to-end demo

Bug Fixes

  • Fixed 4 incorrect API calls in prepaid_demo.py (non-existent PrepaidCredentialStore, middleware.send(), result.get())
  • Fixed import sort lint error in test_memory_safety.py

Full Changelog: https://github.com/AetherCore-Dev/ag402/blob/main/CHANGELOG.md

v0.1.14 — CI Pipeline Fixes & Lint Remediation

08 Mar 12:39

Choose a tag to compare

What's Changed

Fixed

  • CI Workflows: Fix monorepo pip install to install sub-packages with [dev] extras
  • CI Workflows: Upgrade semgrep-action to container-based; codeql-action v3→v4; pin scorecard-action v2.4.1
  • CI Workflows: Add required security-events: write and id-token: write permissions
  • Lint F821: Add module-level API_KEY variable in bridge.py
  • Lint SIM105: Use contextlib.suppress in solana_adapter.py
  • Lint SIM102: Merge nested if in prepaid_server.py
  • Lint B007: Prefix unused loop variable in challenge_validator.py
  • Semgrep: Replace urllib.request with socket check in setup_wizard.py
  • Lint W293: Fix 35 whitespace errors across openclaw adapter files
  • Ruff config: Add N999 exemption for ag402-skill

Full Changelog: v0.1.13...v0.1.14

v0.1.13 — Security Hardening + Docs Overhaul

08 Mar 11:38

Choose a tag to compare

What's Changed

Security (TDD - 5 fixes)

  • S1-1: Private key removed from os.environ, getter-only access
  • S1-2: Mode-aware host binding (test->127.0.0.1, prod->0.0.0.0)
  • S1-3: Strict mock verify (only .pay()-recorded tx_hashes)
  • S2-1: /health minimal in production (no target_url/metrics)
  • S2-2: Temp directory permissions 0o700 (cli + runners)

Bug Fixes (3 fixes)

  • B1: loop=asyncio for uvicorn (macOS/Windows compat)
  • B2: ATA error detection with friendly messages
  • B3: Improved ConfigError with actionable guidance

Documentation

  • README: Feature Matrix (50+ entries), integration guides, CLI ref
  • CHANGELOG, SECURITY, CONTRIBUTING updated

Testing

  • 17 new TDD security tests
  • 588 passed, 0 failed, all 10 version files synced

Full Changelog: https://github.com/AetherCore-Dev/ag402/blob/main/CHANGELOG.md

v0.1.11 — Seller-No-Key documentation hardening

06 Mar 01:45

Choose a tag to compare

Security

  • Seller-No-Key documentation hardening: Comprehensive audit ensuring sellers are never misled into providing a private key
  • .env.example: SOLANA_PRIVATE_KEY marked BUYER ONLY with role-specific comments
  • SECURITY.md: Added Seller-No-Key Architecture to Security Design
  • setup_wizard.py: Security reminder box + private-key-paste detection for sellers
  • cli.py: ag402 serve prints seller security reminder on startup
  • llms.txt: Enhanced Sell Skill and Red Flags for LLM agents
  • README.md: Added For Sellers security guidance
  • index.html: Seller security notice on landing page

Full Changelog: https://github.com/AetherCore-Dev/ag402/blob/main/CHANGELOG.md