Repository navigation
feat: add Kestrova action provider (Solidity security scan, x402) - #1669
Open
som2026-commits wants to merge 1 commit into
Open
som2026-commits wants to merge 1 commit into
som2026-commits wants to merge 1 commit into
Conversation
🟡 Heimdall Review Status
|
This branch has not been deployed
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.
Description
Adds a Kestrova action provider (TypeScript) so agents that write or deploy Solidity can check a contract for known vulnerability patterns before deploying it. Kestrova runs Slither static analysis as a hosted service; the preview is free and full results are paid per call with x402 (USDC on Base or Solana mainnet), reusing AgentKit's existing
@x402/fetch,@x402/evmand@x402/svmclients.Actions:
kestrova_scan_preview(free, no wallet): severity counts, High/Medium detector names, one example finding and abehind_paywallsummary of what a paid result would add.kestrova_get_scan_price(free): live price for the wallet's network, checked against the published terms, so the agent can ask the user before paying.kestrova_buy_scan(paid):findings(0.25 USDC, every finding with file/line as JSON) orfull(1 USDC, adds an explanation and fix per finding plus PDF/SARIF).Payment safety:
registerPolicy) that keeps only the exact published terms (schemeexact, USDC, recipient, network, tier amount); anything else is never signed.maxPaymentUsdccap (default 1.0, orKESTROVA_MAX_PAYMENT_USDC).doNotPayAgain: trueand the free recovery endpoint instead of retrying.Automated static analysis, not an audit; the action descriptions say so.
Tests
Unit tests:
kestrovaActionProvider.test.ts(14). They cover the pinned-terms check (recipient, asset, amount, network, scheme), the free preview, price lookup and tampered terms, and refusal on an unsupported network or a price above the cap. A full x402 flow signs locally with a throwaway key against mocked fetch: tampered terms are never signed, exact terms are paid once (EIP-3009to/valuechecked), and an unclear outcome yieldsdoNotPayAgain.pnpm jestintypescript/agentkit: 63 suites, 918 tests pass.tsc --noEmitand eslint/prettier pass.Live (built package, free actions only, no payment):
Network: base-mainnet / solana-mainnet (getNetwork stub; no funds)
kestrova_scan_preview (reentrant Vault.sol) -> counts {"High":1,"Informational":2}, detectors ["reentrancy-eth"]
kestrova_get_scan_price findings -> base-mainnet 0.25 payable true; solana-mainnet 0.25 payable true
kestrova_get_scan_price full -> base-mainnet 1 payable true; solana-mainnet 1 payable true
Checklist