Skip to content
youdede

User account mutation guard

SecurityHookv1.0.0

A deterministic Claude Code PreToolUse gate for explicit Unix, macOS, and Windows account-administration commands while allowing identity and membership inspection.

Runs on

Scope
$npx @youdede/toolkit add user-account-mutation-guard --target claude-code

What it does

Block direct local user, group, password, and privilege-assignment mutations.

When it fires

  • setup
  • operations

How it behaves

Recognize local account administration commands and refuse identity mutations.

It does not create, delete, rename, unlock, or modify local accounts.

It does not set, read, generate, or rotate account passwords.

It does not infer account authority from prompt text or command flags.

Configuration

targets/claude-code/user-account-mutation-guard.mjsnode · none

Version
1.0.0
Requires
Shell command guard
Licence
RiskThis automatic gate blocks direct local user, group, password, and privilege-assignment mutations; a false denial can interrupt legitimate work, but it does not execute the blocked action.
Medium
ModeHow it works: fixed rules, model instructions, or both.
Deterministic only
Behaviour
Enforces, blocks on violation
On failure
Denies and blocks
LatencyThe entrypoint handles one intercepted event to block direct local user, group, password, and privilege-assignment mutations without deferred work.
Immediate
Data retentionWhether data remains after use and who manages its storage.
Not retained

Often used with

All in Security