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

# Is Loopback • AI Agent SDK

> is_loopback: Check if a host is a loopback interface.

# is\_loopback

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**protocols**](../modules/protocols) module.

Check if a host is a loopback interface.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def is_loopback(host: str) -> bool
```

## Parameters

<ParamField query="host" type="str" required={true}>
  Host/IP address to check
</ParamField>

### Returns

<ResponseField name="Returns" type="bool">
  True if the host is a loopback address
</ResponseField>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
>>> is_loopback("127.0.0.1")
    True
    >>> is_loopback("localhost") 
    True
    >>> is_loopback("::1")
    True
    >>> is_loopback("0.0.0.0")
    False
    >>> is_loopback("192.168.1.1")
    False
```

## Uses

* `ipaddress.ip_address`

## Used By

* [`resolve_auth_mode`](../functions/resolve_auth_mode)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L1952">
  `praisonaiagents/gateway/protocols.py` at line 1952
</Card>
