name: ssh-key-mounting
status: implemented
priority: high
created_at: 2026-05-28
updated_at: 2026-05-29
labels:
  - feature
  - ssh
  - instances
stories:
  - title: Select SSH keys when creating/starting instances
    description: |
      Add ssh_key_ids to ToolInstance so users can select multiple SSH keys
      from a list when creating or starting a tool instance. Selected keys
      are mounted into the container user's home directory (~/.ssh).
    acceptance_criteria:
      - ToolInstance model has nullable ssh_key_ids JSON column
      - create_instance endpoint accepts ssh_key_ids list
      - start_instance endpoint accepts ssh_key_ids override
      - start_instance mounts all selected SSH keys to {home_dir}/.ssh
      - Frontend CreateSessionForm shows multi-select SSH key checkboxes
      - Frontend instance-list shows SSH key multi-select for start/restart
      - SSH keys are validated (existence, user ownership) before mounting
    tests:
      - unit: test_tool_instances_legacy.py (existing baseline)
      - integration: manual verification of mount behavior
    estimated_effort: small
