Hook-Enforced Compliance
ConfidenceLikelyUpdated2026-07-29Review by2026-10-27Sources4Machine-translatedOriginal (JA)
On this page
Wiki route
This entry sits under systems index. Read it against Threshold BFT consensus Rust implementation trend for peer / contrast context and fintech index for the broader system / regulatory boundary.
5-layer public control-point model
| Layer | Public hook / control point | Enforceable boundary | Implementation caution |
|---|---|---|---|
| 1 | UserPromptSubmit / SessionStart |
Adds public rules or validation context before execution | Minimize injected content and include no secrets |
| 2 | PreToolUse |
Branches a tool call to allow / ask / deny | Test matcher, input schema and exit code / JSON response |
| 3 | PermissionRequest |
Handles permission decisions according to policy | Do not allow unconditionally; match the target resource and action |
| 4 | PostToolUse / PostToolUseFailure |
Records results and returns additional feedback | Cannot undo side effects that already occurred, so it is not a substitute for a pre-execution gate |
| 5 | Stop / SubagentStop and regression tests |
Blocks completion when required validation is missing and detects recurrence after configuration changes | State the policy for infinite hook loops, timeouts and fail-open / fail-closed behavior |
Sources: ^[https://code.claude.com/docs/en/hooks]
Essence by layer:
- Layer 1 is injection (before the main contract)
- Layer 2-3 is format enforcement (response structure)
- Layer 4 is tracking (accumulating past violations and escalating)
- Layer 5 is prevention (preventing modifications from reviving past bugs)
First verification pattern
deployment ≠ working. Even if a Hook is placed, whether it actually fires is a separate issue.
Flow until the first actual operation:
- Deploy (placement) → static state
- First trigger → observe whether it fires
- Firing success → reminder injection arrives
- Observable effect → the LLM’s response changes
This wiki entry itself records that moment: during the 2026-04-21 session close, the Layer 1 hook fired successfully for the first time.
Escalation Staircase (higher enforcement strength according to violation frequency)
This design is not a single defense; enforcement strength rises according to frequency:
- ≥3 same type / 30 days → hook strictness UP (the reminder names the specific issue)
- ≥5 same type / 30 days → pre-place
🚨 Compliance Watch: [type]in the Start Session briefing - ≥10 same type / 90 days → run AUDITOR Patrol every Session
Applicability
- Contracts and SOPs: “written = followed” is not true · audits, penalties, and logs are the enforcement mechanism
- Code conventions: lint / CI / pre-commit hooks are equivalent to Layer 1
- Organizational processes: review steps / sign-off are equivalent to Layer 4
- Regulatory compliance: inspections by supervisory authorities are equivalent to Layer 4 · self-inspections are equivalent to Layer 3 (financial-domain examples run alongside FSA Business Improvement Order (BIO) domestic VASP administrative-action history (2018-2026) and JVCEA: Overview of the Self-Regulatory Framework)
Relationship with cognitive traits
Sensitivity to this pattern is linked to SOUL strong rule awareness and pursuit of system integrity (observing candidate · 2026-04-21 newly created). The appearance of this wiki entry itself is evidence of that trait.
Related
- personal-os-architecture (in preparation)
Sources
- Public hook and agent-instruction documentation.
- Public workflow-design examples for pre-generation and post-run compliance checks.
Related
- Wiki Index
Discovery
Keep reading
Read next
- Hyperlane Interchain Security Modules (ISM) · Pluggable Verification LayerThe modularisation of ISMs was a core design at the time of the Hyperlane 2022 年 rename —— the team recognised that a "one-size-fits-all cross-chain security model" could not meet the requir...
- Hyperlane Overview · Permissionless Cross-chain InteroperabilityCross-chain messaging (arbitrary message passing, AMP) is the mainstream abstraction for inter-chain interoperability of 2024-2026 年. Differences in how the major protocols position themselv...
- Hyperlane vs LayerZero/CCIP · Permissionless vs Gated route comparisonThe three major protocols launched around the same period (2021-2022), but their later directions diverged sharply:
Links here
- A Five-Layer Audit Framework for Fork-and-Rebrand ProjectsThe core idea of the Fork-and-Rebrand audit is "what matters is not the code that did not change, but what was changed, what was inherited, and what was hidden."
- Proxy-upgradeable contract rug pattern — admin upgrade rights as a backdoorThe proxy delegates all calls (delegatecall) to an implementation address stored at a fixed storage slot. ERC-1967 standardizes those slots so tools can find them deterministically: