# `Wardrik.Egress`

Decides which URLs users may point Wardrik at, such as when an org adds an MCP server.

    Wardrik.start_link(name: MyApp.AgentRuntime, egress: &Wardrik.Egress.public/1)

A URL is checked when it's given and when each connection to it starts, not on each request.
A host that resolves somewhere else between checks is reached where it resolves then.

# `any`

```elixir
@spec any(String.t()) :: :ok
```

Returns `:ok` for every URL. Use it when only the operator names URLs, as in a daemon.

# `public`

```elixir
@spec public(String.t()) :: :ok | {:error, String.t()}
```

Returns `:ok` if `url` is `https` and every address of its host is public. The default.

    Wardrik.Egress.public("https://10.0.0.5/mcp")
    #=> {:error, "10.0.0.5 is a private address"}

# `public?`

```elixir
@spec public?(:inet.ip_address()) :: boolean()
```

Returns whether `address` is public. Checks the IPv4 address inside IPv6 forms that wrap one.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
