Skip to content

feat: add Kestrova action provider (Solidity security scan, x402) - #1669

Open
som2026-commits wants to merge 1 commit into
coinbase:mainfrom
som2026-commits:feat/kestrova-action-provider
Open

som2026-commits wants to merge 1 commit into
coinbase:mainfrom
som2026-commits:feat/kestrova-action-provider

Conversation

@som2026-commits

Copy link
Copy Markdown

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/evm and @x402/svm clients.

Actions:

  • kestrova_scan_preview (free, no wallet): severity counts, High/Medium detector names, one example finding and a behind_paywall summary 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) or full (1 USDC, adds an explanation and fix per finding plus PDF/SARIF).

Payment safety:

  • The x402 client is given a payment policy (registerPolicy) that keeps only the exact published terms (scheme exact, USDC, recipient, network, tier amount); anything else is never signed.
  • A maxPaymentUsdc cap (default 1.0, or KESTROVA_MAX_PAYMENT_USDC).
  • If a payment was created but the outcome is unclear (202/409/error), the action returns doNotPayAgain: true and 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-3009 to/value checked), and an unclear outcome yields doNotPayAgain.

  • pnpm jest in typescript/agentkit: 63 suites, 918 tests pass. tsc --noEmit and 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

  • Added documentation to all relevant README.md files
  • Added a changelog entry

@cb-heimdall

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
1 if authored by an app that is not allowlisted and lacks verified human attribution 0
Sum 1

@github-actions github-actions Bot added documentation Improvements or additions to documentation action provider New action provider typescript labels Nov 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider documentation Improvements or additions to documentation typescript

Development

Successfully merging this pull request may close these issues.

2 participants