Skip to content

fix(mcp): accept valid SSH destinations in file-based policies #262

Closed

Description

@abruption

What happened

Priority: P1. In session-peer 1.0.3, a valid SSH destination in a file-based MCP policy is rejected during startup/policy loading.

load_policy() calls core.check_ssh_argument(host, "host"), but the current validator only treats "--host" as a destination flag. Other flag values are sent to the SSH-option validator, so valid destinations are interpreted as options.

Source:

A minimal policy using dummy values:

{"schemaVersion":1,"destinations":{"web":{"host":"user@web-01","agents":["claude"],"capabilities":["list"]}}}

Loading this actual synthetic policy file fails with:

unsupported --ssh-opt; only connection options are allowed

user@web-01, web-01, and [::1] all fail through the loader, while the same values pass check_ssh_argument(value, "--host").

What you expected

Valid SSH policies should load without weakening the SSH option allowlist. Local-only policies should remain unchanged.

Environment

  • Baseline: published Python session-peer 1.0.3; source snapshot 817d92ab780f657ec754d40fcf86087b5b01a883.
  • Comparison with v1.0.2 confirms a regression: the MCP call site is unchanged, but SSH argument validation changed.
  • Validation: macOS arm64, Python 3.13.7, real file-based policy loading plus synthetic host variants.
  • No SSH connection, agent submission, service change, or live MCP transport test was performed.

Discovery output

Not applicable: failure occurs during policy loading, before discovery or submission.

Proposed fix and acceptance criteria

  • Pass the canonical host flag "--host" from the MCP loader.
  • Add positive tests that load actual policy files for valid remote Claude/Codex destinations; do not only construct Adapter directly.
  • Cover hostname, user@host, and IPv6 destination forms accepted by the core validator.
  • Retain rejection of leading options, whitespace/shell syntax and disallowed SSH options.
  • Preserve local policy and configured Codex home behaviour.

Checked

  • Searched existing issues and open PRs; no matching open fix found.
  • Removed sensitive information; values above are synthetic.
  • SSH connectivity and native inbound approval checks are not applicable to this pre-connection loader regression.

Activity

  1. added this to the v1.0.4 milestone on Oct 7, 2026
  2. added
    bug
    on Oct 7, 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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions