askill
enforcement

enforcementSafety 85Repository

Use when implementing hooks that BLOCK invalid actions, creating quality gates for state transitions, or enforcing tested:true verification. Load when designing enforcement mechanisms. Uses exit code 2 to block, JSON permissionDecision:deny, or updatedInput modification. Rules are instructions; hooks are enforcement.

7 stars
1.2k downloads
Updated 1/2/2026

Package Files

Loading files...
SKILL.md

Enforcement

Runtime mechanisms that block invalid actions.

Core Principle

"Rules are instructions, not enforcements. Systems need verification gates, not more documentation."

Instructions

  1. Identify what needs enforcement (not just documentation)
  2. Choose hook timing: PreToolUse, PermissionRequest, SubagentStop
  3. Implement blocking logic: scripts/block-*.sh
  4. Test with invalid action → verify block

Blocking Mechanisms

MechanismHowEffect
Exit code 2exit 2 + stderrBlocks, feeds stderr to Claude
JSON deny"permissionDecision": "deny"Structured blocking
Stop block"decision": "block"Forces agent to continue

Hook Timing

EventCan Block?Use Case
PreToolUseYesValidate before execution
PermissionRequestYesCustom approval logic
SubagentStopYesForce quality gates
PostToolUseNoFeedback only

References

FileLoad When
references/blocking-hooks.mdImplementing hook mechanisms
references/quality-gates.mdDesigning verification loops
references/hook-templates.mdWriting hook code
references/agent-harness-hooks.mdAgent-harness specific patterns
references/sandbox-runtime.mdOS-level MCP server isolation
references/sandbox-fast-path.mdHybrid security (allowlist + sandbox for 2-3x speed)

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

72/100Analyzed 3/10/2026

Well-structured skill focused on enforcement mechanisms with clear tables, specific blocking methods (exit code 2, JSON deny), and hook timing guidance. Includes 'when to use' trigger, structured steps, and metadata tags. Main gap is lack of inline code examples - relies heavily on external reference files. Not internal-only as it provides general hook patterns applicable across projects.

85
80
80
70
65

Metadata

Licenseunknown
Version-
Updated1/2/2026
Publisheringpoc

Tags

llmsecuritytesting