What other projects of the Artifex Ecosystem rely on from Heimdall, and what Heimdall relies on from them. One section per
contract: what it is, who uses it, where it lives in the code. Changing any of them is a contract change: the commit message
says CONTRACT:, this file changes in the same commit, and the other repository is told (its maintainers' handoff notes).
Adding an optional field or key is backwards compatible; renaming or removing one, or changing a shape, exit code or first
line, is not.
The daemon in charge is the Rust heimdalld (rust/heimdall, since 2026-11-19); the Go sources (cmd/, internal/)
remain the reference the parity fixtures are written from, and their package names appear below where a contract was first
written against them.
8930: Heimdall's API, loopback only. 8931: the mesh, off by default, on one non-loopback address I choose. Both are in
Sarina's docs/ECOSYSTEM.md port registry.
- What: HTTP on
127.0.0.1:8930. Every endpoint but/healthzanswers only root, heimdalld's account,api_users(defaultsarina) and members ofapi_groups(defaultwheel), identified by the kernel from/proc/net/tcp; clients send nothing extra. A client running as another account needs adding toapi_users. - Who: Sarina (service and CLI), Yggdrasil's panel and Settings, Labyrinth OS's
labyrinth-sarina-checkupandlabyrinth-selfcheck(/healthz), LykanOS'slykanos-security.conf(api). - Where:
rust/heimdall/src/api.rs; Gointernal/api(access.go,status.go'sListenAndServeLoopback).
- What: one JSON object per alert, in the API and one per line in the file. Each carries
explain(what happened, how serious, what Heimdall did, what to do; fixed text per detector and severity). Since 2026-11-18 an alert may carryattack(technique IDs such as"T1557.002", in the map's order) andexplain.attack([{"id", "name"}], the same IDs with MITRE's names, a sub-technique as "Parent: Sub"); both are left out when the detector has no tag. A tag says what the detector watches, never that a technique is covered. MITRE's page ishttps://attack.mitre.org/techniques/<ID with "." as "/">/, opened only on a click. Which detector gets which tag (internal/attack/tags.tsv) may change with a note; the reasons and the gap list are in ATTACK.md. - Who: Yggdrasil Settings > Security (the Explain button; the names from
explain.attack), the panel's notifications ("What to do"), Sarina (both fields, from the API and the file). Field names in an alert'sfieldsare stable (Sarina readsverdictandverdict_reasonbefore advising);hardeningalerts may carrycve, andGET /v1/audit'shardeningentries too (omitted when empty). - Where:
rust/heimdall/src/alert.rs,explain.rs,attack.rs,verify.rs.
- What: since 2026-11-25, each host-telemetry field's last hour minute by minute, for a strip beside its graph:
{"minutes":60,"until":"<the last minute, RFC 3339>","fields":{"load_per_cpu":"...","mem_percent":"..."}}, each field a string of 60 characters, oldest first:1a value that minute was out of this host's usual range (the baseline'sbaseline_z_thresholdstandard deviations or more from its learned mean, either way: a minute can be1with nobaseline-driftalert, which is upward only and above floors),0its values were all within,-none was scored (no telemetry, or the baseline still learning). A field appears once it has been scored. Kept in memory: after a restart the hour starts empty. Same access as every endpoint (above). - Who: meant for Yggdrasil Settings > Security (nothing reads it yet).
- Where:
rust/heimdall/src/anomaly.rs(marked bydetect/stateful.rs'sBaselineDriftDetector),api.rs.
- What:
/var/lib/sarina/sessions/*.json, the shared folder the Sarina service writes (agent_session_dir;session_id,messagesas objects withrole/content/tool_calls). A workspace's.port_sessions/agent/<id>.jsonhas the same shape; the older flatmessages: []stringshape under.port_sessions/is still accepted. Sarina writes each file atomically (temp file and rename) and keeps the shape stable (sarina doctor'ssession_contractcheck). Heimdall never writes there and never imports Sarina's code. Access: an ACL for Heimdall's account (read and enter, never write), kept byheimdall-sarina-access.path. Since HEI-9 Heimdall also reads the arguments of an assistant message's file-writing tool calls by name:write_fileandvault_write(path,content),edit_file(path,new_text),forge_write(name,files[].path,files[].content); each becomes anagent_writeevent for theagent-watermarkdetector. A renamed tool or argument is not seen (no error): renaming one is a contract change on both sides. - Who: provided by Sarina (
docs/ECOSYSTEM.md§4a); read by Heimdall. - Where:
rust/heimdall/src/sources/agent.rs; Gointernal/sources/agentsource.
- What: Sarina's shared scan gate (memory writes) asks Heimdall to review text after its own checks pass, opt-in via
HEIMDALL_REVIEW_URLon Sarina's side (the oldSENTRY_REVIEW_URLis read when the new one is unset). A"deny"folds into Sarina's blocked result. Fails open when Heimdall is absent, fails closed on an actual verdict (ARCHITECTURE.md, Phase 4). A breaking change to the request or response JSON changes Sarina'sheimdall.rsin the same step. - Who: Sarina (
heimdall.rs, called fromguard.rs;docs/ECOSYSTEM.md§4b). - Where:
rust/heimdall/src/governance.rs,api.rs; Gointernal/governance,internal/api/review.go.
- What: Sarina files requests (
POST /v1/requests:kindescalation|access_tier,detail,session_id,reason) and reads my answers from/etc/heimdall/grants.json(root's;access_tiercap andescalationswithtier,session_id,until), never over HTTP. Off until I switch it on (sudo heimdalld grant tier N). Either JSON shape changing is a contract change in both repositories. GRANTS.md. - Who: Sarina (
heimdall.rs: the access-tier reading and the tiers' router). - Where:
rust/heimdall/src/grants.rs,cli/grant.rs.
- What: after a new Limbo quarantine, Heimdall asks the local Sarina service (
sarina_url, loopback) for an opinion: a session withtool_allowlist: [], the alert framed as untrusted data, the reply attached to the quarantine as an advisory. Heimdall verifies the service reports 0 tools and sends nothing otherwise (an older service ignores the field). An advisory never changes a record's status. Uses Sarina'sPOST /v1/sessionsand/chat. - Who: Sarina's service (
docs/ECOSYSTEM.md§4c). - Where:
rust/heimdall/src/advisor.rs.
- What: root's
heimdalld immunity analyze --sarina SHA256(and, withsarina_analysis="auto", a queued request after a new hold ClamAV does not know) lends an uncompressed read-only copy at/var/lib/heimdall-sarina-share/<sha256>.sample(root:sarina 0440), named in the request as Sarina's sandbox sees it,/quarantine/<sha256>.sample. The session:tool_allowlist: ["reverse_engineer"],max_turns12,max_tool_calls10,timeout_seconds300; nothing is sent unless the service reportstools: 1(sarina_contract_tools_mismatch). When/var/lib/sarina/.local/share/labyrinth/rea-work/bsim/library.mv.dbis a plain file, the request also asksreverse_engineercommandsimilar, and the kept analysis recordssimilar: true. The answer is untrusted, kept assarina_analysison the held file's index entry (a YARA block in it is only a rule draft); never while Sarina is contained; one at a time.sarina_analysisin/etc/heimdall/config.jsonis the switch Settings shows. IMMUNITY.md, "Sarina's analysis". - Who: Sarina (
reverse.rs;docs/ECOSYSTEM.md§4d), Yggdrasil Settings (the switch). - Where:
rust/heimdall/src/cli/immunity/sarina.rs,immunity.rs.
- What: the lock
/etc/heimdall/containedis written first when Sarina is contained; Sarina refuses to start while it exists and Limbo stops and refuses her agents' runs.heimdalld contain status,sudo heimdalld contain release(restore the approved files, then lift the lock; same exit codes and messages in Rust and Go). CONTAIN.md. - Who: Sarina (checks the lock), Yggdrasil Settings > Security ("Restore and release"), LykanOS and Labyrinth's
security integration files (
contained,release). - Where:
rust/heimdall/src/contain.rs,cli/contain.rs.
- What:
heimdalld trust status|sign|restoreand the files it keeps (Sarina'strustreads the same files);heimdalld origin IP...printsIP ORIGINlines;heimdalld maintenance on|off|status;heimdalld scan-filesprintsINFECTED PATH: SIGNATURElines with exit codes 0 (clean), 1 (found), 2 (error). - Who: Sarina (trust, origin), Labyrinth OS (
labyrinth-agentuses maintenance; the downloads scan uses scan-files). - Where:
rust/heimdall/src/cli/trust.rs,cli/maintenance.rs,cli/scan.rs,ipintel.rs.
- What:
heimdalld immunity release IDandheimdalld immunity confirm ID, with their exit codes and messages. - Who: Yggdrasil Settings and the security integration files (
held_release,held_confirm). - Where:
rust/heimdall/src/cli/immunity.rs.
- What: Limbo's
events.jsonl(spec: Limbo'sdocs/EVENTS.md: one JSON object per line withtime,kind,guestand a flat string-valueddetail). The live log/var/lib/limbo/state/events.jsonlisroot:limbo-heimdall0640; heimdalld gets that group from the drop-inpackaging/arch/limbo-integration.conf.example. Detectors:limbo-guest(Limbo's safety ordering from outside: a guest started with no firewall policy first, a policy removed under a running guest;image.rejected,gate.blocked),limbo-network(net.anomalybyreason,net.capped;sinkhole.dnsandsinkhole.connect: a sealed guest calling out, each target once a guest, at most 8, guest data quoted and cut;sinkhole.stopstarts a guest afresh),limbo-exchange(exchange.held,exchange.fail; detailpathbecomes alert fieldguest_path).net.flow,net.blockedandexchange.fileare deliberately not alerts. Limbo adding kinds or keys is compatible; renaming or removing them is a contract change on both sides. Heimdall treats a tapvl-<guest>on its bridgelb-<guest>as Limbo's own (Limbo pins the names in itsvirtnames).lan-watchreadssinkhole.start(detailaddr,dns_port,tcp_port,udp_port) andsinkhole.stop(addr): between them a listener on that gateway address and those ports (the DNS port over UDP and TCP) is Limbo's sinkhole responder, not a new listener (HEI-6); outside a run it is reported as any other.limbo-guestalso readswine.startfromlimbo wine's own log (the person's~/.local/state/limbo/events.jsonl, same line format, guestwine:<prefix>;limbo_event_lognames one log, so pointing it there is a choice of that log): the detailsha256(the program file's) is looked up in the immunity store's index (immunity.json); aheld,immuneorreferencesample is critical, asuspecta warning, areleasedone or an unknown hash nothing (HEI-10). Such an alert starts no response: a Wine run is no guestcontrol.sockcan restrict. The otherwine.*kinds are not alerts. - Who: provided by Limbo; read by Heimdall.
- Where:
rust/heimdall/src/sources/limbo.rs,detect/stateful.rs.
- What: I decided (2026-10-04) that Heimdall may cut a guest's network and that a human must approve any verdict.
Heimdall calls Limbo's
control.sock(POST /v1/quarantine,POST /v1/quarantine/{id}/advisory, and the read-onlyGET /v1/guests/{name}to skip a torn-down guest). That socket has no route to release a guest, lift a hold, lower a level, tear a guest down or give a verdict, so a compromised Heimdall can only make a guest more restricted. Triggers:limbo-guestcritical onguest.start/policy.remove;limbo-networkwarning or higher onnet.anomalywithreasonhost_probe,lan_probeorscan;limbo-exchangewarning or higher onexchange.held; always a re-validated guest name, always levelrestrict. Only inheimdalld run, neverscan. A Limbo outage never costs Heimdall its own alerts. Spec: Limbo'sdocs/QUARANTINE.md. Held files Limbo kept are copied into Heimdall's store by root'sheimdall-requests.service(immunity take-limbo), and the analysis asksPOST /v1/sample-runson Limbo's admin socket. - Who: provided by Limbo; used by Heimdall.
- Where:
rust/heimdall/src/response.rs,quarantine.rs,cli/immunity.rs.
- What: before each package audit, kernel audit and hardening check, heimdalld runs
/usr/bin/yggdrasil-gametime status: exit 0 means a game runs (the job waits, asks again every 5 minutes, and logs the reason from the first stdout line,A game is running: REASON.); exit 1 means none; a missing tool, any other exit or no answer within 10 s means run as before. The downloads guard's heavy half waits the same way (asked once a minute while something waits).HEIMDALL_GAMETIMEnames another tool (tests use it). Watching (alerts, detectors, the responder) never asks. - Who: provided by Yggdrasil; used by heimdalld and heimdall-fileguard.
- Where:
rust/heimdall/src/audit/gametime.rs,daemon.rs;rust/privacy/src/gametime.rs.
- What: the crate
heimdall-macvendor, used as a git dependency pinned to a commit (rev). Its public API (global,lookup,lookup_str,Table::lookup_oui,Answer,Vendor,is_local,parse_mac) changes only with a matching change where it is used. It stays free of dependencies, so it builds anywhere Settings does (a Raspberry Pi too). - Who: Yggdrasil Settings (makers of Wi-Fi access points and their vendor extras), LykanOS's tools.
- Where:
rust/macvendor. DEVICES.md.
- What:
GET /v1/lan/devicesreturns{networks: [{uuid, ssid, first_scan, last_scan, devices: [{mac, ip, name, names, vendor, model, kind, owner_kind, services, private_mac, first_seen, last_seen}]}], status, status_uuid, status_time}.kind(the guess) is one of router, this, tv, speaker, printer, phone, computer, console, smart, private, other;owner_kind(omitted when unset) is what I said a device is:pkexec /usr/bin/heimdalld lan kind MAC KIND|guess.statuscan benot_trusted,not_home,router_changed,offline. "Scan now":systemctl start --no-block heimdall-lan-scan.service(polkit rule50-heimdall-lan-scan.rules: wheel, active local session). - A look at a network that is not home:
heimdalld lan look [--wait SECONDS] [UUID](any account, no password; Rust only) listens for SECONDS (default 8, held to 1-60) on active connection UUID (none: the default route's) and prints one line of JSON:{status: looked|offline, uuid, name, interface, mdns: listened|not_member|busy, listened, devices: [{mac, ip, name, names, vendor, model, kind, services, private_mac}]}.macis empty for a device heard but not in the neighbour table. It sends nothing and writes nothing. - Who: Yggdrasil Settings (device page; the integration file's
devices_scan,devices_kindanddevices_look). - Where:
rust/heimdall/src/cli/lan/,api.rs. DEVICES.md.
- What:
heimdalld wifi-health --json [--speed]printsconnected,summary,verdict(good|warn|bad),link{ssid, band, channel, width, signal_dbm, rx_mbps, tx_mbps},findings[{check, status good|info|warn|bad, title, detail}],speed{down_mbps, server, error}. WIFI_HEALTH.md. - Who: Yggdrasil Settings (the integration file's
wifi_check). - Where:
rust/heimdall/src/cli/wifihealth.rs.
- What:
/etc/heimdall/wifi-trusted.jsonholds the trusted networks; an entry may carrykind(mesh,phone-hotspot,travel,other; absent or unknown meanshome-router) and"discoverable": true; a network that is not trusted but discoverable is{"ssid", "level": "untrusted", "discoverable": true}, which every reader counts as untrusted. Commands Settings runs:pkexec /usr/bin/heimdall-wifi-guard trust [--home] [--real-address] --uuid UUID,pkexec /usr/bin/heimdall-wifi-guard untrust UUID,heimdall-wifi-guard kind [--uuid UUID](printsNAME: kind KIND) andpkexec ... kind KIND --uuid UUID,heimdall-wifi-guard discoverable --uuid UUID(printsNAME: discoverable on|on (home)|off), changed by startingheimdall-wifi-discoverable-on@UUID.service/-off@UUID.serviceover systemd's D-Bus (polkit's own default, the administrator's password)./run/heimdall-wifi-guard/state.jsonsays whether a trusted network counts as trusted this time and whichprotectionsare on (discoverableamong them). WIFI_TRUST.md. - Who: Yggdrasil Settings (
packages/settings/src/wifitrust.rs), the device list (reads the levels). - Where:
rust/heimdall/src/cli/wifitools/guard.rs; the Python programs inpackaging/net/(the reference the port is tested against; not installed).
- What:
heimdall-multilink status --json(the service's/run/heimdall-multilink/status.jsonwhile it runs:stateactive|paused|waiting,reason,since,new_links,combined_rate,links[]withname role up ipv4 ipv6 healthy4 healthy6 weight4 weight6 rtt_ms rate peak share_now share_limit data_cap_mb period used_bytes over_cap; rates in bytes/s; while the service is off the command prints the same shape withstate"off" and onlyname role up ipv4 ipv6 share_limit data_cap_mb periodper link); both also giveprobe4andprobe6, the health checks' servers ("IP:port", IPv6 as "[IP]:port"). Changes:pkexec /usr/bin/heimdall-multilink on|off|set LINK use|backup|off [--share N|none] [--cap MB|none] [--per day|month]|new-links ROLE|probes 4|6 IP:PORT[,IP:PORT...]|probes 4|6 default(1 to 8 servers a family, not loopback, unspecified or multicast). MULTILINK.md. - Who: Yggdrasil Settings > Wi-Fi & Network > Several connections at once.
- Where:
rust/multilink(src/service.rs,status_json).
- What:
heimdall-fileguard scan --json FILE...prints{"files":[{"path","verdict":"ok"|"warn"|"refused","reasons":[...], "clamav":"clean"|"infected:SIG"|"unavailable"|"not-fully-scanned"}]};heimdall-fileguard extract --json [--only EXT,EXT] ARCHIVE OUTDIRprints{"files":[{"name","path","size","verdict","reasons","clamav"}],"skipped":[{"name","reason"}], "refused":null|"..."}. Exit 0 nothing refused, 1 refused, 2 usage or reading error. OUTDIR must not exist; on a refusal nothing is left. PRIVACY_PACK.md, section 5. - Who: Yggdrasil Settings (fonts page;
packages/settings/src/fontlib.rs). - Where:
rust/privacy.
- What:
~/.config/heimdall/privacy.json{"downloads_guard","remove_hidden_info","lookalike_warnings","folders_guard"}, each missing = on; Settings writes it and the guard follows it live.heimdall-strip --can INandheimdall-strip --json IN OUT({"wrote","removed","kind"}; exit 0/1/2; never over a file). PRIVACY_PACK.md. - Who: Yggdrasil Settings > Security > Privacy (the switches), Minos (Remove hidden info), Settings > Apps and Agora (look-alike warnings).
- Where:
rust/privacy.
- What:
heimdall-private-mic status --json({"enforce","node","lykanos","sarina_raw","disguise","disguise_preset"}: booleans, the preset"lower"|"higher"),on|off,disguise on|off|lower|higher,sarina-raw on|off(exit 1 off LykanOS); the voice input markedheimdall.private-mic.exempt = "sarina-voice"is the only streamsarina-rawlets through, on LykanOS only;heimdall-scrub --progress IN OUT(progress 0.42lines, then exactlywrote OUT; exit 0/1/2; never over IN or an existing OUT);heimdall-scrub --disguise PRESET IN OUT. LOCATION_SOUNDS.md, VOICE_DISGUISE.md. - Who: Yggdrasil Settings (Privacy, Peripherals > Microphone), Minos, the panel's Super+S recording; Sarina records the private microphone like every app.
- Where:
rust/scrub,rust/scrub-ladspa,packaging/privacy/.
- What:
/etc/heimdall/defaults-offmakes the install hook (heimdall-enable-defaults) leave Heimdall off (--forceswitches it on anyway);/etc/heimdall/security-toolslists the security tools whose activity the tool rules summarise instead of alerting on. TOOL_RULES.md, STANDALONE.md. - Who: LykanOS ships both; Labyrinth OS's first boot and LykanOS's image build run
heimdall-enable-defaults(paths, output and exit codes stable). - Where:
rust/heimdall/src/cli/shtools.rs(enable-defaults),toolrules.rs.
- What: peers POST
/mesh/v1/alertsover mutual TLS 1.3 (enrolled ed25519 keys only) onmesh_listen(port 8931, on my own WireGuard or LAN address, never a wildcard). Off by default. MESH.md. - Who: Heimdall on my other computers.
- Where:
rust/heimdall/src/mesh.rs,cli/mesh.rs.