feat: add sign-safe — offline signing-time transaction safety gate#34
Open
lrafasouza wants to merge 21 commits into
Open
feat: add sign-safe — offline signing-time transaction safety gate#34lrafasouza wants to merge 21 commits into
lrafasouza wants to merge 21 commits into
Conversation
Adds sign-safe as an ext submodule: an offline, deterministic pre-sign transaction safety gate. It decodes an opaque base64 transaction/message (legacy + v0 with ALTs), classifies instructions against a danger-primitive catalog (SetAuthority, BPF upgrade, durable nonce, delegate, large outflow, Token-2022 traps), computes signer-perspective outflow, and emits a SIGN / HOLD / REJECT verdict + verdict.json for autonomous-agent gating. Why it fits a gap: every bundled auditor is retrospective / program-source based, and /debug-user-tx targets a landed transaction. Nothing reviews the bytes a signer is about to authorize — the 2026 Drift ~$285M blind-signing / durable-nonce failure class. sign-safe layers on the core (references it by name), it does not duplicate it. - .claude/skills/ext/sign-safe: submodule -> github.com/lrafasouza/sign-safe-skill (MIT) - .claude/skills/SKILL.md: new "Signing-Time Safety" section + Task-Routing row + frontmatter list - .gitmodules / ext count stay balanced (18 -> 19 both), validate.sh links resolve Upstream skill validation: 154 tests, tsc clean, CI green (Node 20 + 22), dual-reference cross-validation (@solana/web3.js + @solana/kit), 5 real mainnet fixtures, fuzz-clean (9016 inputs), fully offline + deterministic. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@lrafasouza is attempting to deploy a commit to the STBR TRUE Team on Vercel. A member of the Team first needs to authorize it. |
…cies) Points to the polished sign-safe HEAD: MIT copyright owned by the author, package.json author/repository metadata, and @solana/web3.js + @solana/kit moved to devDependencies (the deterministic core imports neither). 154 tests still green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ves / 164 tests) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ives / 168 tests) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…74 tests) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… — 34 primitives / 180 tests) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…5 primitives / 183 tests) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…decode), 238 tests Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…T registry/blocklist), 292 tests Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sign-safe v0.4: real RPC enrichment (ALT resolution, Token-2022 mint screening, Squads clear-sign), two-tier REJECT posture + --strict, 12-program clear-signing registry, real-mainnet precision study (0 false-REJECT, 100% recall). 607 tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
v0.5: simulation, Native Stake, programmatic API + signTransaction/MWA gate + MCP server, schema (requiresHumanReview/category), durable-nonce asymmetry, Lighthouse INFO, Marginfi/Squads registry; full adversarial review + 3 fix passes; 728 tests.
Reflects the competitive-analysis release: evaluator Quickstart, reproducible sample verdicts, Squads HOLD walkthrough, MCP example, failure-recovery doc, CLI e2e + RPC-adversarial tests; 777 tests / 40 files, verify:all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Real on-chain Drift attack corpus (held), npm sign-safe, rpc-adversarial coverage, fuzz + fail-closed fix. 800 tests/42 files, verify:all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
IDL-verified registry (69/69 ixNames vs canonical IDLs), benign corpus 500 (18.4% SIGN / 81.6% HOLD / 0 false-REJECT), Stryker mutation testing. verify:all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fix: npx sign-safe bin was inert (exit 0 for every tx); now correct exit codes + regression test. 803 tests/42 files, verify:all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Updates the pinned sign-safe-skill from v0.6.2 (02b3150) to the current main (e288e9d): v0.6.4 (npm-published, README install + What's-new) plus the repo security hardening (CI least-privilege + SHA-pinned actions, Dependabot, branch protection). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sign-safe v0.6.4 — add the offline pre-sign safety gate as an ext/ skill
This PR adds sign-safe to
solana-ai-kitas anext/skill: an offline, deterministic pre-sign transaction review gate for Solana agents.Current submodule target:
lrafasouza/sign-safe-skill@e288e9dnpx sign-safe <tx.b64>— https://www.npmjs.com/package/sign-safe0.6.4What the skill does
Given opaque transaction/message bytes before signing, sign-safe decodes the Solana wire format (legacy + v0 + ALTs), derives account roles, clear-signs known DeFi/NFT/Squads/stake/system/token instructions, detects authority- and ownership-transfer primitives, computes signer outflow, and returns a machine-readable verdict:
SIGNfor recognized benign flows under policy (exit 0)HOLDwhen a human or higher-trust policy should review (exit 10)REJECTfor known dangerous shapes (exit 20)The deterministic core has no runtime dependencies and stays offline. Network-aware enrichment is isolated behind host adapters.
What's new since v0.5
sign-safe) —npx sign-safe/npx sign-safe-mcp(MCP server for agents) / library import.docs/real-attacks.md.Validation
From
lrafasouza/sign-safe-skill@e288e9d:npm run buildnpm test→ 803 passed / 42 filesnpm run test:fixtures→ 80 PASS / 0 FAILnpm run demo:attack-pack→ 37/37 attack fixtures held or rejected before signing; False SIGN: 0 (plus 2 real Drift transactions held)npm pack --dry-run;npm audit --omit=dev→ 0 vulnerabilities (zero runtime deps)Public CI for
e288e9dis green: https://github.com/lrafasouza/sign-safe-skill/actions/runs/28447798616Honest limits
SIGNis not a universal safety guarantee; it means the transaction matches recognized benign shapes under the current static policy.Integration in this PR
.claude/skills/ext/sign-safeas a public submodule (pinned toe288e9d).