Skip to main content
Install and Uninstall cover — as cleanly removed as installed. How AgenShield is installed and enrolled on a Mac, what the install puts on disk, and how to remove it completely.
Setting up one Mac for the first time? Follow the Quickstart instead — it covers install, the macOS approvals, and confirming the Mac is healthy, in order. Deploying to a fleet? Use the MDM guide.
Installing does not enforce anything on its own. It enrolls the Mac and starts the service; enforcement begins once the macOS approvals are granted and your organization’s policy arrives. See How AgenShield works.

Installation

AgenShield ships as the signed AgenShield.app bundle plus the agenshield command-line tool, packaged as a signed, Apple-notarized macOS .pkg. See What gets installed for what each part is responsible for. The .pkg is published as a GitHub Release asset on agen-co/agenshield. The agenshield npm package is a thin wrapper that bootstraps the installer from that release — no large binaries ship through npm.

Campaign install

A security admin creates a deployment campaign in the Frontegg Portal, on the Devices page (https://portal.frontegg.com/<environment>/agen/shielded/devices). The campaign produces an install URL that carries an enrollment token. The endpoint user runs:
The campaign-served installer script does the following:
  1. Detects the platform and architecture. macOS builds are Apple silicon only — on an Intel Mac the script stops with a clear message rather than installing something that cannot run.
  2. Resolves the latest version from the agen-co/agenshield GitHub Releases API (or honors --version), then downloads the signed AgenShield-<version>-arm64.pkg from that release.
  3. Stages the enrollment token for the installer, so the package can enroll the Mac without anyone typing anything in.
  4. Runs sudo installer -pkg <pkg> -target /. In an interactive terminal the install then hands off to a guided stepper that walks the three System Settings approvals — security extension, Full Disk Access, and network filtering. Each step advances the moment the approval is detected (press Enter to re-check immediately), and it closes by confirming protection is active. Non-interactive runs — and runs with AGENSHIELD_INSTALL_HEADLESS=1 set — skip the stepper and log to /var/log/agenshield/install.log.
The campaign install does not require — or prompt for — a user login. The Mac is enrolled as a device and enforces the policy it receives without anyone being signed in, so an unattended or overnight rollout works. The person using the Mac signs in later from the AgenShield menubar, or with agenshield login, to attach their account — that is what enables rules scoped to their team, role, or group.

Running it unattended

A fleet deployment runs the same installer through the install script in your campaign’s MDM guide in the Frontegg Portal. The script downloads the whole installer before running it, so a failed download fails the MDM job instead of reporting success. If you are rolling out to managed Macs, start at MDM enrollment — it covers the profile you push alongside it. What follows is the mechanism. MDM script runners execute it directly — JumpCloud Commands, Kandji custom scripts, Mosyle custom commands, Jamf policy scripts, Intune shell scripts. Run it as root, which is what those runners do by default. It detects that no terminal is attached, works out which signed-in user the Mac belongs to, installs for that user, and hands the files back to them. No wrapper is required, and it exits non-zero if the device does not finish enrolling, so your MDM’s result view is trustworthy. These variables tune that. All are optional; a normal rollout sets none. Set them at the top of the install script from your campaign’s MDM guide:
On AGENSHIELD_INSTALL_NO_START. It stops the installer from starting the service itself. It does not hold the service back until you say so: the background service is registered to start at boot, so on the next restart it comes up regardless. And when the installer used the signed package — which it does on any Mac that can reach the download — the service is already running by the time the script would have checked the setting, so it changes nothing at all. Use it when you do not want a service starting mid-provisioning; do not rely on it to keep a Mac unprotected until a later step.
A script cannot grant the extension approvals or Full Disk Access — Apple accepts those only from an MDM. Push your organization’s configuration profile alongside the command, or somebody approves the extensions on each Mac by hand. See MDM enrollment.

Manual install

npx agenshield install bootstraps a self-managed installation. On macOS it downloads the signed .pkg from the agen-co/agenshield GitHub Release and runs it. Given a backend URL and token, it enrolls the Mac exactly as the campaign install does.

Windows

A security admin creates a deployment campaign in the Frontegg Portal the same way as for macOS. The campaign produces an install link; on Windows, run it from a PowerShell window:
If the window is not already elevated, the install script requests administrator approval itself (a standard Windows permission prompt) before continuing — you do not need to right-click “Run as administrator” first. The script:
  1. Checks that the machine is 64-bit Windows — AgenShield for Windows does not yet support 32-bit or ARM devices, and the script stops with a clear message on those rather than installing something that cannot run.
  2. Resolves the latest version for your organization’s release channel (or a pinned version), downloads the installer package, and verifies it against AgenShield’s release records before installing anything.
  3. Stages your organization’s enrollment token so the installer can enroll the device without anyone typing anything in — including on a machine with no one signed in yet.
  4. Installs silently, which registers AgenShield as a Windows service (so it starts automatically at boot) and installs the tray app.
As with macOS, no user login is required for protection to start. The device is enrolled and begins enforcing your organization’s policy immediately; signing in later (from the tray app) only adds rules scoped to your user, team, or group. Windows may show a publisher warning the first time you run the installer, and an unattended install that passes the enrollment token directly on the install command can fail to enroll on some non-English Windows editions — see Windows install warnings if you hit either.

What a macOS install does

For either macOS entry point above (campaign or manual install), installation performs these steps:
  1. Downloads the signed software. The app bundle and command-line tool, all code-signed and Apple-notarized.
  2. Enrolls the Mac with your organization. The device generates its own cryptographic identity locally and registers against your organization’s AgenShield backend using the enrollment token from the install link. The private half of that identity never leaves the machine, and every later request is signed with it rather than with a shared secret or bearer token.
  3. Installs the app and its extensions. /Applications/AgenShield.app is installed; launching it activates the two system extensions. See What gets installed for what each is responsible for.
  4. Starts the background service. The service is registered to run at boot, and a per-user item starts the menubar app at login. The service begins syncing your organization’s policy immediately.
No user login is required for protection to start. The Mac is enrolled as a device and enforces the policy it receives; signing in later only adds rules scoped to your user, team, or group. Afterwards, agenshield status --install reports what is installed, which components are active, and whether the Mac is enrolled.

What a Windows install does

The Windows installer performs these steps, whether run from the install link or the installer package directly:
  1. Verifies the installer. Its checksum is checked against AgenShield’s release records before anything is installed.
  2. Enrolls the device with your organization — if enrollment data is available. A token can reach the installer three ways: the install script’s staged handoff (the campaign install above), a Group Policy or Intune-managed push, or a token passed directly on the installer’s command line. Whichever supplies it, the device generates its own cryptographic identity locally and registers with that token — the same model as macOS, so no shared secret or bearer token is used for later requests. Running the installer package directly, with none of those three sources present, installs the software but leaves the device unenrolled: the background service runs, but no organization policy has been pulled and nothing is protected until enrollment completes — either by supplying a token afterward, or automatically once a managed policy push arrives. See Windows install warnings if an unattended install did not enroll.
  3. Installs the background service and the tray app. The service is registered to start automatically at boot. Once the device is enrolled, it syncs your organization’s policy and enforces your organization’s network policy; the tray app gives the signed-in user status and controls.
No user login is required for protection to start. Once enrolled, the device enforces the policy it receives immediately; signing in later (from the tray app) only adds rules scoped to your user, team, or group. Enrollment state and policy for a Windows install live under %ProgramData%\AgenShield\ — the Windows analog of /opt/agenshield/config/ on macOS. Both the installer and the background service harden this directory to administrators only, and the background service independently verifies that hardening at every startup; enrollment refuses to read the staged enrollment data here until that verification passes.

Key files and locations

~/.agenshield/ holds this device’s enrollment credentials. It is created with owner-only permissions — do not loosen them, copy it between machines, or check it into a repository.

What you see during an update (macOS)

An update replaces the network extension and restarts the background service, so connections that are open at that moment can drop briefly. AgenShield tells the signed-in user with one notification that updates itself instead of stacking a new one for each step: An update that someone starts on the Mac — from the menu bar, the dashboard, or by running the installer — skips the one-minute warning. When nobody is signed in, the update runs at once and the result is shown at the next sign-in within a day. The notifications follow the user’s Focus and notification settings for AgenShield.

Uninstallation

The preferred path is the CLI’s own uninstall command; a campaign-served uninstall.sh and a manual fallback exist for when the binary is missing or damaged.

CLI-driven teardown (preferred)

No sudo needed — the command asks for your administrator password itself. agenshield uninstall performs a complete, ordered rollback: it stops enforcement, removes the services and configuration AgenShield created, deactivates the system extensions, removes the AgenShield certificate from the system trust store, and forgets the installer receipts. Apps that were already open during uninstall (terminals, IDEs) still point at ~/.agenshield/ca-bundle.pem until you restart them. So that they keep working over HTTPS, uninstall leaves that one file in place with the AgenShield certificate removed; the other trusted roots it held, including any your organization deploys, stay. Apps opened afterwards do not use it. Delete it once you have restarted those apps. To also purge stale extension versions that macOS has marked “waiting to uninstall on reboot”:
macOS usually refuses this while System Integrity Protection is on. Restarting the Mac always clears them — see AgenShield recommends restarting your Mac.

Campaign-served uninstall.sh

If AgenShield was installed from a campaign URL, it can be removed the same way:
Run by a person, it asks for your password once. It runs the agenshield uninstall --force command and then the manual cleanup below as a belt-and-suspenders step, so it still completes if the command line tool has been partially removed.

Unattended, through your MDM

Your MDM runs the uninstall script from the Uninstall section of your campaign’s MDM guide in the Frontegg Portal, as a script that runs as root:
It downloads the whole uninstall script before running it, so a failed download is reported as a failure, never as a success. It needs nobody at the Mac and asks nothing: it finds the signed-in user itself (or, with nobody signed in, the account AgenShield was installed for) and removes that account’s AgenShield files too. Its exit code tells your MDM how it went: A failed download exits with curl’s own code. Curl only rarely uses 1 or 2 (an unsupported protocol, or a failure to start), so if your MDM reports one of them and its log shows no AgenShield output, the script never ran. Then remove the AgenShield configuration profile from those Macs in your MDM. Uninstalling never removes a profile your MDM installed, and the root certificate that profile delivers stays trusted until the profile is removed.

Manual fallback

A last resort, not a routine path — use it only when the agenshield binary is missing or broken. On macOS, npx agenshield uninstall performs these steps automatically when the binary is gone but files remain (it removes them directly instead of bootstrapping the installer). Open the steps below only if that also fails.
Stop running services:
Deactivate the system extensions (the signed app bundle is what deactivates the extensions it activated):
Remove the CA trust and the CA environment variables. A leftover AgenShield root in the System keychain is a security risk, and the CA variables AgenShield set point at files that are about to be deleted. Left behind, they break HTTPS for curl, git, Python and Node in every app you open afterwards:
launchctl unsetenv only affects new launches — fully quit and reopen your terminal and GUI apps (Cursor, VS Code, JetBrains IDEs, Claude Desktop) so they drop the stale values, or run unset NODE_EXTRA_CA_CERTS SSL_CERT_FILE REQUESTS_CA_BUNDLE CARGO_HTTP_CAINFO GIT_SSL_CAINFO in any open shell.Remove plists and directories:
Remove user state. When installed via .pkg, the background service runs as root and its files in ~/.agenshield/ are root-owned, so sudo is required:
If you cannot restart your open apps right away, give them a CA bundle that holds only the macOS public roots, so they keep working over HTTPS:
Forget pkg receipts:

Verify a clean removal

macOS finalizes the removal of system extensions on the next reboot — until then they may show [terminated waiting to uninstall on reboot].

Troubleshooting

  • Operation not permitted on launchctl bootout — run with sudo; if it still fails, the service was already unloaded, so proceed.
  • Extension still shows [activated enabled] — the app bundle’s --uninstall-all failed (the app may already be gone). Reinstall the app and re-run the CLI uninstall, or run sudo systemextensionsctl uninstall 3R2X6557U2 com.frontegg.AgenShield.es-extension (and .network-extension) with developer mode enabled.
  • ~/.agenshield keeps being recreated — the background service LaunchDaemon is still bootstrapped; confirm the launchctl bootout step succeeded (no com.frontegg.AgenShield.daemon in sudo launchctl list).

Windows uninstall

Earlier Windows releases, up to and including the current beta, stop agenshield uninstall at once with a sudo error and remove nothing. Use the campaign’s uninstall command or Apps & features on those versions. The full Windows removal described here is in the release after 2026.11.0.

agenshield uninstall (preferred)

Open PowerShell or Terminal with Run as administrator, then run:
Run from a terminal that is not elevated, it stops with Run it from an elevated (Administrator) terminal and changes nothing. From an elevated terminal it removes AgenShield in this order:
  1. Signs the device out of your organization.
  2. Removes protection from your agents and restores your agent CLIs.
  3. Uninstalls the AgenShield package — the same removal Apps & features runs — which stops the background service, removes the security driver, and then removes what AgenShield added to every user profile on the device, signed in or not: the %LOCALAPPDATA%\AgenShield and %APPDATA%\AgenShield folders, and the certificate settings AgenShield wrote into the env block of Claude Code’s ~/.claude/settings.json. A setting is removed only when it holds the value AgenShield wrote:
    • NODE_EXTRA_CA_CERTS when it points at AgenShield’s certificate copy in that profile, %LOCALAPPDATA%\AgenShield\certs\mitm-ca.pem;
    • CLAUDE_CODE_CERT_STORE when it is bundled,system;
    • CLAUDE_CODE_CLIENT_CERT, CLAUDE_CODE_CLIENT_KEY and CLAUDE_CODE_CLIENT_KEY_PASSPHRASE when they equal the device-wide (system) environment variables of the same name, which AgenShield passed through. A variable set only in a user’s own environment does not count.
    Any other value, such as your own corporate certificate, is kept, and the command names the profile so you can check it. Other Claude Code settings are kept. A profile item it reaches only through a link to another location (a junction or symbolic link), or a settings file that is not valid JSON, is left as it is; the command names that profile, says why, and says what to delete by hand. Newer settings saves are never overwritten: a file being edited may be left in use, and the command names the profile. Any settings copies it could not delete are named too. A backup of the original settings is kept for you to compare or restore before deleting it by hand. When Folder Redirection or a similar policy moves a signed-in user’s AppData or LocalAppData folder, the folder is cleaned where it actually is, and at its default location too: on another local drive only when that user owns it, never solely because the Administrators group owns it. Windows and machine-program folders and other users’ profiles are never deleted through a redirected user setting. A folder left on a network share, or owned by another account, is named so you can delete it by hand if it is AgenShield’s. For signed-out users, or when the folder’s real location cannot be determined, only the default AppData locations are checked. The command says so once: where AppData is redirected, delete those users’ redirected AgenShield folders by hand, or have them run the uninstall command themselves.
  4. Removes the leftover folders (C:\Program Files\AgenShield, C:\ProgramData\AgenShield, and AgenShield’s system-account state) and the local accounts AgenShield created.
  5. Lists each user profile it cleaned, or left and why. Run as yourself, it then checks your own profile once more.
  6. Lists anything it could not remove under Still present:.
Users who are signed out keep their agent commands working: the package restores each profile’s agent CLIs and its PATH too, signed in or not. Releases up to and including 2026.11.2-beta.16153937 could not do this for a signed-out user with a routed agent: the removal then failed and Windows Installer put AgenShield back. Steps 3 and 4 run as a one-time Windows scheduled task, so the terminal window may close while the package is removed: removal continues and writes its outcome to a result file under C:\Windows\System32\config\systemprofile\AppData\Local\AgenShieldUninstall\, readable only by administrators. The command prints that file’s path before the package is removed. Removal needs the AgenShield installation’s own files: if they are missing or damaged, or removal does not start within two minutes, nothing is removed. The command then prints the package’s msiexec /x command as a suggestion; on a damaged installation use Apps & features (below) or contact support. If it reports restart Windows to finish (Windows Installer exit code 3010), restart to complete the removal. If it reports that the AgenShield certificate is still trusted, run the campaign’s Windows uninstall command (below) to remove it.

The campaign’s Windows uninstall command

The campaign detail view in the Frontegg Portal also offers a Windows Uninstall command. Paste it into a new PowerShell window of its own: the command ends by closing the window it runs in, with the command’s exit code. It asks for administrator approval itself if the window is not already elevated. See Install Campaigns for what it reports.

Apps & features or msiexec /x

Removing AgenShield from Settings → Apps → Installed apps, or with msiexec /x, also works, but:
  • it does not sign the device out of your organization — revoke the device in the Frontegg Portal afterwards (see Enrolled devices);
  • it can leave C:\ProgramData\AgenShield and the local accounts AgenShield created behind. Run agenshield uninstall first when you can. It does remove the certificate settings and AgenShield folders from user profiles, as above; what it leaves is recorded only in the Windows Installer log.
Restart if Windows Installer reports exit code 3010.

After removal

  • Cloud sign-out failed, or the device still appears in the Frontegg Portal — revoke it there.
  • Policy delivered by MDM or Group Policy is kept. Uninstall does not touch it; remove the assignment from your management tool.

Verify a clean removal (Windows)

In PowerShell:
Then confirm there is no AgenShield entry in Settings → Apps → Installed apps, and that the device is gone from the Devices page of the Frontegg Portal.
  • agenshield install — installs or repairs a self-managed installation.
  • agenshield activate — walks through the three macOS approvals.
  • agenshield status — confirms what is running after either operation.
  • agenshield doctor --cleanup-extensions — purges stale system extensions.
  • agenshield uninstall — the authoritative removal path.
Full list: CLI reference.

Next

After installing, grant the three macOS approvals and confirm the Mac is healthy — see the Quickstart. For a fleet, follow the rollout playbook.