Skip to content
Back to skills

Enforcement

ASecurity

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.

  • 9 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added February 7, 2026
documentationsecuritydocumentation

Works with

  • mcp

Security analysis

A100/100

Pro scans all 15 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add ingpoc/SKILLS --skill enforcement --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Enforcement?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Enforcement
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ingpoc-enforcement/badge)](https://www.skillsdirectory.com/skills/ingpoc-enforcement)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: enforcement
description: "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."
keywords: hooks, blocking, quality-gates, verification, exit-code-2, deny
---

# 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

| Mechanism | How | Effect |
|-----------|-----|--------|
| Exit code 2 | `exit 2` + stderr | Blocks, feeds stderr to Claude |
| JSON deny | `"permissionDecision": "deny"` | Structured blocking |
| Stop block | `"decision": "block"` | Forces agent to continue |

## Hook Timing

| Event | Can Block? | Use Case |
|-------|------------|----------|
| PreToolUse | Yes | Validate before execution |
| PermissionRequest | Yes | Custom approval logic |
| SubagentStop | Yes | Force quality gates |
| PostToolUse | No | Feedback only |

## References

| File | Load When |
|------|-----------|
| references/blocking-hooks.md | Implementing hook mechanisms |
| references/quality-gates.md | Designing verification loops |
| references/hook-templates.md | Writing hook code |
| references/agent-harness-hooks.md | Agent-harness specific patterns |
| references/sandbox-runtime.md | OS-level MCP server isolation |
| references/sandbox-fast-path.md | Hybrid security (allowlist + sandbox for 2-3x speed) |

Files in this skill

  • SKILL.md1.8 KB
  • references/agent-harness-hooks.md15.9 KB
  • references/blocking-hooks.md6.2 KB
  • references/hook-templates.md9.2 KB
  • references/quality-gates.md6 KB
  • references/sandbox-fast-path.md14.9 KB
  • references/sandbox-runtime.md8.5 KB
  • scripts/block-tested-true.py1.2 KB
  • scripts/require-commit-before-tested.py2.8 KB
  • scripts/require-dependencies.py2.2 KB
  • scripts/test-hook.sh2 KB
  • scripts/validate-transition.py1.2 KB
  • scripts/verify-mcp-sandboxed.py1.2 KB
  • scripts/warn-token-usage.py809 B
  • templates/settings.json1.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.