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

# Resolve Auth Mode • AI Agent SDK

> resolve_auth_mode: Resolve authentication mode based on bind host and explicit configuration.

# resolve\_auth\_mode

Function

> This function is defined in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

Resolve authentication mode based on bind host and explicit configuration.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def resolve_auth_mode(bind_host: str, configured: Optional[AuthMode]) -> AuthMode
```

## Parameters

**bind\_host** `str` *required*

Host/IP that the service is bound to

**configured** `Optional[AuthMode]`

Explicitly configured auth mode (takes precedence)

### Returns

**Returns** `AuthMode`

The resolved authentication mode

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
>>> resolve_auth_mode("127.0.0.1")
    'local'
    >>> resolve_auth_mode("0.0.0.0")  
    'token'
    >>> resolve_auth_mode("127.0.0.1", "token")
    'token'
```

## Uses

* `is_loopback`

## Source

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


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