Skip to content

[v1.1] SSH key injection for private repository access #24

Description

@frankbria

Problem

E2B sandboxes cannot clone or access private repositories because SSH keys are not available in the sandbox environment.

Use Case

  • Projects with private npm packages
  • Monorepos with private submodules
  • Teams using private GitHub/GitLab repositories

Proposed Solution

CLI Flag

parallel-cc sandbox-run --repo . --prompt "Task" \
  --ssh-key ~/.ssh/id_ed25519

Implementation

  1. Read SSH key file content (with user confirmation)
  2. Create ~/.ssh directory in sandbox
  3. Write private key with correct permissions (600)
  4. Add known hosts entries for common providers
  5. Optionally configure ~/.ssh/config

Security Considerations

  • Never log SSH key contents
  • Warn user before transmitting key to sandbox
  • Clear key from sandbox after execution
  • Support SSH_AUTH_SOCK forwarding as alternative (if E2B supports)

Files to Modify

  • src/cli.ts - Add --ssh-key flag
  • src/e2b/sandbox-manager.ts - SSH key injection
  • src/e2b/file-sync.ts - Exclude .ssh from normal sync

Acceptance Criteria

  • SSH key can be injected via CLI flag
  • Private repository access works in sandbox
  • Security warnings displayed appropriately
  • Key cleaned up after execution
  • Documentation includes security guidance

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions