pact-guards

Implement and verify Pact guards for access control in smart contracts.

1|1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/Pact-Community-Organization/github-marketplace --skill pact-guards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pact-guards
Source: https://github.com/Pact-Community-Organization/github-marketplace/tree/main/skills/pact-guards
Command: npx skills add https://github.com/Pact-Community-Organization/github-marketplace --skill pact-guards

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pact-based smart contracts require robust, auditable guard patterns to enforce who can read, write, or perform privileged actions. This skill provides a taxonomy of guards and practical guidance to implement and enforce them safely.

Core Features & Use Cases

  • Guard taxonomy: Keyset, KeysetRef, User, Capability, and Escrow guards with concrete prefixes and usage semantics.
  • Enforcement patterns: enforce-guard / enforce-keyset, rotation via define-keyset, and principal management across namespaces.
  • Principals & rotation: create-principal, validate-principal, is-principal, and namespace-aware keyset definitions to enable secure identity binding.

Quick Start

Define a simple keyset guard and enforce it on a sample transaction to illustrate the workflow.

Frequently Asked Questions about pact-guards

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

FAQPage Schema
How do I implement access control for Pact smart contracts?

Pact smart contracts use guards to enforce access control for read, write, and privileged actions. You can implement robust security by applying guard types like Keyset, User, Capability, and Escrow, then validating permissions using enforcement mechanisms.

What is the difference between Keyset and Capability guards in Pact?

Keyset guards in Pact authenticate actions based on cryptographic key ownership, while Capability guards manage permissions for specific privileged operations. Keysets handle multi-key authentication, whereas Capabilities scope access to enforce granular read-only versus write permissions within smart contract execution.

How do I set up multi-key authentication in Pact?

Multi-key authentication in Pact is set up using Keyset guards and define-keyset for rotation. You define the required keys, apply the keyset to namespace-aware definitions, and enforce it on transactions to ensure only authorized signatures can execute privileged contract actions.

How does principal management work for namespace-aware keyset definitions?

Principal management in Pact uses create-principal, validate-principal, and is-principal functions to bind identities securely across namespaces. This enables namespace-aware keyset definitions, allowing auditable key rotation and secure identity verification within contract deployments.

Can I use escrow-style gating for Pact deployments?

Yes, escrow-style gating is supported in Pact deployments using Escrow guards. This guard type provides concrete prefixes and usage semantics to securely hold and release assets or permissions, ensuring auditable contract flows when enforcing conditional transaction execution.

When should I rotate keysets in Pact smart contracts?

You should rotate keysets in Pact smart contracts when managing principals across namespaces or updating authorized signers. Using define-keyset for rotation ensures secure identity binding and maintains auditable access control without disrupting existing contract enforcement patterns.