Why scan in CI?
Every unprotected wallet call is a potential unvalidated transaction in production. The Mandate scanner catches these gaps at the code level, before deployment. It exits with code 1 if it finds calls missing Mandate validation, which fails the build and blocks the merge. Running the scanner in CI means no developer can accidentally ship asendTransaction() or transfer() call without a corresponding validate(). This is your last line of defense before code reaches production.
GitHub Actions
Add the scanner as a step in your existing workflow or create a dedicated security scan job. The scanner requires no authentication and no configuration.--json to pipe structured output into downstream steps or artifact uploads.
GitLab CI
Add a scan stage to your.gitlab-ci.yml. The merge_request_event rule ensures the scan runs on every merge request.
Pre-commit hook
Catch unprotected calls before they even enter version control. Add this hook to.git/hooks/pre-commit or use a framework like Husky.
chmod +x .git/hooks/pre-commit. For team-wide enforcement, commit the hook via Husky or simple-git-hooks in your package.json.
What does the scanner check?
The scanner detects 10 financial call patterns across.ts, .js, .tsx, and .jsx files:
| Pattern | Description |
|---|---|
sendTransaction( | Generic transaction sends |
sendRawTransaction( | Raw transaction sends |
wallet.transfer( | Direct wallet transfers |
wallet.send( | Shorthand send calls |
writeContract( | Viem contract writes |
walletClient.write | Viem wallet client writes |
executeAction(...transfer) | Framework action executions |
execute_swap | Swap execution functions |
execute_trade | Trade execution functions |
@mandate, references MandateClient, MandateWallet, mandate.validate, or mandate.preflight. Project-level protection applies when @mandate.md/sdk appears in any package.json or a MANDATE.md file exists at the root.
How do you fix findings?
Wrap each unprotected transaction call with avalidate() call in the same function scope. The minimal fix:
MandateWallet which handles validation, signing, and event reporting in a single call. See Validate Transactions for the full pattern.
Next Steps
Codebase Scanner Guide
Detailed walkthrough of scanner patterns, ignore rules, and remediation steps.
Scan CLI Reference
Full flag reference, exit codes, and output formats for the scan command.
Validate Transactions
Add validation to the unprotected calls the scanner found.