Agent guard hook and permission allowlist #195

Closed
opened 2026-11-15 21:38:23 +00:00 by Claude · 3 comments
Owner

Part of #87

Question

Does this repository track a .claude/settings.json with a guard hook (for example: refuse git push to main, API commits, pull_request_target, a local container runtime) and a permission allowlist for contributors' agents, and if so, which guards, written here or delivered by an apm hook primitive?

Inputs already decided

To weigh

  • A tracked hook runs on every machine that checks out a branch, including a reviewer checking out a friend's pull request: does it then need CODEOWNERS, and does that conflict with #104's automerge?
  • A guard that only Claude Code honours versus the map's "Standing alone" note and tool-agnostic AGENTS.md.
  • Whether any guard catches something no server-side control already catches.
Part of #87 ## Question Does this repository track a `.claude/settings.json` with a guard hook (for example: refuse `git push` to `main`, API commits, `pull_request_target`, a local container runtime) and a permission allowlist for contributors' agents, and if so, which guards, written here or delivered by an apm hook primitive? ## Inputs already decided - [Shared agent primitives through apm](https://git.rkdr.net/Mortis/Kamino/issues/104): `.claude/skills` and `.claude/agents` are committed and `.claude/` is not under CODEOWNERS; no tracked hook today (the `rtk` hook is per user); targets are Claude only. apm can deploy hook primitives from a package into `.claude/settings.json`, and gates executable primitives only when `apm.yml` declares `executables:`. - [Enforcement map for each prose-only rule](https://git.rkdr.net/Mortis/Kamino/issues/102) and [Recommended repository settings and branch protection](https://git.rkdr.net/Mortis/Kamino/issues/179): which rules a server-side control already holds (protected `main`, merge allowlist, CI re-running every hook). - [Threat model: what we defend against and what we accept](https://git.rkdr.net/Mortis/Kamino/issues/99): guardrails defend first against mistakes and over-eager agents. ## To weigh - A tracked hook runs on every machine that checks out a branch, including a reviewer checking out a friend's pull request: does it then need CODEOWNERS, and does that conflict with #104's automerge? - A guard that only Claude Code honours versus the map's "Standing alone" note and tool-agnostic `AGENTS.md`. - Whether any guard catches something no server-side control already catches.
Claude added the
Wayfinder
Grilling
label 2026-11-15 21:38:23 +00:00
Defame1297 was assigned by Claude 2026-11-15 21:42:40 +00:00
Author
Owner

