Agent skill
move-safety-core-directives
Lightweight core directives for Sui Move always-required skills — injected into every breadth agent. Full methodology lives in the dedicated Move-Safety Agent.
Install this agent skill to your Project
npx add-skill https://github.com/PlamenTSV/plamen/tree/main/agents/skills/sui/move-safety-core-directives
SKILL.md
Move Safety Core Directives (Sui)
Purpose: These are the INVENTORY + FLAG directives extracted from the 4 always-required Sui skills (ABILITY_ANALYSIS, BIT_SHIFT_SAFETY, TYPE_SAFETY, OBJECT_OWNERSHIP). Every breadth agent receives these to flag Move-specific patterns for depth review. The full trace methodology lives in the dedicated Move-Safety Agent (spawned separately). Total: ~130 lines (vs ~900 lines for 4 full skills)
1. Ability Inventory (from ABILITY_ANALYSIS)
Enumerate ALL structs. For each:
| Module | Struct | Abilities | Has id: UID? |
Is Object? | Transferable? | Notes |
|---|
Flag for depth review:
- Struct with
copythat holdsBalance<T>or represents economic value → [FLAG:ABILITY-COPY-VALUE] - Struct with
dropthat represents an obligation (receipt, hot potato) → [FLAG:ABILITY-DROP-OBLIGATION] - Object (
key) withstorethat should restrict transfers → [FLAG:ABILITY-EXCESS-STORE] - Hot potato (no abilities) with no consumption path in the protocol → [FLAG:ABILITY-STUCK-HOTPOTATO]
copy + keycombination (impossible in Sui — compilation error) → [FLAG:ABILITY-INVALID-COMBO]
2. Bit Shift Inventory (from BIT_SHIFT_SAFETY)
GREP: Search all .move files for << and >>.
For each shift operation:
| Location | Operand Type | Bit Width | Shift Amount Source | User-Controllable? | Bounded? |
|---|
Flag for depth review:
- Shift amount is user-controllable or computed AND unbounded → [FLAG:SHIFT-UNBOUND]
- Shift amount is constant but >= bit width → [FLAG:SHIFT-OVERFLOW-CONST]
- Shift in public/entry function with external input path → [FLAG:SHIFT-EXTERNAL]
3. Generic Type Inventory (from TYPE_SAFETY)
GREP: Search all .move files for fun .*< to find every generic function.
For each generic function:
| Function | Module | Type Params | Constraints | Entry? | Creates/Destroys T? |
|---|
Flag for depth review:
- Generic function accepting
Coin<T>orBalance<T>without verifying T matches expected type → [FLAG:TYPE-COIN-CONFUSION] - Generic with only
storeconstraint wherekeyor specific type is needed → [FLAG:TYPE-WEAK-CONSTRAINT] - Generic entry function callable by anyone with attacker-chosen type → [FLAG:TYPE-ATTACKER-CHOSEN]
- One-Time Witness (OTW) type used outside
init()or not consumed → [FLAG:TYPE-OTW-LEAK]
4. Object Ownership Inventory (from OBJECT_OWNERSHIP)
Classify every object (key ability) by ownership model:
| Object | Ownership | Created Via | Has store? |
Transfer Restricted? | Dynamic Fields? |
|---|
Flag for depth review:
- Shared object mutated without access control → [FLAG:OBJ-SHARED-UNGUARDED]
- Object with
storethat should NOT be freely transferable → [FLAG:OBJ-EXCESS-TRANSFER] - Object deleted via
object::deletewithout cleaning up dynamic fields → [FLAG:OBJ-DELETE-DIRTY] - Owned object wrapped/unwrapped in ways that change its accessibility → [FLAG:OBJ-WRAP-ESCAPE]
- Object with
Balance<T>field but no withdrawal function → [FLAG:OBJ-STRANDED-BALANCE]
Self-Check
Before completing analysis, verify you produced inventories for ALL 4 sections above. Missing inventories = missing coverage for Move-specific vulnerability classes.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
integration-hazard-research
Protocol Type Trigger NAMED_EXTERNAL_PROTOCOL (detected when recon finds import/interface for an identifiable external protocol — not standard libraries). Researches known integration hazards of the target protocol.
outcome-determinism
Protocol Type Trigger outcome_determinism - detected when EITHER of these code patterns are present - - Selection from finite depletable pool with fallback behavior (while(full)...
governance-attack-vectors
Protocol Type Trigger governance (detected when Governor, Timelock, voting, proposal, quorum, delegate patterns found) - Inject Into Breadth agents, depth-external, depth-edge-case
vault-accounting
Protocol Type Trigger vault (detected in recon TASK 0 Step 1) - Inject Into Core state agent OR economic design agent (merge via M4 hierarchy)
lending-protocol-security
Protocol Type Trigger lending (detected when recon finds liquidate|borrow|repay|collateral|lend|loan|LTV|healthFactor|interestRate|debtToken) - Inject Into Breadth agents, depth...
dex-integration-security
Protocol Type Trigger dex_integration (detected when recon finds swap|addLiquidity|removeLiquidity|IUniswapV2Router|ISwapRouter|amountOutMin|amountOutMinimum|slippage - AND the...
Didn't find tool you were looking for?