secure-workflow-guide
Secure Workflow Guide leads developers through Trail of Bits' five-step smart contract security process, automating Slither vulnerability scanning, detecting special features like upgradeability and ERC conformance, generating visual security diagrams, documenting properties for formal verification tools like Echidna and Manticore, and identifying manual review areas including privacy, front-running, and DeFi interaction risks. Use this before deployment or at each code check-in.
git clone --depth 1 https://github.com/trailofbits/skills /tmp/secure-workflow-guide && cp -r /tmp/secure-workflow-guide/plugins/building-secure-contracts/skills/secure-workflow-guide ~/.claude/skills/secure-workflow-guideSKILL.md
# Secure Workflow Guide ## Purpose Guides through Trail of Bits' secure development workflow - a 5-step process to enhance smart contract security throughout development. **Use this**: On every check-in, before deployment, or when you want a security review --- ## The 5-Step Workflow Covers a security workflow including: ### Step 1: Check for Known Security Issues Run Slither with 70+ built-in detectors to find common vulnerabilities: - Parse findings by severity - Explain each issue with file references - Recommend fixes - Help triage false positives **Goal**: Clean Slither report or documented triages ### Step 2: Check Special Features Detect and validate applicable features: - **Upgradeability**: slither-check-upgradeability (17 upgrade risks) - **ERC conformance**: slither-check-erc (6 common specs) - **Token integration**: Recommend token-integration-analyzer skill - **Security properties**: slither-prop for ERC20 **Note**: Only runs checks that apply to your codebase ### Step 3: Visual Security Inspection Generate 3 security diagrams: - **Inheritance graph**: Identify shadowing and C3 linearization issues - **Function summary**: Show visibility and access controls - **Variables and authorization**: Map who can write to state variables Review each diagram for security concerns ### Step 4: Document Security Properties Help document critical security properties: - State machine transitions and invariants - Access control requirements - Arithmetic constraints and precision - External interaction safety - Standards conformance Then set up testing: - **Echidna**: Property-based fuzzing with invariants - **Manticore**: Formal verification with symbolic execution - **Custom Slither checks**: Project-specific business logic **Note**: Most important activity for security ### Step 5: Manual Review Areas Analyze areas automated tools miss: - **Privacy**: On-chain secrets, commit-reveal needs - **Front-running**: Slippage protection, ordering risks, MEV - **Cryptography**: Weak randomness, signature issues, hash collisions - **DeFi interactions**: Oracle manipulation, flash loans, protocol assumptions Search codebase for these patterns and flag risks For detailed instructions, commands, and explanations for each step, see [WORKFLOW_STEPS.md](resources/WORKFLOW_STEPS.md). --- ## How I Work When invoked, I will: 1. **Explore your codebase** to understand structure 2. **Run Step 1**: Slither security scan 3. **Detect and run Step 2**: Special feature checks (only what applies) 4. **Generate Step 3**: Visual security diagrams 5. **Guide Step 4**: Security property documentation 6. **Analyze Step 5**: Manual review areas 7. **Provide action plan**: Prioritized fixes and next steps Adapts based on: - What tools you have installed - What's applicable to your project - Where you are in development --- ## Rationalizations (Do Not Skip) | Rationalization | Why It's Wrong | Required Action | |-----------------|----------------|-----------------| | "Slither not available, I'll check manually" | Manual checking misses 70+ detector patterns | Install and run Slither, or document why it's blocked | | "Can't generate diagrams, I'll describe the architecture" | Descriptions aren't visual - diagrams reveal patterns text misses | Execute slither --print commands, generate actual visual outputs | | "No upgrades detected, skip upgradeability checks" | Proxies and upgrades are often implicit or planned | Verify with codebase search before skipping Step 2 checks | | "Not a token, skip ERC checks" | Tokens can be integrated without obvious ERC inheritance | Check for token interactions, transfers, balances before skipping | | "Can't set up Echidna now, suggesting it for later" | Property-based testing is Step 4, not optional | Document properties now, set up fuzzing infrastructure | | "No DeFi interactions, skip oracle/flash loan checks" | DeFi patterns appear in unexpected places (price feeds, external calls) | Complete Step 5 manual review, search codebase for patterns | | "This step doesn't apply to my project" | "Not applicable" without verification = missed vulnerabilities | Verify with explicit codebase search before declaring N/A | | "I'll provide generic security advice instead of running workflow" | Generic advice isn't actionable, workflow finds specific issues | Execute all 5 steps, generate project-specific findings with file:line references | --- ## Example Output When I complete the workflow, you'll get a comprehensive security report covering: - **Step 1**: Slither findings with severity, file references, and fix recommendations - **Step 2**: Special feature validation results (upgradeability, ERC conformance, etc.) - **Step 3**: Visual diagrams analyzing inheritance, functions, and state variable authorization - **Step 4**: Documented security properties and testing setup (Echidna/Manticore) - **Step 5**: Manual review findings (privacy, front-running, cryptography, DeFi risks) - **Action plan**: Critical/high/medium priority tasks with effort estimates - **Workflow checklist**: Progress on all 5 steps For a complete example workflow report, see [EXAMPLE_REPORT.md](resources/EXAMPLE_REPORT.md). --- ## What You'll Get **Security Report**: - Slither findings with severity and fixes - Special feature validation results - Visual diagrams (PNG/PDF) - Manual review findings **Action Plan**: - [ ] Critical issues to fix immediately - [ ] Security properties to document - [ ] Testing to set up (Echidna/Manticore) - [ ] Manual areas to review **Workflow Checklist**: - [ ] Clean Slither report - [ ] Special features validated - [ ] Visual inspection complete - [ ] Properties documented - [ ] Manual review done --- ## Getting Help **Trail of Bits Resources**: - Office Hours: Every Tuesday ([schedule](https://meetings.hubspot.com/trailofbits/office-hours)) - Empire Hacking Slack: #crytic and #ethereum channels **Other Security**: - Remember: Security is about more than smar
Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI/CD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI/CD pipeline security for prompt injection risks, or evaluating agentic action configurations.
Clarify requirements before implementing. Use when serious doubts arise.
Enables ultra-granular, line-by-line code analysis to build deep architectural context before vulnerability or bug finding.
Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations, and access control issues. Use when auditing Algorand projects (TEAL/PyTeal).
Prepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools, increases test coverage, removes dead code, ensures accessibility, and generates documentation (flowcharts, user stories, inline comments).
Scans Cairo/StarkNet smart contracts for 6 critical vulnerabilities including felt252 arithmetic overflow, L1-L2 messaging issues, address conversion problems, and signature replay. Use when auditing StarkNet projects.
Systematic code maturity assessment using Trail of Bits' 9-category framework. Analyzes codebase for arithmetic safety, auditing practices, access controls, complexity, decentralization, documentation, MEV risks, low-level code, and testing. Produces professional scorecard with evidence-based ratings and actionable recommendations.
Scans Cosmos SDK blockchain modules and CosmWasm contracts for consensus-critical vulnerabilities — chain halts, fund loss, state divergence. 25 core + 16 IBC + 10 EVM + 3 CosmWasm patterns. Use when auditing custom x/ modules, reviewing IBC integrations, or assessing pre-launch chain security. Updated for SDK v0.53.x.