Skip to content

feat(guardrails): write the identity-domain map from the machine profile in setup #9749

Description

@kyle-sexton

Parent

Refs #5945

Depends on

Outcome

/guardrails:setup offers to write the guard's domain map from /harness-ops:machine-profile apply: each
recorded identity domain's tree becomes its roots and its gh directory its gh_config_dir. Values discovery
does not record (owners, identity markers, az_config_dir, shared exceptions) are asked of the operator or left
empty. The map is written only to the plugin data directory, after the operator confirms.

Decisions

  • Epic feat(guardrails): generalize machine-local safety guards into plugin guards #5943 defaults, adopted: the guard lives in guardrails behind its dispatcher and a per-guard kill switch;
    bash under the node entry point; port behavior, not the local Python.
  • The domain map is derived from /harness-ops:machine-profile and is machine-local: it never sits in a tracked
    file, fixture or doc. Placeholders only.
  • Fail open on any internal error; every exit is 0 with the decision in stdout JSON.
  • The guard reads command text: a deterrent, not a sandbox. Declared gaps: computed paths, scripts run by name.

Key interfaces

  • plugins/guardrails/hooks/block-cross-domain.sh and plugins/guardrails/hooks/block-cross-domain.test.sh, the Bash|PowerShell row of plugins/guardrails/hooks/hooks.json,
    plugins/guardrails/README.md, docs/conventions/hook-precision, docs/conventions/hook-budget.

Done when

  • A setup test feeds a machine-profile fixture with two domains and finds a map with both domains' roots and gh_config_dir in a temp CLAUDE_PLUGIN_DATA.
  • The test asserts no file under the repository checkout changed.
  • grep -n "identity-domains" plugins/guardrails/skills/setup/SKILL.md prints the step.
  • git grep -nE "melodic|kyle|sexton" -- plugins/guardrails/hooks/block-cross-domain.sh plugins/guardrails/hooks/block-cross-domain.test.sh prints nothing (placeholders only).
  • scripts/run-test-file.sh plugins/guardrails/hooks/run-guards.test.sh exits 0, including the guardrails: Bash|PowerShell PreToolUse row takes 30+s on a ~70 KB command; its 60s timeout fails open #4528 long-command ceiling case.
  • The PR reports the Bash|PowerShell row's added time, measured as docs/conventions/hook-budget describes, inside that budget.
  • scripts/check-changelog-fragments.sh --check-required origin/main exits 0.

Activity

  1. added
    status: ready
    on Oct 24, 2026
  2. added
    area: security
    on Oct 24, 2026
  3. melodic-automation-lanes commented on Oct 24, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane yet: blocker #9743 is not closed as completed by a listed human or a merge.

  4. added
    admission-deferred
    agent-ready
    and removed
    admission-deferred
    on Oct 24, 2026
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

    agent-readyarea: securitystatus: ready

    Fields

    No fields configured for Feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions