10. Agents: what they are and how they are managed
This guide describes Lawliet 1.5.13.s (the current release). Screens, commands and procedures may change in later versions; the usage guide is updated with each release. Check the version your server runs under Settings > Platform or with ./lawliet version, and see the Releases page for what changed.
This chapter explains the Lawliet agent: what it does on each operating system, how it talks to the server, how you see it in the console, and how it is upgraded. The chapters that follow give the install procedures:
| Chapter | Covers |
|---|---|
| 11. Install agents on Linux (and macOS) | Copy-paste command, offline package, uninstall |
| 12. Install agents on Windows | Copy-paste command, offline package, Group Policy (MSI), WinRM, Kerberos |
| 13. Remote deployment from the console | Credentials, Test connection, deployments, approvals |
| 16. Agent security | Self-protection, uninstall codes, tokens, certificate changes |
10.1 What the agent is#
The agent is a small compiled program that runs on each monitored host. One agent per host. It enrols once with the server, then sends a heartbeat every 15 seconds. The heartbeat carries the host's health and collects any work the server has for it.
The agent version in this release is 2.1.9.s.
| Platform | Runs as | Installed to | Supported CPUs |
|---|---|---|---|
| Linux | two systemd services, lawliet-agent and lawliet-watchdog, as root | /opt/lawliet-agent/ | amd64 (x86_64), arm64 (aarch64) |
| Windows | two scheduled tasks, LawlietAgent and LawlietWatchdog, as SYSTEM at startup | C:\Program Files\Lawliet Agent\ | x64 (the same binary also runs on Windows on ARM) |
| macOS | two LaunchDaemons, com.lawliet.agent and com.lawliet.watchdog | /usr/local/lawliet-agent/ | Apple silicon (arm64), Intel (amd64) |
The watchdog checks that the agent is running and starts it again when it is not. It also restores the agent program from a known-good local copy if the program file is deleted or changed.
The compiled agent needs no Python, no package manager and no internet access. The only thing a host must reach is the Lawliet server. This is what makes the agent suitable for an air-gapped site. A Python version of the agent exists as a fallback, used only when the server has no compiled agent for the host's CPU, or when you ask for it (--python). The Python fallback needs python3 and access to a Python package mirror.
10.2 What the agent does#
| Function | What it means for you |
|---|---|
| Heartbeat and telemetry | CPU, memory and disk use, shown on Environment > Hosts |
| Compliance checks | Runs the checks a compliance scan sends and returns the results |
| File integrity monitoring (FIM) | Watches the paths in your FIM policies and reports changes |
| Data loss prevention (DLP) | Scans local files for the patterns in your DLP policies; matches are stored redacted |
| Hardening and response actions | Runs approved remediation and containment actions sent by the server |
| Domain awareness | Reports whether the host is in an Active Directory domain and its role (member, domain controller) |
| Self-protection (optional) | Resists being stopped or removed; see chapter 16 |
The agent reports which modules it supports on that host as Capabilities (FIM, FIM real-time, FIM attribution, DLP). The server sends DLP or FIM work only to hosts that report the capability.
10.3 How the agent talks to the server#
- Direction. Always from the host to the server. The server never opens a connection to an agent. Open one port from the hosts to the server: 443/tcp in HTTPS mode (or the port the server was installed on), 8000/tcp in plain-HTTP lab mode.
- Encryption. HTTPS. The agent checks the server certificate. For a server with a self-signed certificate, the installer is given the certificate file (
--ca-certor-CaCert) and the agent trusts exactly that certificate. - Identity. At enrolment the server gives the agent its own token. The token is stored on the host (
/etc/lawliet/agent.confon Linux,C:\ProgramData\Lawliet\agent.confon Windows) and is not the enrolment secret. - Commands. Every command the server sends is signed. The agent refuses a command that is unsigned, altered, more than 10 minutes old or more than 60 seconds in the future. This is why host clocks matter (see 10.6).
How a host gets enrolled#
A host can enrol in one of three ways. The console shows all three under Environment > Hosts > Install agent.
| Method | Use it when | What authorises the enrolment |
|---|---|---|
| Install command | The host can reach the server. You run one command on it. | The server's enrolment secret, carried in the command |
| Remote deployment | The server can log in to the hosts over SSH or WinRM | A one-time token, valid 2 hours, for one enrolment |
| Offline package | The host cannot download anything. You carry a package to it. | An enrolment code with an expiry and a host limit |
Windows domains have a fourth way, the Windows MSI for Group Policy. It is an offline package made for Group Policy; see chapter 12.
The enrolment secret is shown by ./lawliet token on the server. After an agent enrols and saves its own token, it removes the secret from its configuration file.
10.4 The Environment page#
Environment > Hosts is the fleet list.
Required permission: View agents.
What you see:
- Tiles: Total agents, Online, Offline, Error, Updating. Online counts only hosts that sent a heartbeat recently.
- Host clocks strip: the fleet's clock status and the host furthest from the server's time.
- Filter box (name, host, IP, platform) and status buttons: All, Online, Offline, Error, Updating.
- Table columns: Host, Platform / OS, IP address, Status, CPU, Memory, Disk, Capabilities, Last heartbeat, Clock, Version.
- Under the host name, a chip shows the domain membership:
standalone,member <domain>orDC <domain>. - A red banner at the top when some agents still talk to the server over plain HTTP while HTTPS is on. It lists the hosts and offers Show the HTTPS install command. Reinstall those hosts over HTTPS.
The page refreshes every 15 seconds.
The agent drawer#
Click a row to open the agent's drawer. It shows:
| Section | Content |
|---|---|
| Details | Agent ID, Platform, OS Type, IP Address, MAC Address, CPU, Memory, Disk, Telemetry sampled, Version, Clock, Domain, Domain role, Realm, Domain site, Tamper state |
| Capabilities | FIM, FIM real-time, FIM attribution, DLP (yes / no) |
| Proof of protection | Results of the periodic detection drills on this host, and Run drills now |
| Self-protection | State and the protection controls (chapter 16) |
| Remove agent | Removes the host from the console (see 10.7) |
| Compliance scan | A pointer to Compliance, where you run a scan of this host (choose Single agent) |
Agent status values#
| Status | Meaning | What to do |
|---|---|---|
| online | Recent heartbeat | Nothing |
| offline | No heartbeat within the timeout | See If a host does not appear or goes offline |
| error | The agent reported an error | Read the agent log on the host |
| updating | An upgrade is in progress | Wait; see 10.8 |
stale chip | No heartbeat within the timeout, status not yet switched to offline | Same as offline |
CPU, Memory and Disk come from the last heartbeat. When that sample is old, the meter is grey and marked old.
10.5 Agent configuration on the host#
The installer writes the configuration. Change it only when support asks you to.
| Item | Linux | Windows | macOS |
|---|---|---|---|
| Settings file | /opt/lawliet-agent/config.env | C:\Program Files\Lawliet Agent\config.env | /usr/local/lawliet-agent/config.env |
| Identity (agent id and token) | /etc/lawliet/agent.conf | C:\ProgramData\Lawliet\agent.conf | /var/root/Library/Application Support/Lawliet/agent.conf |
| Trusted server certificate | /etc/lawliet/server-ca.pem | C:\Program Files\Lawliet Agent\server-ca.pem | /etc/lawliet/server-ca.pem |
| Log | journalctl -u lawliet-agent, /var/log/lawliet-agent.log | C:\ProgramData\Lawliet\lawliet-agent.log | /var/log/lawliet-agent.log |
Settings in config.env:
| Variable | Meaning |
|---|---|
LAWLIET_API_URL | The server address |
LAWLIET_AGENT_NAME | The host name shown in the console |
LAWLIET_HEARTBEAT_INTERVAL | Seconds between heartbeats. Default 15. Keep it at 15 or lower: compliance scans wait about 40 seconds for results |
LAWLIET_REGISTRATION_SECRET | The enrolment secret or code. Emptied automatically after the agent enrols |
REQUESTS_CA_BUNDLE, SSL_CERT_FILE | The trusted server certificate, when one was given at install |
Reinstalling the agent on the same host keeps agent.conf, so the host keeps its identity and history.
Procedure: change a setting in config.env#
Risk: a wrong server address or certificate path cuts the host off from the server. Rollback: put the previous value back and restart the agent.
- If self-protection is on, turn it off first (16.2); otherwise the watchdog may restore the files.
- As root (Administrator on Windows), edit the settings file for the platform (table above). Keep a copy of the original.
- Restart the agent:
sudo systemctl restart lawliet-agent(Linux),sudo launchctl kickstart -k system/com.lawliet.agent(macOS),Stop-ScheduledTask -TaskName LawlietAgent; Start-ScheduledTask -TaskName LawlietAgent(Windows). - What you see: the host shows online under Environment > Hosts within a minute, with a fresh Last heartbeat. If it goes offline, read the agent log (table above) and undo the change.
- Turn self-protection on again.
10.6 Host clocks#
Each heartbeat carries the host's time, so the server knows how far each host's clock is from its own. The Clock column shows a chip such as clock +7m 12s.
| Offset | Shown as | Effect |
|---|---|---|
| under 1 minute | ok | none |
| 1 to 5 minutes | warning | A host more than 60 seconds behind refuses the server's commands and policies |
| 5 minutes or more | critical | As above, and domain (Kerberos) logons fail. One notification is raised for the host |
Fix the clock with NTP on the host, then check the Clock chip:
- Run the command for the platform below (as root or Administrator).
- What you see: within a heartbeat or two the chip returns to
ok. If it does not, point the host at your organisation's time source and run the command again.
sudo timedatectl set-ntp true # Linux (or point chrony at your time server)w32tm /resync # Windows10.7 Removing a host from the console#
Removing the record in the console does not uninstall the agent. Uninstall it on the host first (chapters 11 and 12), otherwise the host enrols again.
Required permissions: Manage agents and Delete agents to remove or delete; Manage agents alone to revoke the token. Four-eyes: yes (critical action "Delete an agent") for Remove and Delete it and its records; no for Keep the records: revoke its token, which runs at once.
- Open Environment > Hosts and click the host.
- In the drawer, under Remove agent, click Remove agent.
- The console shows what records the agent still has.
- "It has no records. Remove it?" -> click Remove.
- "It still has N records: ..." -> choose:
- Delete it and its records - removes the agent and its FIM events, DLP incidents, scans and forensic records. This cannot be undone. It is written to the audit trail with the row counts.
- Keep the records: revoke its token - the agent can no longer report, the records stay. You see "Token revoked. The records are kept; a reinstall on this host enrols as this agent again."
- For a removal or deletion with dual control on, the console says "Sent for approval. Removing an agent needs a second signature; run it from Approvals once signed." A second administrator approves it under Approvals > Waiting for me. You then run it from Approvals > My requests > Execute now (see chapter 15).
What you see: "Agent removed." and the host leaves the list.
If it fails: a 409 message lists the tables that still hold records. Choose one of the two options above.
When to use what:
| Situation | Action |
|---|---|
| A host is retired and its history must stay | Do nothing. It goes offline and keeps its history |
| An agent token may be leaked | Revoke the token (above), or rotate it (chapter 16) |
| A host was enrolled by mistake, or its data must be erased | Delete it and its records |
10.8 Agent versions and upgrades#
Environment > Agent versions shows what the fleet runs and the signed releases it can move to.
Required permissions: Manage agents to view; Publish agent releases to import, register, publish and roll out. Four-eyes: yes for Publish, single-host upgrade and rollout (critical action "Publish an agent release").
Upgrades are off by default. They need two server settings in .env:
| Setting | Default | Meaning |
|---|---|---|
AGENT_AUTO_UPGRADE_ENABLED | false | Set to true to let agents accept upgrade instructions |
AGENT_RELEASE_PUBLIC_KEY / AGENT_RELEASE_PUBLIC_KEY_FILE | set in customer bundles | The vendor's public release key. Without it nothing can be published |
After changing .env, run sudo ./lawliet start (a restart does not re-read .env). The page shows a banner when either is missing: "The agent upgrade channel is off" or "No release public key is configured".
Procedure: upgrade agents on an air-gapped site#
Risk: an agent upgrade replaces the program on each host. Rollback: each agent keeps its previous program and restores it if the new one does not report in; to go back across the fleet, roll out the older release (the API's force option allows a downgrade).
- Update the server to the new bundle (chapter 4). The bundle carries the signed compiled agents.
- Open Environment > Agent versions and click Import bundled agents. Each agent binary's signature is checked against the release key. Each becomes a draft release. What you see: a "Bundled agents" result listing what was imported and what was skipped, with the reason.
- In the release catalogue, click Publish on the release. With dual control on, a second administrator approves it, and you run it from Approvals.
- Check Upgrade candidates. Each host shows
readyor the reason it cannot move (already current, offline, mid-upgrade, below the minimum version). - Click Roll out 10. At most ten eligible hosts get the upgrade. The result lists every host it skipped and why. To upgrade a single host, use Upgrade to <version> on its row.
- Watch Upgrade history. States:
pending,downloading,verifying,applying,succeeded,rejected,failed,rolled_back. - Repeat Roll out 10 until every host is current.
If it fails:
| You see | Meaning | Do |
|---|---|---|
rejected | The agent refused the file (signature or digest did not verify) | Stop the rollout. Every other agent will refuse it too. Contact [email protected] |
failed | Something went wrong on that host | Read the agent log on the host |
rolled_back | The new agent did not report in, so the old one was restored | Read the agent log; retry once the cause is fixed |
Procedure: register a release by hand#
Use this only for a build that did not come inside a server bundle (for example a release the vendor sent separately). Bundled builds are imported with Import bundled agents instead.
Permission: Publish agent releases. Four-eyes: no to register a draft (a draft reaches no host); yes to publish it.
Open Environment > Agent versions and press Register a release (disabled with "The upgrade channel is disabled on this deployment" until
AGENT_AUTO_UPGRADE_ENABLEDis on).Fill the form:
Field What to enter Version For example 2.1.0Platform The operating system the build is for Build Python script (every architecture) or Compiled binary (then Architecture) Host it on this server Tick for air-gapped sites; you upload the file after registering. Untick to give a Download URL (HTTPS) instead SHA-256 The file's digest, 64 hexadecimal characters Release signature The base64 Ed25519 signature over the digest, made offline with the release private key Minimum version to upgrade from Optional. Hosts below it step through an intermediate version Channel stable, or canary to keep it out of the stable selection while you try it on a few hosts Release notes What changed Press Register as draft.
With Host it on this server, press Upload artefact on the new row and choose the file. The server checks it against the SHA-256.
Continue with Publish and the rollout (steps 3-7 above).
If it fails: the form or the notice names the problem, for example a digest or signature that does not verify against the release public key.
Procedure: upgrade one host, stop a rollout, retire a release#
- One host: in Upgrade candidates, press Upgrade to <version> on a row marked
ready. Four-eyes: yes. - Stop a rollout: press Unpublish on the release. No new host is sent it; upgrades already running finish. Publish makes it available again (four-eyes).
- Retire a release: press Delete on an unpublished release and confirm "Delete release <version>? Upgrade history is kept." This cannot be undone; register or import it again if needed.
Upgrade agents to the new version before you replace the server certificate: an agent 2.1.9.s learns the server's trust key with its first heartbeat and only then can follow a certificate change by itself (chapter 16).
Re-running an installer on a host is also an upgrade: it replaces the program in place and keeps the host's identity. If anything fails, the installer puts the previous program back.
10.9 If a host does not appear or goes offline#
Work through the checks in this order; stop at the first one that fails and apply its fix. What you see when it is fixed: the host is online in Environment > Hosts.
| Check | How | Fix |
|---|---|---|
| 1. Registration refused | The installer prints the server's reason. 401 = wrong or missing enrolment secret | sudo ./lawliet token shows the current secret. If none is set, sudo ./lawliet token --rotate |
| 2. Server not reachable | On the host: curl -k https://<server>/health must return "status": "healthy" | Firewall or routing between the host and the server |
| 3. Certificate not trusted | The agent log shows an SSL error on every call | Export the certificate (sudo ./lawliet tls --export) and reinstall with --ca-cert / -CaCert |
| 4. Clock wrong | The Clock column, or the host's time | Fix NTP (10.6) |
| 5. 409 "already registered" | An earlier record of this host still exists | Remove the old record (10.7); the waiting agent enrols by itself within a minute |
| 6. Service not running | systemctl status lawliet-agent, or Get-ScheduledTaskInfo -TaskName LawlietAgent | Read the log; reinstall |
The installers check the server before installing anything and print one plain verdict:
| What happened | What the installer says to do |
|---|---|
The certificate does not name the address in --server | Run sudo ./lawliet tls repair on the server, export the certificate again, re-run with --ca-cert |
| Self-signed certificate and none given, or a different one given | Export it with ./lawliet tls --export, re-run with --ca-cert (-CaCert) |
| Certificate not yet valid or expired | Set this host's clock, or renew the certificate on the server |
| Connection refused | Check --server, that the server runs, and its firewall |
| Timeout | A firewall drops the connection: allow the port from this host to the server |
| HTTP 403 "Invalid host header" | Add the address to TRUSTED_HOSTS in the server's .env, then sudo ./lawliet start (8.9) |
| HTTP 403 on the agent download | The enrolment secret was refused: check --token |
More detail: Agents reference.

