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
- Halmos or Kontrol: Formal verification with symbolic execution (Trail of Bits archived Manticore in June 2026)
- 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.
How I Work
When invoked, I will:
- Explore your codebase to understand structure
- Run Step 1: Slither security scan
- Detect and run Step 2: Special feature checks (only what applies)
- Generate Step 3: Visual security diagrams
- Guide Step 4: Security property documentation
- Analyze Step 5: Manual review areas
- 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/Halmos)
- 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.
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:
Workflow Checklist:
Getting Help
Trail of Bits Resources:
- Office Hours: Every Tuesday (schedule)
- Empire Hacking Slack: #crytic and #ethereum channels
Other Security:
- Remember: Security is about more than smart contracts
- Off-chain security (owner keys, infrastructure) equally critical
Ready to Start
Let me know when you're ready and I'll run through the workflow with your codebase!
1---2name: secure-workflow-guide3description: Guides through Trail of Bits' 5-step secure development workflow. Runs Slither scans, checks special features (upgradeability/ERC conformance/token integration), generates visual security diagrams, helps document security properties for fuzzing/verification, and reviews manual security areas. Use when securing a smart contract end to end rather than hunting one bug, checking a project on every check-in or before deployment, triaging a Slither report, or asking where to start on smart contract security.4metadata:5 source: https://skillmd.com/skills/stanfish06/secure-workflow-guide6---78# Secure Workflow Guide910## Purpose1112Guides through Trail of Bits' secure development workflow - a 5-step process to enhance smart contract security throughout development.1314**Use this**: On every check-in, before deployment, or when you want a security review1516---1718## The 5-Step Workflow1920Covers a security workflow including:2122### Step 1: Check for Known Security Issues23Run Slither with 70+ built-in detectors to find common vulnerabilities:24- Parse findings by severity25- Explain each issue with file references26- Recommend fixes27- Help triage false positives2829**Goal**: Clean Slither report or documented triages3031### Step 2: Check Special Features32Detect and validate applicable features:33- **Upgradeability**: slither-check-upgradeability (17 upgrade risks)34- **ERC conformance**: slither-check-erc (6 common specs)35- **Token integration**: Recommend token-integration-analyzer skill36- **Security properties**: slither-prop for ERC203738**Note**: Only runs checks that apply to your codebase3940### Step 3: Visual Security Inspection41Generate 3 security diagrams:42- **Inheritance graph**: Identify shadowing and C3 linearization issues43- **Function summary**: Show visibility and access controls44- **Variables and authorization**: Map who can write to state variables4546Review each diagram for security concerns4748### Step 4: Document Security Properties49Help document critical security properties:50- State machine transitions and invariants51- Access control requirements52- Arithmetic constraints and precision53- External interaction safety54- Standards conformance5556Then set up testing:57- **Echidna**: Property-based fuzzing with invariants58- **Halmos** or **Kontrol**: Formal verification with symbolic execution (Trail of Bits archived Manticore in June 2026)59- **Custom Slither checks**: Project-specific business logic6061**Note**: Most important activity for security6263### Step 5: Manual Review Areas64Analyze areas automated tools miss:65- **Privacy**: On-chain secrets, commit-reveal needs66- **Front-running**: Slippage protection, ordering risks, MEV67- **Cryptography**: Weak randomness, signature issues, hash collisions68- **DeFi interactions**: Oracle manipulation, flash loans, protocol assumptions6970Search codebase for these patterns and flag risks7172For detailed instructions, commands, and explanations for each step, see [WORKFLOW_STEPS.md](resources/WORKFLOW_STEPS.md).7374---7576## How I Work7778When invoked, I will:79801. **Explore your codebase** to understand structure812. **Run Step 1**: Slither security scan823. **Detect and run Step 2**: Special feature checks (only what applies)834. **Generate Step 3**: Visual security diagrams845. **Guide Step 4**: Security property documentation856. **Analyze Step 5**: Manual review areas867. **Provide action plan**: Prioritized fixes and next steps8788Adapts based on:89- What tools you have installed90- What's applicable to your project91- Where you are in development9293---9495## Rationalizations (Do Not Skip)9697| Rationalization | Why It's Wrong | Required Action |98|-----------------|----------------|-----------------|99| "Slither not available, I'll check manually" | Manual checking misses 70+ detector patterns | Install and run Slither, or document why it's blocked |100| "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 |101| "No upgrades detected, skip upgradeability checks" | Proxies and upgrades are often implicit or planned | Verify with codebase search before skipping Step 2 checks |102| "Not a token, skip ERC checks" | Tokens can be integrated without obvious ERC inheritance | Check for token interactions, transfers, balances before skipping |103| "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 |104| "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 |105| "This step doesn't apply to my project" | "Not applicable" without verification = missed vulnerabilities | Verify with explicit codebase search before declaring N/A |106| "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 |107108---109110## Example Output111112When I complete the workflow, you'll get a comprehensive security report covering:113114- **Step 1**: Slither findings with severity, file references, and fix recommendations115- **Step 2**: Special feature validation results (upgradeability, ERC conformance, etc.)116- **Step 3**: Visual diagrams analyzing inheritance, functions, and state variable authorization117- **Step 4**: Documented security properties and testing setup (Echidna/Halmos)118- **Step 5**: Manual review findings (privacy, front-running, cryptography, DeFi risks)119- **Action plan**: Critical/high/medium priority tasks with effort estimates120- **Workflow checklist**: Progress on all 5 steps121122For a complete example workflow report, see [EXAMPLE_REPORT.md](resources/EXAMPLE_REPORT.md).123124---125126## What You'll Get127128**Security Report**:129- Slither findings with severity and fixes130- Special feature validation results131- Visual diagrams (PNG/PDF)132- Manual review findings133134**Action Plan**:135- [ ] Critical issues to fix immediately136- [ ] Security properties to document137- [ ] Testing to set up (Echidna/Halmos)138- [ ] Manual areas to review139140**Workflow Checklist**:141- [ ] Clean Slither report142- [ ] Special features validated143- [ ] Visual inspection complete144- [ ] Properties documented145- [ ] Manual review done146147---148149## Getting Help150151**Trail of Bits Resources**:152- Office Hours: Every Tuesday ([schedule](https://meetings.hubspot.com/trailofbits/office-hours))153- Empire Hacking Slack: #crytic and #ethereum channels154155**Other Security**:156- Remember: Security is about more than smart contracts157- Off-chain security (owner keys, infrastructure) equally critical158159---160161## Ready to Start162163Let me know when you're ready and I'll run through the workflow with your codebase!