canister-security

Apply security patterns to Motoko and Rust Internet Computer canisters.

Updated Dec 18, 2025
One-click install
npx skills add https://github.com/Looping-AI/looping-control-plane --skill canister-security-looping-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: canister-security
Source: https://github.com/Looping-AI/looping-control-plane/tree/main/.agents/skills/canister-security
Command: npx skills add https://github.com/Looping-AI/looping-control-plane --skill canister-security-looping-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

IC canister security is essential for protecting state and resources in Motoko and Rust; this skill provides battle-tested patterns to enforce access control, prevent reentrancy, and ensure safe upgrades.

Core Features & Use Cases

  • Access control and anonymous principal rejection
  • Reentrancy prevention with CallerGuard-style guards and saga-based async safety
  • Safe upgrade practices and trap handling to avoid upgrade dead ends
  • Guidance for securing canisters that modify state, handle tokens, or inter-canister call

Quick Start

Implement a per-caller guard around update calls to prevent overlapping requests and apply guard checks in every update.

Frequently Asked Questions about canister-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent reentrancy attacks in IC canisters?

Prevent reentrancy in IC canisters by applying CallerGuard-style guards that enforce per-caller locks around update calls, blocking overlapping requests and saga-based async safety checks.

How do I enforce access control and reject anonymous principals in Motoko?

Enforce access control in Motoko by applying per-method guards that validate caller identities and explicitly reject anonymous principals before any state modification occurs.

What are safe upgrade practices for Rust canisters on the Internet Computer?

Safe Rust canister upgrades involve applying trap handling and specific safety guidelines to avoid upgrade dead ends, ensuring state stability during inter-canister call modifications.

Does canister security support both Motoko and Rust canisters?

Yes, canister security supports typical deployment scenarios for both Motoko and Rust canisters, enforcing async safety, access control, and reentrancy prevention across both languages.

When do I need per-method guards for canister state modifications?

You need per-method guards whenever canisters modify state, handle tokens, or execute inter-canister calls, ensuring per-caller locks prevent overlapping update requests.