> 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/connectors/others/api-gateways/mulesoft-flex.md).

# Connect Akto with Mulesoft Flex Gateway

Learn about how to send agent traffic data using Mulesoft Flex Policy to Akto from your environment.

<figure><img src="https://3128331180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftog5ODwYfqPOf4eQhsOC%2Fuploads%2Fgit-blob-247b729489babb882c1db4f03d6f88a989d6a42b%2Fimage%20(2)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

## Connect Akto with Mulesoft Flex Gateway

### Setup Akto Runtime and Data Ingestion Service

Follow these steps to add setup Akto Runtime and Data Ingestion Service -

1\. SSH into the instance where you want to deploy the above Akto services

2\. Run the following commands to download docker compose and env files

```
wget https://raw.githubusercontent.com/akto-api-security/infra/refs/heads/feature/quick-setup/docker-compose-data-ingestion-runtime.yml
wget https://raw.githubusercontent.com/akto-api-security/infra/refs/heads/feature/quick-setup/docker-mini-runtime.env
wget https://raw.githubusercontent.com/akto-api-security/infra/refs/heads/feature/quick-setup/data-ingestion-docker.env
wget https://raw.githubusercontent.com/akto-api-security/infra/refs/heads/feature/quick-setup/watchtower.env
```

3\. Modify ${AKTO\_KAFKA\_IP} in docker-compose-data-ingestion-runtime.yml with the ip of your instance on which runtime will be deployed

4\. Go to <https://app.akto.io>, and create your akto account. Login into your Account

5\. Go to **Connectors** in the left nav.

6\. Open the **Setup Guardrail** card and copy your token.

7\. Replace the token string with the copied value in the docker-mini-runtime.env file.

```plaintext
DATABASE_ABSTRACTOR_SERVICE_TOKEN=token
```

8\. Run `docker-compose -f docker-compose-data-ingestion-runtime.yml -d`

9\. Make sure this instance is reachable from the instances where your applications are hosted, on which policy will be applied

## Connect Akto with Mulesoft Flex Gateway

### Setup Flex Policy

1\. Follow PDK Prerequisites on the Mulesoft documentation site, and setup the basic requirements

2\. Initialise a new project `anypoint-cli-v4 pdk policy-project create --name <my-custom-policy>`

3\. Clone the [repo](https://github.com/akto-api-security/mulesoft-policy).

4\. Copy content of gcl.yaml, lib.rs, Corgo.toml files, and paste these files in your project at respective locations.

5\. Compile the project by running

```
make build-asset-files
cargo build
make build
```

6\. Publish the policy to mulesoft exchange by running `make publish`

7\. Select your Agentic components on which you want to apply Akto Policy.

8\. Copy the instance ip where Akto Runtime was deployed, and replace \<url> in the below string and use it as input param `ingestionUrl` to the policy

`https://<url>:9091/api/ingestData`

<figure><img src="https://3128331180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftog5ODwYfqPOf4eQhsOC%2Fuploads%2Fgit-blob-1bbad7a43ae63ec570271693eb6778bc9bc30305%2FIngestionUrl.png?alt=media" alt=""><figcaption></figcaption></figure>
