Repository navigation
Security and Privacy Model
Checked against v0.7.6 on November 13, 2026.
This page covers what stays on the machine, what can leave, and what has to happen first. It is for contributors who touch anything that makes a network call, writes a secret, or renders output that could be shared.
The short version:
- Everything runs locally by default. Models run through Ollama on your machine, and embeddings run on Ollama or in-process.
- Data leaves through a short, written list of paths (the outbound-call inventory). Most are off until you turn them on, and the two that send your own data to a hosted model each require an explicit step.
- Kestrel never submits an application, sends an email or message, fills in a form, or acts on a third-party site for you. It drafts, recommends and hands over.
- API keys live only in a
.envfile in the data folder.
Two rules in CLAUDE.md set the boundary. Rule 1: the system never acts externally on the operator's behalf, and code that transmits something to a third party for the user is out of scope. Rule 7: public data only, politely, with robots.txt respected, a descriptive User-Agent, rate limits, no scraping behind a login, and contact records limited to publicly listed business details. In practice the robots.txt check is made per source, and several sources skip it; The User-Agent and robots.txt lists which, and why.
Kestrel has no account, telemetry, analytics or crash-reporting code. The web UI loads nothing from other sites: the fonts, htmx and Alpine ship with the app, and every page script talks only to Kestrel's own server on this computer. Everything that does leave is listed, by purpose and destination, in docs/OUTBOUND-CALLS.md, and the wiki page Outbound calls summarizes it. This page does not repeat the list, because a second copy would drift. The groups are:
| Group | When | What goes out |
|---|---|---|
| Job sources and company boards | Only for sources that are on. Nothing searches until you turn a source on or press Start searching. | The search words, place and filters from your profile, or a company board's name. Some sources also send something of yours: USAJobs sends your own key and the email you entered, Adzuna sends your own app ID and key, RemoteRocketship sends your paid key, your target titles and your on-site metro names, SAM.gov sends your own key, and SEC EDGAR needs a contact email in the User-Agent. |
| Pages you point at | Pasting a careers page, feed or posting; re-checking a saved role; company research. | A plain request for that page, or for the company's own site and SEC EDGAR. An address you supplied is refused unless every address it resolves to is public (assert_public_url in kestrel/ingest/http.py), so a link cannot make Kestrel read your own network. An optional SearXNG instance is used only if you set research.searx_url. |
| Online models | Only after you choose an online model and approve what is sent. | What the approval screen lists, and your own key. Detailed below. |
| Update check | On by default, every 24 hours (updates in settings). |
One GET of https://kestrelapp.co/latest.json with a fixed Kestrel-Updater User-Agent, plus an If-None-Match header once it holds an ETag. It sends no ID, version or query string, and it downloads and installs nothing. |
| Notifications | Only if you set an ntfy topic or a webhook URL. | The notification title and body. Confidential mode redacts the employer first. |
| Model downloads | When you set up local models. | Kestrel asks your local Ollama to pull or build a model (/api/pull, /api/create in kestrel/services/model_tasks.py). The download itself is Ollama's. |
Local model traffic goes to Ollama on 127.0.0.1:11434. A model server on another computer on your home or office network (an Ollama, oMLX, vLLM or llama.cpp server added on the Models page, kestrel/services/lan_servers.py) is treated as local: it needs neither Hosted mode nor the ask-first dialog, because it never leaves your network. Where a server runs is decided from its literal IP address with no name lookup, so a host name or an address on the internet is still online whatever a settings file says. Calls to local and home-network models ignore system proxy settings. A source sees your IP address and the User-Agent, and, for the keyed sources above, the key or email that source requires.
docs/OUTBOUND-CALLS.md is the source for the website's page listing every call Kestrel makes, and it ends in a host index: one line per web address that appears in the shipped code, with its kind.
| Kind | Meaning |
|---|---|
call |
Kestrel connects to it. |
link |
It opens only when the person clicks. |
local |
It stays on the computer or the person's own network. |
reference |
Text only: a comment, a license, an example or an XML namespace. Never contacted. |
build |
Used only when building the installer. |
{*} stands for a part that comes from the person, a posting or a setting, so {*}.recruitee.com covers every Recruitee company board.
tests/test_outbound_inventory.py keeps the file true, offline, by reading files only. It scans every file under kestrel/ with one of the suffixes .py, .js, .html, .css, .yml, .yaml, .json, .toml, .txt, .md, .webmanifest or .svg for http, https, ws and wss addresses, and it normalizes each placeholder to {*}. It fails in two directions: an address in the code that is not in the host index, and a host in the index that the code no longer contains. It also fails on a kind outside the five above. A third test checks the scanner itself. The test cannot see a destination assembled at run time from separate parts, an address a person types, or the requests that a library such as JobSpy builds internally. Those are covered by the prose tables in the file, and keeping them accurate is a review job, not a test.
When you add an address to the code, add its host to the index with its kind in the same change, and describe any new call in the tables above the index. A hidden call is exactly what the file exists to prevent.
Requests that go through HttpClient (kestrel/ingest/http.py) carry ingest.user_agent (the SEC source sends its own, below), are rate-limited per host, and check robots.txt only when the caller passes check_robots=True (the client's default is off) and ingest.respect_robots is on. The shipped default User-Agent is Kestrel/1.0 (+https://kestrelapp.co), a link to the project and no contact address. SEC EDGAR blocks requests without a real contact, so an EDGAR source refuses to run, and EDGAR company research is skipped, without one. The generated SEC source gets its own user_agent of the form Kestrel/1.0 (<your email>) from the email on your profile (kestrel/ingest/generated.py). EDGAR research and kestrel doctor read ingest.user_agent, and the doctor warns until that holds a real contact address (_check_ingest_contact in kestrel/doctor.py). That address is sent to EDGAR.
Some calls skip Kestrel's own User-Agent or its robots.txt check. Each is deliberate:
-
Indeed and Glassdoor, through JobSpy. The JobSpy library makes these requests with its own headers. It presents itself as a web browser, and as Indeed's phone app for Indeed. Kestrel's User-Agent is not on them, and
robots.txtis not checked. -
Public job-board APIs. The adapters for Greenhouse, Lever, Ashby, Workday, SmartRecruiters, Rippling, ADP and Paylocity call documented public JSON endpoints and do not check
robots.txt. -
Keyed APIs. Adzuna, RemoteRocketship and SAM.gov are called with the person's own key and no
robots.txtcheck. Adzuna's API terms allow a personal job search, and that skip is scoped to the one API call; Kestrel never reads Adzuna's website. RemoteRocketship's employer pages are read with the check on. -
Two documented public APIs. Remotive's robots.txt disallows
/api/*as a crawler rule, but Remotive publishes the API for scripts and its terms set the use, so that one call skips the check and is held to 4 fetches a local day, counted in the database. The official Hacker News API (hn_hiring) allows only.jsonaddresses through a wildcard Kestrel's check cannot read, so Kestrel requests only.jsonaddresses and never a news.ycombinator.com page. Neither exception covers the site's pages. - SEC EDGAR. EDGAR's own fair-access rules apply instead: a contact address in the User-Agent and at most 10 requests a second.
-
RSS and Atom feeds the person adds. Read without a
robots.txtcheck. The address is fetched withpublic_only=True, so a feed cannot reach a private network. -
A Greenhouse short link. A
grnh.selink is followed one hop, with redirects off, to learn which board it points at. That one request does not checkrobots.txt, and Kestrel makes at most 20 of them a run.
These reads are checked against robots.txt first, and a disallow stops the read: a careers page or job feed the person pastes, a role added by its address, the "still open" re-check of saved roles, a company's own site read for research, portfolio pages, and the Workable, Recruitee, Teamtailor, Personio, Breezy HR, Jobvite, Himalayas, We Work Remotely, Arbeitnow, Jobicy, 4 Day Week and USAJobs adapters. Because check_robots defaults to false, an adapter or reader that reads a page has to opt in. See Adding a job board adapter for the per-platform notes.
Hosted mode lets any tier run on a hosted model through your own API key. Off by default. It is only used when llm.hosted_mode.enabled is true and the disclosure has been acknowledged (HostedMode.active in kestrel/config.py).
-
The disclosure is specific.
HOSTED_TIER_SENDSstates what each tier sends. Tier 1: title, organization, location and the first 1,200 tokens of the description. Tier 2: the description slice, gathered organization context, your confirmed labels as examples and your full profile; resume text goes only when you click Assess on Profile, Documents or Suggest again on Profile. Tier 3 (cover letters, engagement outlines, research summaries, contact finding, negotiation prep): the opportunity, the research gathered on it and your profile. Document selection: your resume variant texts and the opportunity summary. Trigger: the public filing or feed item being classified. The separatefrontierline covers a Tier 3 escalation of one opportunity. -
A changed disclosure voids the acknowledgement. The accepted terms are stored with it. If a later version changes what is sent,
acknowledgement_currentis false and the client refuses every hosted send until you accept the new text. -
The client enforces it, not the UI.
LLMClient.completeinkestrel/llm/client.pyraisesExternalBackendErrorfor a backend markedexternalunless Hosted mode is active or the call is a confirmed Tier 3 escalation. The worker, MCP and any other path cannot reach a hosted model by accident. -
It is re-checked during a run. Before a task that would reach an external backend, the worker re-reads Hosted mode. If you turned it off after the run began, the task falls back to the local model or is refused (
_task_settingsinkestrel/pipeline/worker.py). -
Embeddings are never hosted.
LLMClient.embedrefuses an external backend unconditionally. -
Actions you start ask first. Work that you start on a page, such as picking wordings on the Tailor page, importing, assessing or suggesting wordings for a resume, building stories, writing interview questions, rewriting the Analytics summary, drafting a cover letter or engagement outline on a role, or asking for a story or company research on a role, shows a panel before anything is sent: the provider, the model, what that step sends (the line of the disclosure you accepted) and what happens to a confidential employer. The page does not decide. The route re-checks that the posted confirmation names the model and destination configured now, that Hosted mode is active, and that Confidential mode has an employer chosen to hide, and otherwise answers "Nothing was sent" (
kestrel/services/online_consent.py). Send is at full strength on every such panel. Pressing it without the box ticked shows "Tick the box to send" and sends nothing, and the route refuses an unticked post as well. Queued work you confirmed carries the destination you approved and is held, not sent, if the destination changes before it runs. The scheduled pipeline has no click to carry, so the accepted disclosure is its standing consent and the client enforces it call by call.
Tier 3 is the one path that sends a single opportunity to a stronger hosted model, and it is never automatic. The worker never runs it, and there is no Tier 3 task kind in the queue (kestrel/pipeline/tier3.py).
- You ask to escalate one opportunity.
- Kestrel shows a preview: the exact messages, the destination (provider, base URL, model) and an estimated token cost.
- Confirmation carries a hash of that exact payload. If the payload changed since the preview, nothing is sent.
- One confirmation authorizes one send. The
frontier_transmissionrow is committed before the payload leaves, and a unique index on(opportunity_id, payload_sha256)makes a double click or replayed token fail instead of sending twice. - Each transmission is recorded: payload, destination, whether employer redaction applied, token counts, cost, and an
egressedflag for whether the payload reached the provider.
The hosted escalation uses a separate tier named frontier. The tier3 entry in settings.yml is a local deep model for other features, and keeping them apart means nothing local can be routed off the machine by mistake.
Confidential mode is for a search your current employer must not see. When it is on, your current employer's name is replaced everywhere Kestrel produces output. The matcher is in kestrel/privacy.py and is deliberately simple: exact, operator-controlled, no heuristics.
What is hidden. You mark a role in a document as current. That role carries an editable list of names to hide: the label as written, with corporate suffixes stripped, and the all-caps form of each. A name matches exactly as typed, case-sensitive, on whole-word boundaries. Nothing else is inferred. The editor warns when a name is also an everyday word. Other employers in your documents are protected, so "Joined Acme Labs" survives when "Acme" is the current one.
Where it applies. List views, the JSON API, MCP, rendered documents and previews show your "Show it as" text instead (kestrel/web/redact.py). The Offers page is covered too: competing offers, the pursuit picker, the offer terms you typed, and the negotiation scripts all show it (kestrel/web/pages/offers.py). Your own walk-away figure is left unchanged. Notifications, including ntfy and webhook deliveries, are redacted before they leave (kestrel/services/delivery.py). The diagnostics bundle redacts logs and settings.
Online sends use random codes. For a hosted or Tier 3 send, each hidden text becomes a fresh eight-character code, different on every call, and the reply is restored by swapping exactly those codes back. A reply that still carries a code, or five characters of one, is a failed attempt: one repair, then quarantine.
It fails closed. If confidential mode is on and there is no redaction map, a hosted send is refused rather than sent unredacted (HOSTED_REFUSAL in kestrel/pipeline/_shared.py), and Tier 3 refuses the same way. The setting llm.hosted_mode.redact_confidential defaults to true; the code comment says turning it off must be deliberate and it is not exposed in the UI.
PDF hygiene. Rendered PDFs set an empty header and footer template, and the metadata fields (/Producer, /Creator, /Author, /Title) are blanked after rendering, so no generator string or organization name sits in the file (kestrel/docs/render.py).
Limits. The map hides names you list. A subsidiary, product name or person stays visible unless you add it, and free text can still describe the employer without naming it. Confidential mode reduces exposure; it is not anonymization.
The data-home .env is the only place an API key may live. Keys never go in code, YAML, logs or committed files.
-
Where.
<data home>/.env. On POSIX the file is created with mode0600; Windows ignores that mode. -
What counts as a secret. A name ending in
_KEY,_TOKEN,_SECRETor_PASSWORD, except names starting withKESTREL_orOLLAMA_, which are configuration (is_secret_nameinkestrel/config.py). -
A private store, not the environment.
load_dotenv_into_environloads secrets into a private in-process store and never intoos.environ, so programs Kestrel launches do not inherit them. Non-secret names go to the environment without overriding a real variable. -
Settings name the variable. A backend's
api_key_envholds the variable name, not the key. -
System keys are ignored by default. A same-named variable in the system environment (an
OPENAI_API_KEYanother tool uses) is not used unlessKESTREL_USE_SYSTEM_KEYS=1. Even then, a key saved in Kestrel wins. -
Backups. The backup zip never includes
.env. It also never contains the LAN shared key, which is the one secret the database itself holds (server.shared_secretin thesettingtable)._strip_secretsinkestrel/services/backup.pydeletes the row from the staged copy before zipping, never from the live database, and vacuums the copy so no earlier value stays in free pages. A restore keeps the key the machine already has and puts it back after writing the database, so an older backup cannot replace it. On a different computer, set up LAN pairing again.
The backup zip is a snapshot of the rest of the database, so it still holds your documents, contacts and stored settings. Treat backup files as sensitive.
A backup is treated as input from outside, even when you made it. The restore code is kestrel/services/backup.py; SECURITY_MODEL.md in the repository states the full rules and what enforces each one. The design:
-
Restore is an import, not a file swap. Kestrel never installs the backup's database file. It reads the backup's database, brings an older one up to the current schema on a private copy (a newer one is refused), and builds a fresh database from its own migrations. Rows are then copied in from an allowlist of tables (
RESTORED_TABLES) and, within each, only the columns Kestrel's own schema has. Anything else the backup's database holds is left behind and counted in the result message. - The task queue is not restored. Waiting background work does not come back from a backup, so a backup cannot start a download, choose a model for a run or release something that waits for your confirmation. The one exception is the newest finished follow-up draft per application, kept as read-only history.
- The computer's own settings stay. Where models run, keys, the model servers, notification and search destinations, Hosted mode and its accepted disclosure, MCP and update switches, Confidential mode and the shared key are decided by this computer. The restore keeps them and merges only the rest. A box on the restore sheet, off by default, also brings the backup's AI and connection settings, and the sheet first lists the values it would set.
- The pre-restore check reads every entry. Before anything is stopped, the Settings restore runs the same checks the restore runs, in a temporary folder, reading every file the restore would read to its end. A backup that fails any read is refused while everything is still running. Only archive entries stored or compressed with the methods Kestrel itself writes are read.
- Stored file paths are confined. A path in a restored row that cannot be tied to the documents or prep packs folder is cleared, and generated documents are written only into those folders.
- Saved model files are not trusted. Reranker files are signed under a per-install key that never travels in a backup, so a restored model file does not verify until it is retrained on this computer.
- Work is stopped first, and a failure is reported as it happened. Restore and reset stop the worker and the online lane with the same bounded logic as Quit, and start them again afterwards. If a part after the database fails, the message says the database was restored and names the parts that were not.
Exception text can carry a file path, a URL or a key, so pages no longer show it. plain_error in kestrel/web/errors.py maps an exception to a short safe reason (for example "permission was denied" or "the file was not found"), or to one fixed sentence that points to the log. The exception's type and text are never shown. The caller logs the real exception with context through structlog. Restore and backup errors follow the same rule. Text you type into a form and that a page echoes back is HTML-escaped, which tests/test_security_escaping.py checks. A new handler that returns an error to a page should call plain_error and log the original.
A tester can download a diagnostics zip from the About page, or save it to the Downloads folder. Kestrel never transmits it. The person decides whether to send it anywhere. kestrel/services/diagnostics.py builds it, and the rule is stricter than the backup's: nothing in it should be something the person minds forwarding.
| Included | Excluded |
|---|---|
| Version, platform, hardware, schema revision, run mode, row counts, the data folder path |
.env and every key, secret or token value, under any name |
| The saved doctor report | profile.yml |
Effective settings with secret values replaced by <redacted>
|
Document text, including your resume variants |
| The last 2,000 lines of each log | Posting descriptions and the model's prose about a role |
| The last 20 quarantine rows, each raw response cut to 500 characters | Contacts, outreach drafts and interactions |
roles.json: the newest 500 roles by ID, with title, organization, location as posted and as read, remote type, stage, the rule that set it aside, the posting's site name and each scoring pass's scores and warning signs |
The database file |
| Installed package versions | Your notes |
roles.json lets a tester name a role by the ID that shows under Show details on its Evaluation tab, so a reviewer can find what the filters and each scoring pass decided. It does carry job titles and organization names, and the site name is the host of the posting address, which can name the employer. They go through the same scrubber, so in Confidential mode your current employer is replaced, and if Confidential mode cannot be honored the titles, organizations and site names are withheld (conservative in kestrel/services/diagnostics.py).
Every text member goes through one scrubber, make_scrubber. It masks every secret value Kestrel holds (longest first, including JSON-escaped forms), anything shaped like a bearer token or API key, and, in confidential mode, the current employer.
settings.redacted.yml replaces any string under a key whose name contains key, secret, token or password, and keeps api_key_env because it names a variable. Two limits: a quarantined model response can quote a posting, so quarantine.json is truncated and the page tells the tester they can delete it from the zip; and the data folder path can contain an operating system user name.
The web app and REST API listen on loopback (127.0.0.1) by default. The desktop shell and kestrel serve bind the first free port from 8765 and record the port and pid in runtime.json, so a second launch can find the running instance. Because the port is predictable, four separate controls sit on the request path. They guard different things, and none replaces another (kestrel/web/app.py, kestrel/web/auth.py). REST API gives the exact responses.
| Control | Protects against | How |
|---|---|---|
| Host allowlist | A hostname that resolves to loopback reaching the app | Starlette's TrustedHostMiddleware accepts 127.0.0.1, localhost and [::1] by default. With LAN access on it accepts only the addresses this machine answers on, never any name, plus any exact tunnel hostname you list in server.public_hostnames. |
| Cross-origin guard | A web page you have open driving the app | Unsafe methods carrying an Origin that is not the app's own get 403. A short list of state-changing GETs also checks Sec-Fetch-Site. A request with neither header (curl, MCP, tests) is not browser-driven and passes. |
| Extension key | Another installed browser extension that has a localhost permission | A request whose Origin is an extension scheme must carry the shared secret in X-Kestrel-Key, even on loopback. The scheme alone is not trusted. |
| Shared secret | Unauthenticated non-loopback requests | Required of every non-loopback request, compared in constant time. With no secret generated, such a request gets 401. Loopback, /health and /auth are exempt. |
The cross-origin guard matters because the app can start real outbound scrapes, and a stray page triggering them would break hard rule 7.
The shared secret is a single credential, not a login, and it is not sufficient to expose Kestrel to an untrusted network. Settings can rotate it, which revokes the old one at once. uvicorn runs with access_log=False so the secret stays out of logs, and with proxy_headers=False so a forwarded-for header cannot change how a peer address is classified (kestrel/web/serve.py).
A request that carries the shared key (a key holder) can browse and work, but restore, Clear everything, every download of your data, and changing keys, models, routing, the LAN switch or MCP are refused unless the request comes from this computer. Through a published tunnel, a request that names your public hostname always needs the key, even though the tunnel connects from loopback.
The optional MCP server is off by default (mcp.enabled: false, port 9110). See MCP server.
There is no authentication on loopback. Any process on the same machine can call the API. Kestrel assumes the machine is yours. The controls above target web pages and network peers, not local malware.
- Route new outbound requests through
HttpClient(kestrel/ingest/http.py) for the User-Agent and rate limits, and passcheck_robots=Truewhen the request reads a page sorobots.txtis checked. A request that skips any of them needs a reason in a code comment and a plain sentence indocs/OUTBOUND-CALLS.md. - Put every new web address in the shipped code, including one in a template, a comment or an example, in the host index of
docs/OUTBOUND-CALLS.mdwith its kind.tests/test_outbound_inventory.pyfails until you do. - Pass
public_only=Truefor any address a person supplies, so a link cannot reach a private network. - Anything that sends operator data to a third party needs a per-use confirmation showing the exact payload, and an audit row.
- A new hosted-capable path must use
plan_hosted_sendandencode_send(kestrel/pipeline/_shared.py), so confidential mode redacts or refuses it. - Never log a key, an
/authquery string or posting text. Keys are written withwrite_secretinkestrel/llm/providers.py. - Never put an organization name in file metadata, a header, a footer or a generator string.
- Outbound calls for the summary of everything Kestrel contacts.
- Task queue and concurrency for why no Tier 3 task exists.
-
Database schema for
frontier_transmissionand thesettingtable. - Packaging and releases for the update feed.
Start here
Interfaces
Extending Kestrel
How it works
- Prompts and context budgets
- Document engine
- Learning loop internals
- Analytics internals
- Task queue and concurrency
- Database schema
Shipping and safety
- Packaging and releases
- Preflight and diagnostics
- Security and privacy model
- Outbound calls
- Benchmarking
Workarounds and Troubleshooting