~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Egress modes — what each one does
⚠️ Experimental. The egress boundary is new and ships as defense-in-depth, not an absolute guarantee. It aims to block known data-egress paths under the scope you pick (best effort, with known gaps listed under Strict below), but this is an early version — don't rely on it as your only protection for highly sensitive data yet. See the threat model and limitations linked just below.
LDR's egress scope (Settings → Egress Scope, or the Privacy & Egress panel on the research form) controls where your research traffic is allowed to go — which search engines run, whether your LLM/embeddings may be cloud services, and which URLs may be fetched. It's the single switch for "how much of this run is allowed to leave my machine?"
Pick a mode below. The default is Adaptive, which just follows your primary search engine, so most people never need to think about it.
This page explains the modes for everyday use. For the threat model, guarantees, and limitations, see
SECURITY.mdand the technical egress package README.
At a glance
| Mode | Search engines | LLM / embeddings | Best for |
|---|---|---|---|
| Adaptive (default) | follows your primary engine | forced local only when the run is private | "just do the sensible thing" |
| Unprotected | any engine (no restriction) | any provider (cloud allowed) | escape hatch — not recommended; disables egress protection (hard SSRF / cloud-metadata blocking still applies) |
| Public only | public web/academic engines (plus collections you marked public and document stores whose URL is not classified as private) | your configured providers (a document-store primary with a cloud model is normally refused at start, see Strict below) | public research; your private collections aren't touched |
| Private only | local engines only (collections, your library, local document stores such as Paperless or Elasticsearch) | forced local — cloud blocked | sensitive work; best-effort private-only (see below) |
| Strict | only your one primary engine | your configured providers, but cloud models usually do not work (see below) | a single, exact source with zero expansion |
🔀 Adaptive (default)
Adaptive follows your primary search engine and resolves to a concrete mode for each run:
- Primary is a public engine (e.g. SearXNG pointed at a public instance, arXiv, PubMed) → behaves like Public only.
- Primary is a private source (a private collection, your library) → behaves like Private only (and therefore forces local LLM + embeddings).
- Primary is a collection you marked public (stored locally), or a primary that cannot be classified → resolves to an internal, more permissive scope that allows any classified engine, so private collections can also be queried in that run and inference is not forced local. Do not combine a public collection as primary with private collections you want kept away from a cloud model or from public search queries.
Why it's the default: you choose a search engine anyway, and the privacy posture "just matches" it. If you make a private collection your primary, the run behaves like Private only (best effort, see the caveats there).
Note: to use a cloud LLM on a private collection, mark the collection public (see below), or use Unprotected if the operator has enabled it. Adding the provider to trusted inference providers is not expected to help here: a private primary normally resolves the run to Private only, which normally refuses cloud providers regardless of that list. Adaptive deliberately narrows to match the primary.
🔓 Unprotected
Not recommended — an operator-enabled escape hatch. This mode is unavailable by default. The server operator must set LDR_POLICY_ALLOW_UNPROTECTED_EGRESS=true and restart the application. When enabled, egress-scope restrictions are disabled
for the run: any engine, URL, and LLM/embeddings provider is permitted. The
hard SSRF and cloud-metadata blocks still apply, so full-content fetching
still refuses the result URLs those SSRF checks block (loopback, RFC 1918,
link-local and the other ranges they list) unless the operator also set
LDR_SEARCH_ALLOW_PRIVATE_RESULT_FETCH for an approved engine such as a
self-hosted SearXNG; this is the only mode in which that flag takes effect.
Addresses the SSRF checks do not block are fetched here even when the egress
policy cannot classify them as public (198.18.0.0/15) or counts them as
private, such as the documentation
ranges (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24, 2001:db8::/32)
and 240.0.0.0/4. Every other mode refuses them as full-content result URLs.
A loud, non-dismissible banner
shows while it is active. Prefer marking a collection public, or adding a
trusted inference provider (policy.trusted_inference_providers, which
relaxes only the run-start check described under Strict) for the specific case,
over disabling protection wholesale. policy.trusted_search_engines currently
changes no decision, because that check only looks at the primary engine.
Legacy
unprotectedselections (saved settings and already-queued research snapshots) are migrated to Adaptive by migration0027on upgrade, so they won't silently reactivate if an operator later turns the gate on. While the gate stays off, choosingunprotectedfor a new run or saving it as your default is refused; a queued run that still carries a residualunprotectedsnapshot runs as Adaptive instead.
The older Both scope (blanket-permit any classified engine) has been retired: existing saved
bothconfigurations are migrated to Adaptive (which follows your primary engine and forces local inference for a private primary). If you relied onbothto use a private collection with a cloud model, mark that collection public, or choose Unprotected to opt out of protection explicitly.
☁️ Public only
Only public engines run: web/academic engines, plus any collection you
marked public and any document store (Paperless, Elasticsearch) whose URL is not
classified as private — for example one that resolves to a public host, or
whose name does not resolve when the run starts. Your private collections and
library, and document stores classified as private, are excluded. If a
document store that counts as public is your primary, other public engines can
be queried in the same run, and the agent may build those queries from its
documents. URL fetches are normally allowed to public hosts and blocked for
private ones; the operator opt-in LDR_SEARCH_ALLOW_PRIVATE_RESULT_FETCH
does not change that here (it takes effect only under Unprotected, see
Strict below). Inference is whatever you
configured (cloud allowed), but the run-start check described under Strict
below normally refuses a run whose primary is a document store when the model
is a cloud provider. Use it when you want public research and don't
want your private documents queried at all.
🔒 Private only
The privacy mode. Only local engines run (collections, your library, local document stores such as Paperless or Elasticsearch). Crucially, it forces local LLM and embeddings — cloud providers (OpenAI, Anthropic, Google, OpenRouter, …) are normally refused, so LDR's own LLM and embedding calls normally go only to endpoints it classifies as local. Locality is judged by provider and endpoint address, not by where the model runs: a local endpoint that relays to a hosted model (an Ollama cloud model, or a local LiteLLM or other OpenAI-compatible proxy in front of a hosted API) can pass the check, and your query and retrieved documents then reach that hosted model. Public URL fetches are normally refused, and a best-effort socket guard on the research run normally refuses connections to public addresses (some of its gaps are listed under Strict below). This is a best-effort guard rail, not an air gap; operators who need a hard boundary should use OS- or network-level controls (see SECURITY.md).
If you have no local LLM configured, a Private-only run will refuse rather than silently fall back to the cloud — that's intentional (fail-closed).
🎯 Strict
The tightest mode: only your single primary engine runs — no expansion to any other engine at all.
Result and document fetches under Strict normally reach neither public nor
private hosts. Private hosts are normally refused because LDR's fetch-time
SSRF checks relax private addresses only under Private only. The operator
opt-in LDR_SEARCH_ALLOW_PRIVATE_RESULT_FETCH for an approved public engine
such as a self-hosted SearXNG does not change that: the full-content wrapper
applies it only under Unprotected, so under Strict, Public only, Private only,
Both and the default Adaptive that engine's private result URLs stay blocked
(see SearXNG setup).
That covers every address the egress policy cannot classify as public, including
ranges the SSRF checks let through, such as 198.18.0.0/15, the
documentation ranges and 240.0.0.0/4: full-content search refuses those
result URLs itself under every mode except Unprotected. The run policy also
checks each redirect and pinned connect address in the static downloader.
Browser fallback is disabled under Strict, Public only and Private only
because Chromium resolves its own DNS. Other fetch paths may use different
SSRF grants; see Known limitations. Public hosts are
normally stopped by the egress policy check or, on fetch paths without one,
by the socket guard described below (best effort).
Strict does not turn on the Require local toggles. A run-start check
normally refuses a run that pairs a private primary source (a private
collection, your library, or a local document store such as Paperless) with a
cloud LLM or, for a collection or the library, a cloud provider in the
global local-search embeddings setting. It does not look at the embedder a
collection was actually indexed with. Listing a provider under trusted
inference providers relaxes only that run-start check; the socket guard
below normally still refuses connections to a public address, so a trusted
cloud provider will usually still fail under Strict. This check (under every mode except Unprotected) runs only
where research goes through the web app's research pipeline: the start
request from the research form and the background research worker. Entry
points that call the research functions directly skip it — among others the
REST API's /api/v1/quick_summary, /generate_report and
/analyze_documents, benchmark runs, the MCP server, the in-process Python
functions such as quick_summary and generate_report, and scheduled
subscription runs. Set the Require local
toggles if you want local LLM and embeddings for every Strict run.
Like Private-only, Strict arms a best-effort socket guard on the research run that normally refuses connections to public addresses, so a public primary engine, public result fetches and cloud LLM or embedding calls usually fail under Strict — pair it with a local engine and local models. An Adaptive run that resolves to Private-only arms the same guard.
The guard is a backstop, not a guarantee. Gaps include, among others:
- traffic sent through a forward proxy (
HTTP_PROXY/HTTPS_PROXY) on a private address: the guard sees only the proxy's address; - a relay on a private address that forwards to the internet, such as a self-hosted SearXNG primary engine (the default Docker Compose setup) or a local proxy in front of a hosted model;
- connections reused from a shared keep-alive pool that another thread opened (some LLM clients share cached HTTP clients process-wide, and reusing a pooled connection opens no new socket for the guard to see);
- the headless Chromium used for JavaScript rendering
(
web.enable_javascript_rendering), which runs as a separate process. Runs with Public only, Private only, or Strict scope therefore use static fetching only; the browser remains available for runs with Both or Unprotected scope; - worker threads that do not carry the run's egress context.
Per-collection public/private
Each RAG collection has a public/private flag (default private):
- A private collection is excluded under Public only and when Adaptive resolves to Public only (a public-engine primary; see the Adaptive section for a public-collection primary), and when it makes a run private (Private only, or an Adaptive run that resolves to Private only) it forces local inference, with the same best-effort limits described under Private only above. For Strict, see Strict above. Under Unprotected these restrictions are normally lifted.
- Mark a collection public (the Public collection checkbox when creating it) only if its contents are non-sensitive and you're happy to process them with cloud inference / use them under public scope.
The two local-inference toggles
Independent of the scope, you can force local inference (except under Unprotected, which normally lifts these toggles):
- Require local LLM endpoint — refuse cloud LLM providers / non-local URLs.
- Require local embeddings — refuse cloud embedders, and refuse a HuggingFace download for an uncached local model.
Both are implied automatically under Private only (and Adaptive-private), which is why those toggles auto-check and lock when you select Private only.
LDR's curated Sentence Transformers models, including the default, require a one-time policy-authorized download before they can be used from the local cache. A model from the vetted list that is not already cached cannot be downloaded while local embeddings are required. To install one using Library → Embedding Settings, temporarily select Public only, or use Adaptive with a public primary and no private collection selected; turn off Require local embeddings if you enabled it, then select the model and click Test Embedding Model. Restore your preferred restrictive scope after the test succeeds. Runtime inference then uses the local cache. If a download was interrupted, repeating the test under an authorized public scope can repair its missing files at the same revision. Curated cache checks require the module list, pooling and tokenizer configuration, and each model's declared Transformer configuration before an offline load. This preserves pooling, tokenizer selection, and token limits when metadata downloads are interrupted. Cached models outside the curated list and confined local model paths remain cache-only and require compatible safetensors weights with remote code disabled. An existing curated cache with no trustworthy immutable revision is refused, even under a public scope; restore its trusted metadata or select another model.
Research-form controls
The three primary controls — Egress Scope, Require local LLM endpoint, and Require local embeddings — also appear on the research-form page in the Privacy & Egress panel. Changing one there also saves it to your settings, so it stays in effect for later runs until you change it back.
Under Private only or Public only Egress Scopes, the Search Engine dropdown
is scope-aware: engines that would be refused at submit time under the active scope are rendered disabled
with aria-disabled="true" and a one-line inline reason (e.g. "Blocked: not a local
source under Private only"), so the mismatch is visible before you click Start Research. Under Adaptive,
Primary only (single engine) (Strict), and Unprotected (when operator-enabled) modes, all primary search engines remain enabled
and selectable. Switching the scope automatically reconciles the selected engine value to an allowed option
if the current engine is disallowed under the new scope. Switching the scope or strategy re-evaluates the
dropdown state without a page reload. The backend precheck remains the enforcement boundary and second backstop.
Known limitations
Fake-IP DNS (Clash, sing-box, Surge in TUN mode)
Proxy tools in "fake-IP" mode answer DNS lookups for public names with
addresses from 198.18.0.0/15 and route the connection through the proxy.
An address in that range might also be a real benchmarking host, so LDR
cannot infer the actual destination from the address alone. The egress policy
classifies it, and its IPv4-mapped or NAT64-wrapped (DNS64) form, as unknown
rather than private or public:
- Public only, and Adaptive when it resolves to Public only (the default with SearXNG or another public primary engine): full-content fetching of search results is unavailable, because every result URL is refused as unclassified; the snippets are still returned. Other policy-checked fetches (the content fetcher tool, library downloads) are refused too.
- Strict and Private only: policy-checked fetch paths and the socket guard refuse these addresses instead of admitting public hosts as private. Full-content search also refuses them.
- Both: policy-checked fetch paths refuse unclassified hosts; full-content search refuses the result URLs too.
Unprotected still permits these addresses if the separate SSRF checks allow them. A local engine configured at an ambiguous address is withheld under protected scopes; Adaptive keeps its local-inference requirement instead of widening to a cloud-capable scope.
A real local service at a fixed address in this range can be declared local
in llm.allowed_local_hostnames. List the address itself (for example
198.18.3.4), and also the hostname if the service is configured by name.
Under Strict and Private only the socket guard checks the address a
connection goes to, so a declared hostname alone is still refused there. Do
not declare an address that a fake-IP resolver handed out: the proxy can later
assign it to another name, including a public one.
To avoid this, exclude LDR's traffic from fake-IP resolution (for example a
real-IP / fake-ip-filter rule for the hosts LDR needs, or run LDR outside the
TUN interface). Automatically distinguishing real local benchmark hosts from
proxy-mapped public hosts remains unresolved in
#7093.
Audit log
Changes to any policy.* key, llm.require_local_endpoint,
llm.allowed_local_hostnames, or embeddings.require_local emit a
policy_audit=True log line so administrators can trace configuration changes.
Those audit lines are deliberately filtered out of the WebSocket progress
stream (they never reach browser subscribers).
See also
- Configuration reference — the exact setting
keys (
policy.egress_scope,llm.require_local_endpoint,embeddings.require_local,llm.allowed_local_hostnames) and their auto-generatedLDR_*environment variables. SECURITY.md— threat model, guarantees, and caveats (including what this does not defend against).