account-constraints
Account Constraints
Forked from Trail of Bits Solana security skills. Original category alignment: missing ownership checks. Modified by Sealevel Guard and distributed as skill text under CC BY-SA 4.0.
Anchor account-validation and account-relationship review skill.
Purpose
Detect whether the program trusts the wrong accounts, the wrong owners, or the wrong mutability assumptions.
Focus
This skill is responsible for:
- missing ownership checks,
- discriminator and account-type validation issues,
- incorrect mutability assumptions,
- unsafe remaining accounts usage,
- and account relationship mismatches.
What To Look For
- accounts accepted without validating expected owner or role
- handlers that rely on type assumptions not enforced by constraints
- mutable accounts passed where immutability should be enforced
- remaining accounts used as an untrusted side channel
- token program or associated token program assumptions not validated
Anchor-Specific Heuristics
- weak
AccountInfohandling - implicit trust in
remaining_accounts - account structs whose constraints do not match the handler's authority model
- owner checks that are implied but not enforced
Output Shape
Each finding should state:
- which account relationship is being trusted,
- what validation is missing,
- what wrong account could be substituted,
- and why that matters to a downstream agent's trust decision.
Example Finding Themes
- missing owner validation on critical account
- unsafe mutable account acceptance
- unchecked remaining accounts path
- wrong token program trust assumption
More from newmanxbt/sealevel-guard
cpi-risk
Detects whether the program can invoke the wrong program, propagate too much privilege, or trust unsafe callback behavior. Internal specialist module for CPI risk review.
1token-invariants
Detects whether token and vault logic can violate economic or accounting assumptions another agent would rely on. Internal specialist module for token invariant review.
1pda-integrity
Detects whether a program's PDA design allows spoofing, role confusion, or weak authority derivation. Internal specialist module for PDA integrity review.
1access-control
Detects whether privileged behavior is exposed to the wrong signer, authority, or account path. Internal specialist module for Solana access-control review.
1sealevel-guard-review
Orchestrates parallelized Solana trust-gate review to determine whether a codebase or program is safe enough to ship, integrate, or allocate capital through. Use when asked to review, audit, or assess risk of a Solana program.
1governance-upgrade-risk
Detects whether governance or upgrade control is concentrated, weakly separated, or capable of undermining user or integrator trust. Internal specialist module for governance risk review.
1