---
title: "overlane egress check"
description: "Ask whether a host may be reached; exits 6 when the allowlist denies it"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.overlane.app/llms.txt
> Use this file to discover all available pages before exploring further.

# overlane egress check

{/* Generated by apps/docs/scripts/generate.mjs (CLI pages from the command registry in packages/cli). Do not edit; run `pnpm --filter @overlane/docs gen`. */}

Evaluates a host and port against the project's policy and records the answer. Raw IP addresses in any notation, cloud metadata services and internal names are denied whatever the rules say. In report mode a host with no rule is allowed and marked reported.

## Usage

```sh
overlane egress check --host HOST [--port N] [--task TASK] [--dry-run]
```

## Flags

| Flag | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `--host` | string | yes |  | The host name to check |
| `--port` | string | no |  | The port (default 443) |
| `--task` | string | no |  | The task asking, for the record |
| `--dry-run` | boolean | no |  | Print the requests and file changes this command would make, then stop. Needs no credentials. |

## Examples

```sh
overlane egress check --host registry.npmjs.org
overlane egress check --host 169.254.169.254
```

## Behavior

- Effect: `write` (changes local or hosted state).
- Needs credentials: yes. Uses the network: yes.
- Supports `--dry-run`: yes. Accepts `--force`: no.
- Machine-readable description: `overlane schema egress check`.

## Result

With `--json` (the default when stdout is not a terminal) the command prints this JSON Schema's shape on stdout.

```json
{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "outcome": {
          "type": "string",
          "enum": [
            "allowed",
            "denied",
            "reported"
          ]
        },
        "allowed": {
          "type": "boolean"
        },
        "reason": {
          "type": "string",
          "enum": [
            "rule_match",
            "no_rule",
            "port_not_allowed",
            "report_only",
            "invalid_host",
            "raw_ip",
            "metadata",
            "internal_name",
            "private_address"
          ]
        },
        "host": {
          "type": "string"
        },
        "port": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "rule": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "eventId": {
          "type": "string"
        }
      },
      "required": [
        "outcome",
        "allowed",
        "reason",
        "host",
        "port",
        "rule",
        "message",
        "eventId"
      ],
      "additionalProperties": {}
    },
    {
      "type": "object",
      "properties": {
        "dryRun": {
          "type": "boolean",
          "const": true
        },
        "service": {
          "type": "string"
        },
        "requests": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string"
              },
              "path": {
                "type": "string"
              },
              "body": {},
              "note": {
                "type": "string"
              }
            },
            "required": [
              "method",
              "path"
            ],
            "additionalProperties": false
          }
        },
        "commands": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "writes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string"
              },
              "action": {
                "type": "string",
                "enum": [
                  "write",
                  "append",
                  "delete"
                ]
              },
              "description": {
                "type": "string"
              }
            },
            "required": [
              "path",
              "action",
              "description"
            ],
            "additionalProperties": false
          }
        },
        "notes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "dryRun",
        "requests",
        "commands",
        "writes",
        "notes"
      ],
      "additionalProperties": false
    }
  ]
}
```

See [exit codes](/cli/#exit-codes) for the status the process returns.

Source: https://docs.overlane.app/cli/egress-check/index.mdx
