Installing the agent
One static binary, no dependencies, on macOS, Linux and Windows. It makes outbound connections only and never listens on a port, so no inbound firewall rule is needed and the agent adds nothing to the machine that anyone can connect to.
Four steps: install, enrol, connect, and keep it running. Each one says which account to run it as, because that matters more than it looks.
1. Install#
macOS#
curl -fsSL https://guardyn.dev/install.sh | shIt checks the published SHA-256 before installing and asks for your password only to write to /usr/local/bin.
Linux#
curl -fsSL https://guardyn.dev/install.sh | shIt checks the published SHA-256 before installing and uses sudo only to write to /usr/local/bin. Without sudo it installs to ~/.local/bin and says so.
Windows#
irm https://guardyn.dev/install.ps1 | iexWindows has curl.exe but no sh, so the one-line installer used on macOS and Linux fails at the pipe. This one checks the published SHA-256 too, needs no administrator, installs under your own AppData and adds itself to your PATH. Open a new terminal afterwards so the PATH change is picked up.
None of the installers enrol. Enrolment needs a token you paste yourself, so a leaked install command cannot add machines to anyone’s fleet.
Without the installer#
Every build is published, with a checksum list:
- macOS: Apple silicon · Intel
- Linux: x86-64 · ARM64
- Windows: x86-64 · ARM64
- SHA256SUMS, which every installer checks against
On macOS or Linux, from the folder you downloaded it to. Set f to the file you downloaded; on Linux use sha256sum -c if shasum is missing.
f=guardyn-agent-darwin-arm64curl -fsSLO https:// guardyn.dev/ agent/ latest/ SHA256SUMSgrep " $f\$" SHA256SUMS | shasum -a 256 -cchmod +x "$f"xattr -d com.apple.quarantine "$f" 2>/dev/nullsudo mv "$f" /usr/local/bin/guardyn-agentThe shasum line must print OK; if it does not, delete the file and download it again. The xattr line clears the macOS download quarantine and does nothing on Linux.
On Windows, in PowerShell:
$f = "$HOME\ Downloads\ guardyn-agent-windows-amd64.exe"(Get-FileHash $f -Algorithm SHA256).Hash.ToLower()$dir = "$env:LOCALAPPDATA\ Programs\ guardyn"New-Item -ItemType Directory -Force $dir | Out-NullUnblock-File $fMove-Item $f "$dir\guardyn-agent.exe" -ForceCompare the hash it prints with the matching line in SHA256SUMS before you move the file. This puts it where the installer would, so the service step below works unchanged; run it by full path, or add that folder to your PATH.
2. Enrol#
Issue an enrolment token from Fleet in the console. It starts with gdn_enrol_. Put it in place of PASTE_YOUR_gdn_enrol_TOKEN below, and give the machine a label you will recognise.
The agent keeps its enrolment per account, so enrol as the same account that will run it.
On macOS, enrol as yourself, without sudo. Your enrolment lives in ~/.guardyn-agent, and the launchd agent in step 4 runs as you too.
guardyn-agent enroll --server https://guardyn.dev --token PASTE_YOUR_gdn_enrol_TOKEN --label "build-01"On Linux, enrol with sudo. As root the enrolment lives in /var/lib/guardyn-agent, and the service in step 4 runs as root, so it only sees an enrolment made with sudo. Leave sudo out only if you will run the agent in your own terminal and never as a service.
sudo guardyn-agent enroll --server https://guardyn.dev --token PASTE_YOUR_gdn_enrol_TOKEN --label "build-01"If sudo answers command not found, the installer put the binary in ~/.local/bin. Move it with sudo mv ~/.local/bin/guardyn-agent /usr/local/bin/ and enrol again; the service expects it in /usr/local/bin.
On Windows, enrol in an ordinary PowerShell. State lives in %ProgramData%\GuardynAgent whichever account runs the agent, so there is no account to match.
guardyn-agent enroll --server https://guardyn.dev --token PASTE_YOUR_gdn_enrol_TOKEN --label "build-01"To let a Windows server take emergency actions from the start, add --allow-actions to its enrol command and run it in PowerShell as Administrator. Without it, emergency actions stay off on that server until someone with administrator rights runs guardyn-agent actions on there. The agent has none on Linux or macOS yet.
The shared enrolment token is exchanged for a token unique to this machine, and only that per-machine token is used afterwards. So the shared secret is used once per endpoint and can be revoked without touching machines already enrolled. Re-enrolling the same machine rotates its token rather than creating a duplicate entry.
3. Connect#
To try it, run it in a terminal, as the same account you enrolled as:
guardyn-agent connectsudo guardyn-agent connectguardyn-agent connectThis holds one outbound stream open. While it is open the machine is inspectable in real time; when it closes, the console says offline instead of guessing. It reconnects with backoff on its own, so a closed laptop lid or a dropped network needs no intervention. A reboot or a closed terminal does: that is what step 4 is for. Press Ctrl-C to stop it before you install the service, so only one copy is connected.
4. Run it 24/7 as a service#
For a machine you want watched and inspectable all the time, install the agent as a system service. It stays connected, through reboots and network drops, so you can investigate the machine whenever you need to without anyone at it. One command does all of it: it copies the agent somewhere only an administrator can write, makes sure the service has the enrolment, registers it with the platform’s own service manager to start at boot and restart if it stops, and starts it.
sudo guardyn-agent service installsudo guardyn-agent service installguardyn-agent service installAdd --dry-run to print every file it would write and every command it would run, and change nothing. Run it again at any time: it replaces what it installed, which is also how a new agent build reaches the service.
- macOS: a LaunchDaemon,
dev.guardyn.agent, running as root from/Library/Application Support/guardyn/. An enrolment made without sudo is copied to/var/lib/guardyn-agent/, so the machine keeps its identity. A per-user launchd agent from older instructions is retired. The log is/Library/Logs/guardyn-agent.log. - Linux: a systemd unit,
guardyn-agent.service, running as root from/opt/guardyn/, with the filesystem read-only apart from its own state. It replaces a unit written by hand from older instructions. The log isjournalctl -u guardyn-agent. - Windows: a scheduled task,
guardyn-agent, running as SYSTEM at startup, before anyone signs in, fromProgram Files\guardyn\, and restarted if it stops. It replaces the per-user task from older instructions. The log is%ProgramData%\GuardynAgent\agent.log.
To see what it is doing, on any platform:
guardyn-agent service statusOn a paid plan the service also runs the 24/7 watch, in real time: it hears about changes from the operating system as they happen and tells you the moment something that matters changes. On the Free plan it keeps the live connection up, so the machine is always ready to investigate.
On a Windows server with emergency actions on, the service is also what carries them out, and it undoes a block, a stopped site or a disabled account when its time is up, even when it cannot reach guardyn.
Privileges#
Without root or administrator rights the privileged collectors — the operating system event log, package and kernel-module integrity — are skipped, and their areas are unexamined rather than clear. The console says so on the machine page and the analyst says so in its answers, but the gap is real.
The service runs as root on macOS and Linux and as SYSTEM on Windows, so it has them all. Running guardyn-agent connect in a terminal as an ordinary user is the way to see less on purpose: the agent says which areas it skipped.
On macOS, Safari’s history is protected even from root. To let the service read it, give /Library/Application Support/guardyn/guardyn-agent Full Disk Access in System Settings → Privacy & Security. Without it, that one check reports what it could not read.
Other commands#
| Command | What it does |
|---|---|
guardyn-agent service install | Run it as a system service: always connected, and the real-time watch on paid plans. --dry-run shows every step. |
guardyn-agent service status | Whether the service is running, and what the watch last saw. |
guardyn-agent service uninstall | Stop and remove the service. The enrolment stays. |
guardyn-agent run | What the service runs, in a terminal: the live connection and the watch. |
guardyn-agent tools | Every tool this binary offers, with its arguments. |
guardyn-agent collectors | Every collector compiled in. |
guardyn-agent scan | One full collection, uploaded as a snapshot. Works without a live connection. |
guardyn-agent audit | The local log of everything this agent has done. |
guardyn-agent actions status | Whether emergency actions are on here, what is in force with the time left, and what is in quarantine. |
guardyn-agent actions on | Allow emergency actions on this machine (Windows, agent 0.17.0 or later). Needs administrator rights; --only allows some of them, --max keeps each one shorter. |
guardyn-agent actions off | Undo everything in force, then turn emergency actions off. |
guardyn-agent version | Version, OS and architecture. |
Where it keeps state#
- macOS and Linux, as root (the service):
/var/lib/guardyn-agent/ - macOS and Linux, as anyone else:
~/.guardyn-agent/ - Windows, whichever account runs it:
%ProgramData%\GuardynAgent\
state.json (mode 0600 — it holds the machine token) and audit.log, one JSON line for each thing it does, emergency actions included. The watch adds watch-baseline.json, the facts it compares against, which stay on the machine, and watch-status.json. That audit log is the machine owner’s copy: a tool that watches a machine, reports upstream and may act on it has to be auditable from the machine’s own side, or it is indistinguishable from spyware.
Removing it#
First revoke the machine from its page in the console, which invalidates its token and drops any live connection immediately. The machine’s history is kept as evidence; the seat is freed. Then, on the machine:
macOS#
sudo guardyn-agent service uninstalllaunchctl bootout gui/$(id -u)/dev.guardyn.agent 2>/dev/null; rm -f ~/ Library/ LaunchAgents/ dev.guardyn.agent.plist*sudo rm -f /usr/local/bin/guardyn-agent; rm -f ~/.local/bin/guardyn-agentsudo rm -rf /var/lib/guardyn-agent /Library/Logs/guardyn-agent.log*; rm -rf ~/.guardyn-agentLinux#
sudo guardyn-agent service uninstallsudo rm -f /usr/local/bin/guardyn-agent ~/.local/bin/guardyn-agentsudo rm -rf /var/lib/guardyn-agent ~/.guardyn-agentWindows#
guardyn-agent service uninstallUnregister-ScheduledTask -TaskName guardyn-agent -Confirm:$false -ErrorAction SilentlyContinueGet-Process guardyn-agent -ErrorAction SilentlyContinue | Stop-Process$dir = "$env:LOCALAPPDATA\ Programs\ guardyn"Remove-Item $dir -Recurse -Force -ErrorAction SilentlyContinue$path = ([Environment]::GetEnvironmentVariable('Path', 'User') -split ';' | Where-Object { $_ -and $_ -ne $dir }) -join ';'[Environment]::SetEnvironmentVariable('Path', $path, 'User')Remove-Item "$env:ProgramData\GuardynAgent" -Recurse -Force -ErrorAction SilentlyContinueIf the last line is refused, the state folder was created from an administrator’s PowerShell; run that line from one too.