Skip to main content

Connecting a HackerAI Agent to Your Local Machine

A simple guide for enabling local command execution from HackerAI.

HackerAI lets you connect your machine to Agent Mode. Once linked, you can run commands on your device—useful for local tooling, automation, and testing assets on your machine.

Available on eligible plans, including Free where available. Account and regional access requirements still apply. If HackerAI asks you to choose a subscription before starting a task, connecting a local machine does not bypass that requirement.


What the local client does

The HackerAI Local Client (@hackerai/local) opens a secure connection between your computer and HackerAI. While it's running, Agent Mode can:

  • Execute terminal commands on your computer in real time

  • Use your machine's visibility for scanning and testing (subject to your OS and permissions)

Commands run directly on your host OS—there is no container isolation layer in the current client.

There are two ways to connect: the Desktop App (easiest) or the CLI client.


Option A: Desktop App (Recommended)

1. Download the HackerAI Desktop App

2. Sign In

Open the app and sign in with your HackerAI account. The connection is established automatically once you're authenticated—no token or manual setup needed.

3. Select Local

The app defaults to Cloud execution. To run commands on your machine, switch from Cloud to Local using the sandbox selector in the chat input area, or under Settings → Agents → Default execution environment.


Option B: Remote Control (CLI Client)

1. Copy the Connect Command

  1. Log in to HackerAI.

  2. Open Settings (from the sidebar or your account menu).

  3. Open the Remote Control tab.

  4. Click Copy connect command. HackerAI generates the connection token automatically; there is no separate Generate Token button.

The copied command includes a connection token. Keep it private and run the command only on a machine you trust.

Copy connect command reuses the existing connection token. Copying again does not rotate it or automatically create a new token. Use Reset token only when you need to replace it, such as after accidental disclosure; resetting stops existing connections, so copy and run the updated command afterward. Never paste a connection token into a support conversation or public report.

2. Run the Copied Command

Command format (for reference; use the copied command)

npx @hackerai/local@latest --token YOUR_TOKEN

Or install globally:

npm install -g @hackerai/local

hackerai-local --token YOUR_TOKEN

3. Troubleshooting the connection command

YOUR_TOKEN is a placeholder, not a usable connection token. Do not run example commands unchanged. Run the complete command copied from Settings → Remote Control on your own computer. If you see Invalid token after entering a sample value, use the copied command containing your actual token instead. The examples are not shared login credentials.

If Windows says npx is not recognized, Node.js/npm may be missing from that terminal’s PATH. Install Node.js from its official source if needed, then close and reopen your terminal and check node --version, npm --version, and npx --version. Having Node.js installed does not by itself prove the current terminal can find npx. When installing globally, run npm install -g @hackerai/local first; run hackerai-local with your own token as a separate command after installation succeeds. Never combine the install and connection commands on one line without an appropriate command separator.

4. Select Your Machine

Once connected, switch to your machine under the Remote control section using the sandbox selector in the chat input area, or under Settings → Agents → Default execution environment.
​

5. Options

Option

Description

--token TOKEN

Required authentication token

--help, -h

Show help message


Security Overview

  • Commands run on your OS without isolation. Only run the client (app or CLI) on machines you trust and control.

  • The client exits automatically after about 1 hour of inactivity to reduce long-lived sessions.

  • The Desktop App will show a disconnected status but can be reconnected with one click.

If antivirus software blocks a HackerAI download, leave the file blocked and contact support with the detection name, operating system, and download URL. Do not disable antivirus, add an exclusion, or run the blocked file while it is being checked. An alert alone does not establish whether a file is malicious or a false positive. The Local Client’s ability to run commands is not proof of what caused a detection, and switching to the CLI does not prove the blocked installer is safe.

Did this answer your question?