Skip to content

feat(review): enforce the explain-change publish gate and connected-page rule with a hook #6111

Closed

Description

@kyle-sexton

Context

Found while delivering spec container #5835 (review:explain-change shipped in #6018).

Problem

The explain-change publish gate and the rule to keep a connected page off claude.ai are instructions in the skill body. No hook enforces either, so a model that skips or misreads the instruction publishes anyway.

Suggested fix

Add a PreToolUse hook on the Artifact tool (and any publish path the skill uses) that denies a publish unless the gate's approval marker is present, and denies publishing a page marked as connected. Cover it with a hook test for each denial. Per the enforcement hierarchy, decide first whether the residual risk justifies a hook; if not, record the decision.

Related: #5835

Activity

  1. kyle-sexton commented on Oct 3, 2026

    @kyle-sexton
    MemberAuthor

    Additional case from the #6117 security review (Slides lane, /visualization:present): the user-intent --argument artifact that forces publishing is passed by the model; a prompt injection in source material could make it pass that flag without the user asking. Only SKILL.md (present/SKILL.md:66) says not to. A hook enforcing the publish gate should cover this flag too (honour it only when the user's own message asked for an Artifact).

  2. added
    needs-human
    on Oct 15, 2026
  3. kyle-sexton commented on Oct 18, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded.

    Question: /review:explain-change and /visualization:present publish pages as Artifacts. The rule "never publish a connected page" exists only in skill text. A prompt injection could also make the model pass present's --argument artifact flag. Options: (a) a hook on Artifact publish that denies without an approval marker and denies connected pages; (b) no hook, rely on the skill text; (c) a narrow hook that only denies connected pages.

    Owner's answer: (c) now, and leave (a) open. The gate writes no marker a hook could check: it only prints a medium. A connected page is easy to detect: <dir>/page.html, mode 0600, with a connect origin inside. Basis: explain-change SKILL.md:89-101; build-digest.mjs:176-181.

    The owner accepted this recommendation as item D10 of a 32-decision batch in an attended backlog-shaping session on 2026-10-18. The batch question: "Accept all 32 recommendations, including the four flagged above (D2 close the relearn, D26 cross-repo sync without per-repo confirm, D10 narrow hook, D23 delete guard only)?" The owner answered: "Accept all 32 (Recommended)".

    Posted by AI from the owner's answer in that session.

  4. kyle-sexton commented on Oct 18, 2026

    @kyle-sexton
    MemberAuthor

    Agent Brief

    Type: Feature
    Summary: A review-plugin PreToolUse hook on the Artifact tool denies publishing a connected page (decided option (c) of #6111).

    Current behavior:
    Only /review:explain-change skill text says a connected page is never published. A connected page is one built with --connect, whose content security policy names a connect-src http://127.0.0.1:<port> session-bridge origin. The review plugin ships no hooks, so a model that skips or misreads the rule, or follows an injected instruction, can pass a connected page to the Artifact tool. The hosted publish path already refuses such a page. The Artifact path does not.

    Desired behavior:

    • The review plugin registers a PreToolUse hook on the Artifact tool. It denies a call that would publish HTML whose content carries a connect-src naming a loopback origin. That covers the page in file_path and any HTML file in files. The deny reason says a connected page works only on this machine and must stay a local file.
    • Every other Artifact call passes: a page without that directive, a call with no file (read, list, open, quickstart, a type_url create), and an asset upload of a non-HTML file.
    • A file the hook cannot read passes, because the Artifact tool fails on it anyway. A malformed hook payload passes with no output.
    • Detection reads the content, not the path, mode or plugin, so it covers a connected page from any builder.
    • The plugin meets the contracts every hook plugin meets. It has one shell-form SessionStart node-notice row naming /review:check, an exec-form PreToolUse row, a hooks.json description, and a <name>_enabled userConfig switch, default on, that turns the guard off. A read-only /review:check skill reports whether node resolves and whether the hook is registered.

    Key interfaces:

    • Review plugin hook config: a new SessionStart node-notice row and a new PreToolUse row with matcher Artifact.
    • PreToolUse decision on Artifact input: deny when published HTML has a loopback connect-src, otherwise allow.
    • Review plugin userConfig: a new boolean <name>_enabled for this guard.
    • /review:check: a new read-only skill, in the same shape as the other hook plugins' check skills.

    Acceptance criteria:

    • scripts/run-test-file.sh <the new hook test> passes. Its cases: a page built by the digest builder's --connect mode is denied; the same data built without --connect is allowed; a call with no file_path is allowed; an unreadable path is allowed; a connected page passed under files is denied; the guard switched off allows a connected page.
    • scripts/run-test-file.sh scripts/node-notice-rows.test.sh passes with review counted as a hook plugin.
    • scripts/run-test-file.sh <the new check skill's test> passes.
    • check-skill.sh passes on the new check skill.
    • scripts/check-changelog-fragments.sh passes with a review fragment describing the guard.
    • CI's hook checks (exec form, hooks description, kill-switch hoist) pass on the PR.

    Out of scope:


    This was generated by AI during backlog shaping. The owner decided this issue and approved its admission in an attended backlog-shaping session on 2026-10-18.

  5. added
    agent-ready
    and removed
    needs-human
    on Oct 18, 2026
  6. added
    needs-human
    on Oct 18, 2026
  7. melodic-automation-lanes commented on Oct 18, 2026

    @melodic-automation-lanes
    Contributor

    The lanes App's pull request #8133 links this issue with Refs:, not Closes, so the merge lane never merges it. report-outcome added needs-human so a person merges or closes it. When it merges, work-unblock removes this needs-human and agent-ready and adds needs-triage, so triage decides what work is left. To keep the issue held after the merge, add needs-owner-decision.

  8. melodic-automation-lanes commented on Oct 19, 2026

    @melodic-automation-lanes
    Contributor

    The lanes App's pull request #8133 merged with Refs:, so this issue stays open and nothing starts the lane on it again. work-unblock added needs-triage and removed agent-ready, so triage decides what work is left.

  9. added
    needs-triage
    and removed
    needs-human
    agent-ready
    on Oct 19, 2026
  10. kyle-sexton commented on Oct 19, 2026

    @kyle-sexton
    MemberAuthor

    Done by #8133; every criterion verified on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Fields

    No fields configured for Feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions