> 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/docs/docs-ja/zen-firewall/zen-installation-instructions/configuration-via-environment-variables.md).

# 環境変数による設定

## トークン <a href="#token" id="token"></a>

次を使用してください `AIKIDO_TOKEN` Aikidoで生成したトークンを設定するための環境変数:

```bash
AIKIDO_TOKEN="token"
```

## ブロックモード <a href="#blocking-mode" id="blocking-mode"></a>

次を使って `AIKIDO_BLOCK` ブロッキングモードを有効にするための環境変数。

```bash
AIKIDO_BLOCK="true"
```

> ダッシュボードでブロッキングモードと検知のみモードを切り替えることもできます。環境変数は初期モードとして使用されます。設定が取得されると、Zenはダッシュボードで設定されたモードに切り替わります。

## エージェントを無効化 <a href="#disable-the-agent" id="disable-the-agent"></a>

次を使って `AIKIDO_DISABLE` Zenを完全に無効化するための環境変数。万が一Zenが問題を起こした場合でも、コードや環境変数を削除せずにZenを無効にできます（例: `AIKIDO_TOKEN` など）。

```bash
AIKIDO_DISABLE="true"
```

## デバッグ <a href="#debugging" id="debugging"></a>

次を使って `AIKIDO_DEBUG` より多くの情報を出力するための環境変数:

* 特定のパッケージがサポートされているかどうか
* トークンが検出されたかどうか
* Zenが検知のみモードで実行されているかどうか

```bash
AIKIDO_DEBUG="true"
```

## プロキシ設定 <a href="#proxy-settings" id="proxy-settings"></a>

次を使って `AIKIDO_TRUST_PROXY` のための環境変数 [プロキシを信頼する](/docs/docs-ja/zen-firewall/zen-installation-instructions/proxy-load-balancer-settings.md):

> デフォルトでは、trust proxy は **有効です**.

```bash
AIKIDO_TRUST_PROXY="false"
```

## インスタンス名の上書き <a href="#limit-api-discovery-samples" id="limit-api-discovery-samples"></a>

`AIKIDO_INSTANCE_NAME` アプリケーションインスタンスにカスタム名を設定します。ホスト名だけでは十分に判別できない場合（たとえば、コンテナ化された環境や一時的な環境）に便利です。デフォルトはホスト名です。

```bash
AIKIDO_INSTANCE_NAME="custom-name"
```

## API探索サンプル数の制限 <a href="#limit-api-discovery-samples" id="limit-api-discovery-samples"></a>

ルートごとに収集されるリクエストサンプル数を制限します。各サンプルには次が含まれます:

* リクエスト本文の構造と型（GraphQL以外のリクエストの場合）
* クエリパラメータ
* 使用された認証方法

これらのサンプルは、想定されるリクエスト形式や認証要件を含め、APIの構造を分析・文書化するのに役立ちます。

```bash
AIKIDO_MAX_API_DISCOVERY_SAMPLES="10"
```

## 最大リクエスト本文サイズ（Node.js） <a href="#maximum-request-body-size-nodejs" id="maximum-request-body-size-nodejs"></a>

受信するHTTPリクエスト本文の最大サイズ（MB）を設定します。この制限により、非常に大きなリクエストによるメモリ枯渇からアプリケーションを保護できます。

```bash
AIKIDO_MAX_BODY_SIZE_MB="10" # MB
```


---

# 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/docs/docs-ja/zen-firewall/zen-installation-instructions/configuration-via-environment-variables.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.
