Skip to content

feat(execution): SSH tool execution with connection management and approval routing (PR1)#360

Draft
esafwan wants to merge 4 commits into
feature/python-code-executionfrom
feature/ssh-tool-execution
Draft

feat(execution): SSH tool execution with connection management and approval routing (PR1)#360
esafwan wants to merge 4 commits into
feature/python-code-executionfrom
feature/ssh-tool-execution

Conversation

@esafwan

@esafwan esafwan commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

SSH tool execution (PR1)

Draft PR — stacked on feature/python-code-execution @ d924ba5 (itself stacked on tridz-dev/huf#298 / feature/huf-design-system). Merge only after the base lands.

What

First-class SSH execution for Huf agents, per docs/ssh-execution-pr1.md:

  • SSH Connection + Agent SSH Connection DocTypes — encrypted secret storage, host-key pinning with strict verification, whitelisted test/enroll/rotate actions with mocked controller coverage.
  • Agent-side allowlistingallow_ssh + ssh_connections; tool registry gates SSH execution on capability, agent flag, and allowlisted+enabled connections.
  • Executor — Paramiko-based one-shot remote command execution (no PTY), bounded connect/exec timeouts, bounded+truncated stdout/stderr, secret redaction.
  • Approvals & audit — approval routing generalized across code_execution and ssh_exec; SSH approvals require the ssh.approve capability (Python execution stays on execution.approve).
  • Frontend — React agent form advanced settings: SSH enablement + allowlisted-connection multi-select. Admin credential/host-key management is the Desk SSH Connection DocType UI (PR1 deliberately ships no standalone React management page).

Deferred (per PR1 contract)

Interactive PTY sessions, terminal input streaming, shared shell state, first-class durable jobs (see docs/ssh-execution-pr1.md for the tmux/Docker/systemd operator pattern and the PR2/PR3 roadmap).

Verification

  • Frontend: npm run typecheck + npm run build green.
  • Live docker bench (huf-ssh.localhost, fresh site + install-app huf + bench migrate):
    • huf.huf.doctype.ssh_connection.test_ssh_connection ✅ (7)
    • huf.huf.doctype.agent.test_agent_ssh ✅ (4)
    • huf.ai.tests.test_tool_registry_ssh ✅ (6)
    • huf.huf.doctype.agent_execution_approval.test_agent_execution_approval ✅ (8)
    • huf.ai.tests.test_ssh_execution ✅ (15 — gating, secret redaction, host-key rejection, exec/idle timeouts, output truncation)

Known limitations

Deferred PR1 items (truncated-output success semantics, Killed/Timeout labeling, no remote signal on kill, non-atomic Redis concurrency slot) are documented in docs/ssh-execution-pr1.md.

Tracked in Tracks/ResearchExec/ongoing/ssh-implementation/{STATUS,TODO}.md.

esafwan added 4 commits July 12, 2026 10:10
…proval routing (PR1)

- SSH Connection + Agent SSH Connection DocTypes with encrypted secrets,
  host-key pinning, and test/enroll/rotate whitelisted actions
- Agent-side allowlisting (allow_ssh + ssh_connections) with registry gating
- Paramiko-based one-shot remote execution (no PTY) with bounded timeouts
  and output limits; approval routing generalized across code_execution
  and ssh_exec with execution-kind-specific approver capabilities
  (ssh.approve vs execution.approve)
- React agent form: SSH enablement + allowlisted-connection multi-select
  in advanced settings; Desk DocType UI is the PR1 admin surface
- PR1 scope/contract doc: docs/ssh-execution-pr1.md

Stacked on feature/python-code-execution (d924ba5).
…; honor per-call output limits in result truncation
…c clock, JSON field parsing); document PR1 known limitations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant