Skip to main content

Connecting a HackerAI Agent to Your Local Machine

A simple guide for enabling local command execution from HackerAI.co

Updated over 2 weeks ago

HackerAI allows you to link your local machine or network directly to the web platform through Agent Mode. After connecting, you can run commands on your own device from inside HackerAI β€” including using penetration-testing tools, automating workflows, or interacting with internal network assets.

This capability is available on all paid plans.


What the Local Agent Does

The HackerAI Local Sandbox Client (@hackerai/local) creates a secure connection between your device and HackerAI. Once running, Agent Mode can:

  • Execute terminal commands on your computer

  • Use local network visibility for scanning and testing

  • Run a pre-built penetration-testing environment (Docker mode)

  • Optionally run directly on your host OS (Dangerous Mode)


1. Get Your Token

1. Log into HackerAI

2. Open the sidebar

3. Go to Settings β†’ Agents

4. Generate or copy your Agent Token

This token links your local machine to your account.


2. Install and Start the Local Agent

Quick Start (recommended)

npx @hackerai/local@latest --token YOUR_TOKEN

Or install globally:

npm install -g @hackerai/local

hackerai-local --token YOUR_TOKEN

3. Usage Examples

Basic Docker Mode (default)

npx @hackerai/local@latest --token hsb_abc123 --name "My Laptop"
  • This downloads the ~4GB HackerAI sandbox image, which includes a full Kali-based pentesting environment with tools such as:

    • nmap, masscan, sqlmap, ffuf, gobuster, nuclei, hydra, nikto, wpscan, subfinder, httpx, bloodhound, hashcat, and more.

Using Your Own Docker Image

npx @hackerai/local@latest --token hsb_abc123 --name "Kali" --image kalilinux/kali-rolling

Dangerous Mode (No Docker)

npx @hackerai/local@latest --token hsb_abc123 --name "Work PC" --dangerous

Warning: Dangerous Mode runs commands directly on your OS without isolation. Use only if you trust the workload.


4. Options

Option

Description

--token TOKEN

Required authentication token

--name NAME

Name shown in HackerAI

--image IMAGE

Custom Docker image (default: `hackerai/sandbox`)

--dangerous

Direct host OS execution

--help, -h

Show help message


Security Overview

  • Docker Mode (recommended):

    • Commands run inside an isolated container, but retain host-network access for scanning.

  • Dangerous Mode:

    • Runs commands directly on your machine with no isolation.

Choose the mode that matches your security needs.

Did this answer your question?