> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/~/revisions/zVer63pN7HO83qF6ZCQx/code-scanning/aikido-malware-scanning.md).

# Aikido Safe Chain - Prevent Malware Installs

Protect your projects from hidden threats like malicious code and malware by integrating Aikido into your workflow. As you install node packages, Aikido scans for risks such as obfuscated code, data theft attempts, sneaky install scripts, and crypto miners, all without interrupting your command. Picture it as a safety net wrapped around `npm` and other package managers,  ensuring safer operations.

<figure><img src="/files/sjXQhcAEXThgmivhuIja" alt=""><figcaption></figcaption></figure>

**Why It Matters:**

* **Threats Covered:** Aikido blocks access to potentially harmful packages by identifying suspicious activities like data exfiltration or unwanted scripts during setup.
* **Peace of Mind:** Get instant protection without complex changes, helping you catch issues early and keep your dependencies clean.

## Installation <a href="#ide-recommended" id="ide-recommended"></a>

Installing the Aikido Safe Chain is easy, just follow these steps:<br>

{% stepper %}
{% step %}
Install the Aikido Safe Chain package globally using npm

```bash
npm install -g @aikidosec/safe-chain
```

{% endstep %}

{% step %}
Setup the shell integration by running following command

```
safe-chain setup
```

{% hint style="warning" %}
If the command above fails with command not found use `npm list -g safe-chain` to find the correct path, and run again with `/path/to/lib/safe-chain setup`
{% endhint %}
{% endstep %}

{% step %}
**❗**&#x52;estart your terminal to start using the Aikido Safe Chain

This step is crucial as it ensures that the shell aliases for npm, npx, yarn, pnpm and pnpx are loaded correctly. If you do not restart your terminal, the aliases will not be available.
{% endstep %}

{% step %}
Verify the installation by running following command

```
npm install safe-chain-test
```

The output should show that Aikido Safe Chain is blocking the installation of this package as it is flagged as malware.
{% endstep %}
{% endstepper %}

When running `npm`, `npx`, `yarn`, `pnpm` or `pnpx` commands, the Aikido Safe Chain will automatically check for malware in the packages you are trying to install. If any malware is detected, it will prompt you to exit the command.

{% hint style="info" %}
For more detailed instructions and configuration options, visit our documentation [@aikidosec/safe-chain](https://www.npmjs.com/package/@aikidosec/safe-chain)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/~/revisions/zVer63pN7HO83qF6ZCQx/code-scanning/aikido-malware-scanning.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