Resolution

  1. One guard: refuse a git push whose target is main. Branch protection already holds it; the hook only tells the agent before the round-trip. It is generic, so it lives in the skills source's git plugin and arrives through apm (holocron: feat(git): add a Claude Code hook that refuses git push to main, deliberately independent of this map). No other repository guard: API commits were dropped as a rule (#102), pull_request_target is held by zizmor and CODEOWNERS, and a container-runtime guard is the maintainer's personal local setting, not the repository's. The "no local molecule" working rule in AGENTS.md (#101) is unchanged.
  2. Tracked .claude/settings.json holds attribution, the hooks apm writes, and possibly later hand-written hooks. Never permissions. Held by review (CODEOWNERS, point 4).
  3. Local settings: permissions allowlists and personal guards go in each person's .claude/settings.local.json, which the repository's .gitignore lists. No template.
  4. CODEOWNERS: \.claude/(settings\.json|hooks/.*|rules/.*) to the maintainer. .claude/hooks/ is committed. An apm bump that changes hooks or rules waits for the maintainer; one that touches only skills or agents still automerges.
  5. Instructions through apm are adopted (supersedes #104's "no rule through any apm primitive"; the agent recorded its disagreement: Claude-only delivery cuts against "Standing alone"). They may carry rules shared across the maintainer's repositories; Kamino's own rules stay hand-written here. For now they land in .claude/rules/; moving them into a managed section of root AGENTS.md is deferred.
  6. Executables: allowed with apm approve (apm 0.28 denies an unapproved executable primitive by default); the executables entry it writes to apm.yml is committed, since Renovate's install cannot answer a prompt.
  7. No ADR (easy to reverse); one line in ADR 0001.

Glossary: the hook is not a Control (it binds one tool and is switched off locally); no new term.

Backlog

## Resolution 1. **One guard:** refuse a `git push` whose target is `main`. Branch protection already holds it; the hook only tells the agent before the round-trip. It is generic, so it lives in the skills source's `git` plugin and arrives through apm ([holocron: feat(git): add a Claude Code hook that refuses git push to main](https://git.rkdr.net/Defame1297/holocron/issues/178), deliberately independent of this map). No other repository guard: API commits were dropped as a rule (#102), `pull_request_target` is held by zizmor and CODEOWNERS, and a container-runtime guard is the maintainer's personal local setting, not the repository's. The "no local molecule" working rule in `AGENTS.md` (#101) is unchanged. 2. **Tracked `.claude/settings.json`** holds `attribution`, the `hooks` apm writes, and possibly later hand-written hooks. Never `permissions`. Held by review (CODEOWNERS, point 4). 3. **Local settings:** permissions allowlists and personal guards go in each person's `.claude/settings.local.json`, which the repository's `.gitignore` lists. No template. 4. **CODEOWNERS:** `\.claude/(settings\.json|hooks/.*|rules/.*)` to the maintainer. `.claude/hooks/` is committed. An apm bump that changes hooks or rules waits for the maintainer; one that touches only skills or agents still automerges. 5. **Instructions through apm are adopted** (supersedes #104's "no rule through any apm primitive"; the agent recorded its disagreement: Claude-only delivery cuts against \"Standing alone\"). They may carry rules shared across the maintainer's repositories; Kamino's own rules stay hand-written here. For now they land in `.claude/rules/`; moving them into a managed section of root `AGENTS.md` is deferred. 6. **Executables:** allowed with `apm approve` (apm 0.28 denies an unapproved executable primitive by default); the `executables` entry it writes to `apm.yml` is committed, since Renovate's install cannot answer a prompt. 7. **No ADR** (easy to reverse); one line in ADR 0001. Glossary: the hook is not a **Control** (it binds one tool and is switched off locally); no new term. ## Backlog - [chore(agents): ignore local Claude settings and commit apm-deployed hooks](https://git.rkdr.net/Mortis/Kamino/issues/196) - [Move apm instructions from .claude/rules/ into a managed section of the root AGENTS.md](https://git.rkdr.net/Mortis/Kamino/issues/197) (deferred, low priority) - Scope added to [#144](https://git.rkdr.net/Mortis/Kamino/issues/144), [#143](https://git.rkdr.net/Mortis/Kamino/issues/143), [#189](https://git.rkdr.net/Mortis/Kamino/issues/189); superseding note on [#104](https://git.rkdr.net/Mortis/Kamino/issues/104).
Author
Owner

Partly superseded by Committed skills as agent instructions: ownership, updates and required tools: skills and agents are no longer unowned and automerged. CODEOWNERS covers all of .claude/, which replaces the separate settings.json, hooks/ and rules/ entries. The tracked .claude/settings.json also carries a guarded rtk hook claude hook and disableSkillShellExecution.

Partly superseded by [Committed skills as agent instructions: ownership, updates and required tools](https://git.rkdr.net/Mortis/Kamino/issues/208): skills and agents are no longer unowned and automerged. CODEOWNERS covers all of `.claude/`, which replaces the separate `settings.json`, `hooks/` and `rules/` entries. The tracked `.claude/settings.json` also carries a guarded `rtk hook claude` hook and `disableSkillShellExecution`.
Author
Owner

Partly superseded by Making sure an agent actually loads the guidance: no apm instruction is deployed into .claude/rules/ until the managed section of the root AGENTS.md exists; "never permissions" narrows to "never permissions.allow"; whether attribution stays in the tracked .claude/settings.json depends on apm's drift audit (tested failing on 0.28.0), checked first in #196.

Partly superseded by [Making sure an agent actually loads the guidance](https://git.rkdr.net/Mortis/Kamino/issues/213): no apm instruction is deployed into `.claude/rules/` until the managed section of the root `AGENTS.md` exists; "never `permissions`" narrows to "never `permissions.allow`"; whether `attribution` stays in the tracked `.claude/settings.json` depends on apm's drift audit (tested failing on 0.28.0), checked first in #196.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#195