***

title: should_allow_host
slug: /reference/python/agents/configuration/security-config/should-allow-host
description: Check if a host is in the allowed hosts list.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Check if a host is in the allowed hosts list.

## **Parameters**

<ParamField path="host" type="str" required={true} toc={true}>
  The hostname to check.
</ParamField>

## **Returns**

`bool` -- `True` if the host is allowed (or if `allowed_hosts` contains `"*"`).

## **Example**

```python {5-6}
from signalwire.core.security_config import SecurityConfig

security = SecurityConfig()
security.allowed_hosts = ["agent.example.com", "api.example.com"]
print(security.should_allow_host("agent.example.com"))  # True
print(security.should_allow_host("evil.example.com"))   # False
```