> ## 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

Function

> This function is defined in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) 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

**host** `str` *required*

Host/IP address to check

### Returns

**Returns** `bool`

True if the host is a loopback address

## 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)
* [`resolve_ingress_attribution`](../functions/resolve_ingress_attribution)

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L2638)
>
> `praisonaiagents/gateway/protocols.py` at line 2638


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.