# validate_backend_route

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/extensions/hosting/validate_backend_route)

Reject a backend route that violates host storage boundaries.

The sandbox check is deliberately shallow. Wrapping a filesystem backend
in another `BackendProtocol` implementation changes who owns that safety
contract, so dcode does not inspect arbitrary backend object graphs.

## Signature

```python
validate_backend_route(
    item: RegisteredUnit[Any],
    protected_routes: Collection[str],
    *,
    sandbox_active: bool,
) -> None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `item` | `RegisteredUnit[Any]` | Yes | Backend route registration to validate. |
| `protected_routes` | `Collection[str]` | Yes | Internal route prefixes unavailable to extensions. |
| `sandbox_active` | `bool` | Yes | Whether the default execution backend is sandboxed. |

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/4bfa52000ef65ac623d8ada0cb67f67cbdd663ea/libs/code/deepagents_code/extensions/hosting.py#L114)