> For the complete documentation index, see [llms.txt](https://ai-security-docs.akto.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-security-docs.akto.io/akto-argus-agentic-ai-security-for-homegrown-ai/agentic-red-teaming/how-to/install-testing-module-in-your-cloud.md).

# Install Scanning module in your Cloud

## Overview

Red Teaming Modules involves sending malicious agentic requests to your (staging) server. By default, these malicious scanning requests are sent from the Red Teaming module installed within Akto Cloud.

There could be multiple reasons why you'd want to install probing module within your Cloud.

1. Whitelisting Akto's IP in Security Group or WAF isn't an option
2. The staging server isn't reachable from public domain
3. The WAF would block most requests (or block Akto's IP)
4. The Agentic component domain isn't resolvable from public domain
5. The Agentic component is completely internal

## Copy the JWT Token

1. Login to Akto dashboard at [app.akto.io](https://app.akto.io)
2. Go to **Connectors** in the left nav.
3. Open the **Setup Guardrail** card and copy your token (also referred to as the database abstractor token in later steps).

You then have to use a Linux VM or a Helm chart to install Akto AI Red Teaming module in your cloud.

## Setup with Helm Chart

{% stepper %}
{% step %}
**Add the Akto Helm Repository**

Run the following commands to add and update the Akto Helm repo:

```bash
helm repo add akto https://akto-api-security.github.io/helm-charts
helm repo update
```

{% endstep %}

{% step %}
**Install the Chart**

Replace `<key>` with your **Anthropic API Key** and `<token>` with the **Database Abstractor Token** copied from [#copy-the-jwt-token](#copy-the-jwt-token "mention"), then pick one of the following installation options.

1. Directly using the key and token

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">helm install akto-mini-testing akto/akto-mini-testing \
     --set testing.agentTesting.enabled=true \
     --set testing.agentTesting.env.anthropicApiKey="&#x3C;key>" \
     --set testing.aktoApiSecurityTesting.env.databaseAbstractorToken="&#x3C;token>"
   </code></pre>
2. Storing the key and token in Kubernetes Secrets

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">helm install akto-mini-testing akto/akto-mini-testing \
     --set testing.agentTesting.enabled=true \
     --set testing.agentTesting.env.useSecretsForAnthropicApiKey=true \
     --set testing.agentTesting.env.anthropicApiKeySecrets.anthropicSecretKey="&#x3C;key>" \
     --set testing.aktoApiSecurityTesting.env.useSecretsForDatabaseAbstractorToken=true \
     --set testing.aktoApiSecurityTesting.env.databaseAbstractorTokenSecrets.token="&#x3C;token>"
   </code></pre>
3. Bringing your own existing Secrets

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">helm install akto-mini-testing akto/akto-mini-testing \
     --set testing.agentTesting.enabled=true \
     --set testing.agentTesting.env.useSecretsForAnthropicApiKey=true \
     --set testing.agentTesting.env.anthropicApiKeySecrets.existingSecret=&#x3C;my-anthropic-secret> \
     --set testing.aktoApiSecurityTesting.env.useSecretsForDatabaseAbstractorToken=true \
     --set testing.aktoApiSecurityTesting.env.databaseAbstractorTokenSecrets.existingSecret=&#x3C;my-db-token-secret>
   </code></pre>

   Each existing secret must be of type `Opaque` and store its value under a key named `token`.

{% hint style="warning" %}
**Anthropic API Key Required**

You **must** provide your actual **Anthropic API Key** and the **Database Abstractor Service Token (JWT)**, either directly or via a Kubernetes Secret.
{% endhint %}
{% endstep %}
{% endstepper %}

## Setup Linux VM

{% stepper %}
{% step %}
**Provision a New VM**

Minimum recommended configuration:

* **Platform**: Amazon Linux 2023
* **CPU:** 2 vCPUs
* **Memory:** 4 GB RAM
* **Disk:** 20 GB

{% hint style="warning" %}
Don’t use burstable instances.
{% endhint %}

* **Network**:
  * Private subnet
  * connectivity to internet (typically via NAT)
  * connectivity to your staging service
* **Security groups**
  * Inbound - Open only port 22 for SSH
  * Outbound - Open all
    {% endstep %}

{% step %}
**SSH into the VM**

1. SSH into this new instance in your Cloud
2. Run the following command:

   ```bash
   sudo su -
   ```

{% endstep %}

{% step %}
**Install Docker & Docker Compose**

Install the [docker](https://github.com/akto-api-security/infra/blob/feature/quick-setup/get-docker.sh) and [docker-compose](https://github.com/akto-api-security/infra/blob/feature/quick-setup/get-docker-compose.sh).
{% endstep %}

{% step %}
**Create the Environment File**

1. Create:

   ```bash
   nano docker-agentic-testing.env
   ```
2. Add the following:

   ```dotenv
   ANTHROPIC_API_KEY=<key>
   NODE_ENV=production
   PORT=5500
   AGENTIC_MODE=false
   NODE_TLS_REJECT_UNAUTHORIZED=0
   USE_SESSION_MANAGEMENT=true

   ```

{% hint style="warning" %}
**Anthropic API Key Required**

You **must** replace your actual **Anthropic API Key** in the env file.
{% endhint %}

You can also reference the original template is [here](https://github.com/akto-api-security/infra/blob/feature/quick-setup/docker-agentic-testing.env).
{% endstep %}

{% step %}
**Create the Docker Compose File**

1. Create:

   ```bash
   nano docker-compose-mini-testing-agentic.yml
   ```

{% hint style="danger" %}
**Important Requirements**

* You must replace `<your-database-abstractor-token>` with the actual **Database Abstractor Service Token (JWT)** copied from the Step 3 of [#copy-the-jwt-token](#copy-the-jwt-token "mention").
* Ensure **both files** below are in the **same directory**:
  * `docker-compose-mini-testing-agentic.yml`
  * `docker-agentic-testing.env`
    {% endhint %}

2. Add the following configuration:

```yml
version: '3.8'
services:
  agent-testing:
    container_name: agent-testing
    image: public.ecr.aws/aktosecurity/akto-agentic-testing:latest
    ports:
      - "5500:5500"
    env_file:
      - ./docker-agentic-testing.env
    restart: always

  akto-api-security-testing:
    image: public.ecr.aws/aktosecurity/akto-api-security-mini-testing:latest
    container_name: akto-api-security-testing
    environment:
      RUNTIME_MODE: hybrid
      DATABASE_ABSTRACTOR_SERVICE_TOKEN: <token>
      PUPPETEER_REPLAY_SERVICE_URL: "http://akto-puppeteer-replay:3000"
      MINI_TESTING_NAME: "akto-testing-module"
      AGENT_BASE_URL: "http://agent-testing:5500"
    ports:
      - "8001:8001"
    restart: always

  akto-api-security-puppeteer-replay:
    image: public.ecr.aws/aktosecurity/akto-puppeteer-replay:latest
    container_name: akto-puppeteer-replay
    ports:
      - "3000:3000"
    environment:
      NODE_ENV: production
    restart: always

  watchtower:
    image: containrrr/watchtower
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      WATCHTOWER_CLEANUP: true
      WATCHTOWER_POLL_INTERVAL: 1800
    labels:
      com.centurylinklabs.watchtower.enable: "false"
```

For the reference,the original template is [here](https://github.com/akto-api-security/infra/blob/feature/quick-setup/docker-compose-mini-testing-agentic.yml).
{% endstep %}

{% step %}
**Start the Scanning Module**

* Run:

  ```bash
  docker-compose -f docker-compose-mini-testing-agentic.yml up -d
  ```
* Run the following command to ensure Docker starts up in case of instance restarts:

  ```bash
  systemctl enable /usr/lib/systemd/system/docker.service
  ```

{% endstep %}
{% endstepper %}

## Get Support for your Akto setup

There are multiple ways to request support from Akto. We are 24X7 available on the following:

1. In-app `intercom` support. Message us with your query on intercom in Akto dashboard and someone will reply.
2. Join our [discord channel](https://www.akto.io/community) for community support.
3. Contact `support@akto.io` for email support.
4. Contact us [here](https://www.akto.io/contact-us).
