macOS is a well-secured operating system, but that security depends heavily on the assumption that software running on your Mac was intentionally installed by you. The reality is that adware, spyware, and outright malware routinely find their way onto Macs — and once installed, they go to considerable lengths to stay there. The mechanism they rely on is the same one Apple provides for legitimate background software: LaunchAgents and LaunchDaemons.
Understanding how these persistence mechanisms work is the single most effective thing you can do to assess whether your Mac is clean. This guide explains how macOS malware persists, what the common persistence paths look like, and how to tell a legitimate LaunchAgent from a suspicious one. TrimyMac's Security Scan lists LaunchAgents and LaunchDaemons for you to review; it does not judge whether they are safe.
~/Library/LaunchAgents/, /Library/LaunchAgents/, and /Library/LaunchDaemons/ for plist files with random names or paths pointing to /tmp. TrimyMac's Security Scan lists files from those folders that a storage scan already collected, and labels each one Unknown for you to review.
How macOS Malware Persists After Reboot
Most malware has one primary goal beyond its payload: survive a reboot. A malicious process that dies when you log out is far less dangerous than one that reliably restarts itself every time macOS loads. macOS provides several legitimate mechanisms for launching background processes automatically, and malware exploits all of them.
LaunchAgents
Most AbusedLaunchAgents are property list (plist) files that instruct launchd — macOS's system process manager — to launch a program when a specific user logs in. They run in the user's context, meaning they have access to your files, browser data, and keychain. Per-user LaunchAgents live in ~/Library/LaunchAgents/; system-wide ones live in /Library/LaunchAgents/.
LaunchAgents are the most abused persistence path on macOS because they require no administrator password to install in the per-user location, and they are invisible to casual inspection — they sit in a hidden Library folder and run silently in the background.
LaunchDaemons
Requires AdminLaunchDaemons are similar to LaunchAgents but run as root at system boot — before any user logs in. They have significantly elevated privileges. Installing a LaunchDaemon requires administrator access, which is why malware distributed through fake software installers that request your password often uses this path. LaunchDaemons live exclusively in /Library/LaunchDaemons/ and /System/Library/LaunchDaemons/ (the latter is Apple-only and protected by System Integrity Protection).
Login Items
Visible in SettingsLogin Items are apps or helper tools configured to open when you log in. In macOS Ventura and later, they are visible and manageable in System Settings > General > Login Items & Extensions. Malware sometimes uses this mechanism because it is easy to add programmatically, though it is also easier for users to spot and remove. Legacy Login Items from older macOS versions can still lurk in ~/Library/Preferences/com.apple.loginwindow.plist.
Cron Jobs
Rarely Used NowThe Unix cron scheduler was the standard for scheduled tasks before launchd replaced it on macOS. While Apple deprecated cron in favor of LaunchAgents, the crontab system still works fully on macOS and is occasionally used by older adware or scripts that need to run on a time schedule rather than at login. User cron jobs are stored per-user by the system; system-wide cron jobs live in /etc/cron.d/ and /etc/periodic/.
The Most Common Persistence Paths Malware Uses
When security researchers analyze macOS malware samples, a handful of paths appear again and again. Knowing these by heart lets you do a targeted manual check in minutes. The table below shows the most frequently abused locations, ranked by prevalence in real malware samples:
| Path | Mechanism | Privilege required |
|---|---|---|
~/Library/LaunchAgents/ |
LaunchAgent (per-user) | None — any app can write here |
/Library/LaunchAgents/ |
LaunchAgent (all users) | Admin password |
/Library/LaunchDaemons/ |
LaunchDaemon (root) | Admin password |
~/Library/Application Support/ |
Helper binaries called by LaunchAgents | None |
/tmp/ or /var/folders/ |
Staging area for payloads | None |
/Library/PrivilegedHelperTools/ |
Privileged helper (XPC) | Admin password at install |
~/Library/Preferences/com.apple.loginwindow.plist |
Legacy Login Items | None |
The per-user LaunchAgents folder is by far the most commonly abused because it requires no elevated privileges. A malicious installer, a malicious DMG you mounted, or even a malicious browser extension can drop a plist file there without ever asking for your password.
What a Legitimate LaunchAgent Looks Like
Before you start removing plist files, it is important to understand what a legitimate LaunchAgent looks like. Many real, useful applications use LaunchAgents — Dropbox, 1Password, software updaters, and developer tools all rely on them. Deleting the wrong plist file can break real software.
Anatomy of a Legitimate LaunchAgent Plist
A well-written LaunchAgent from a legitimate app has several identifiable characteristics:
Reverse domain name label: The plist filename and its Label key follow Apple's recommended reverse domain name notation — for example, com.dropbox.DropboxMacUpdate.agent.plist or com.1password.1password-helper.plist. This naming convention mirrors the Bundle ID of the parent application and makes it immediately clear which app owns the agent.
Signed binary: The ProgramArguments key in the plist points to an executable that is code-signed by a verified Apple Developer certificate. You can verify this yourself by running codesign -dv --verbose=2 /path/to/binary in Terminal. A signed binary shows a team identifier like TeamIdentifier=AB12CD34EF.
Sensible program path: The binary the LaunchAgent launches lives in a sensible, permanent location — typically inside the application bundle itself (e.g., /Applications/Dropbox.app/Contents/MacOS/) or in /Library/Application Support/VendorName/. The path is predictable, readable, and directly associated with software you remember installing.
Reasonable keys: Legitimate LaunchAgents use standard keys: RunAtLoad set to true, a Label matching the filename, and clean ProgramArguments. They do not use obfuscated base64 arguments, shell pipes, or inline scripts in the arguments array.
Red Flags: Signs of a Suspicious or Malicious LaunchAgent
launchd for you.
Malicious LaunchAgents tend to have a very different fingerprint from legitimate ones. Here are the most reliable warning signs:
Points to /tmp or a Temporary Path
Any LaunchAgent whose ProgramArguments points to a binary inside /tmp/, /var/folders/, or any other temporary directory is an immediate red flag. Legitimate software never stores its executables in temporary directories. Malware uses /tmp because it is world-writable and because the binary can be replaced or updated without any privilege escalation. If you see a path like /tmp/update_helper or /var/folders/xy/randomstring/T/launcher, treat it as malicious until proven otherwise.
Random UUID or Meaningless Name
Malware frequently generates random filenames to avoid detection by name-based signature tools. A plist named com.apple.mdworker.bkd.plist that is not inside /System/Library/ is suspicious (malware often mimics Apple's own naming patterns). A plist named something like 4f8a2c1b-9e3d-47f2-b6a0-2d1e9f3c8741.plist or com.update.service.helper.plist with no clear association to any installed application is almost certainly malicious.
Unsigned or Revoked Binary
Running codesign --verify --verbose /path/to/binary on the binary pointed to by a suspicious LaunchAgent will tell you immediately whether it is signed. If the output is code object is not signed at all or shows a revoked certificate, that is a serious red flag. Most legitimate background processes on a modern Mac are signed and notarized.
Shell Script as the Program
A LaunchAgent that launches /bin/sh or /bin/bash with a script as its argument — especially if the script is stored in a hidden directory, uses obfuscated variable names, or downloads content from the internet — is almost certainly malicious. Legitimate apps use compiled binaries for their background helpers, not shell scripts.
Unusual Keys or Encoded Payloads
Look for the presence of unusual plist keys such as EnvironmentVariables with encoded strings, StartInterval set to a very short interval like 30 seconds (suggesting polling for commands), or WatchPaths that monitor sensitive locations like your Downloads folder or Desktop.
TrimyMac Security Scan
Security Scan does not check code signatures, Login Items, or cron, and it does not decide that a file is safe or malicious. It lists files for you to review.
Run a storage scan first. AppModel.runSecurityScan in Sources/SpaceGuard/AppModel.swift passes that scan's file list to SecurityScanner.scan in Sources/SpaceGuard/Security.swift, with a new MalwareSignatureDatabase(). The signature database is empty: its hash list starts empty, so the hash check is skipped. The scanner then keeps every file that is not a directory and whose path contains /Library/LaunchAgents/ or /Library/LaunchDaemons/. Those checks cover three folders when the storage scan included them: ~/Library/LaunchAgents, /Library/LaunchAgents, and /Library/LaunchDaemons. A storage scan starts in your home folder unless you choose another root (selectedRoot in AppModel.swift), so the usual result is files under ~/Library/LaunchAgents. The two /Library folders appear only when that root included them. FileScanner in Sources/SpaceGuard/FileServices.swift skips /System, so Apple's copies under /System/Library are not listed. Each match is labeled Unknown, with the reason “Persistence location — review recommended.”
What the Security screen shows
- If you have not scanned storage yet, the Security screen says a storage scan is needed first. Run Security Scan stays disabled until that scan has files.
- Open Security in the sidebar and click Run Security Scan. The dashboard Security Scan button starts the same scan.
- Each match is one row: the Unknown label, the reason above, and the file path. There is no detail view for a signature status or a score.
- A file inside your home folder has Remove. Confirming it calls
removeFinding, which moves that one file to the Trash. A file outside your home folder is marked Protected, and the app does not remove it. The app does not unload the job inlaunchd, and it does not delete a separate program the plist points at.
How to Remove a LaunchAgent You Do Not Want
Security Scan only labels matches Unknown. If you decide a listed file should go, move a home-folder file to the Trash from the Security screen, or remove it yourself in Terminal.
Using TrimyMac
- Run a storage scan, then open Security and click Run Security Scan.
- Read the path on the row. Look up anything you do not recognize before you remove it.
- For a file inside your home folder, click Remove and confirm Move to Trash. That moves only that file. Files outside your home folder are shown as Protected.
Moving a plist to the Trash does not tell launchd to stop a job that is already running. Unload it in Terminal, then restart, if you want it gone immediately.
Manual Removal via Terminal
If you prefer to handle this without TrimyMac, you can remove a LaunchAgent manually. First, unload it from launchd to stop it immediately without waiting for a reboot:
rm, move the file to your Desktop first (mv suspicious.plist ~/Desktop/). This way you can restore it instantly if you realize you deleted something legitimate, rather than losing the file permanently.
After removing a LaunchDaemon (which requires admin access), use sudo launchctl unload /Library/LaunchDaemons/suspicious.plist and then sudo rm /Library/LaunchDaemons/suspicious.plist. You will be prompted for your administrator password.
Scan Your Mac's Persistence Paths in Seconds
Lists LaunchAgents and LaunchDaemons for you to review; it does not judge whether they are safe. Scan results stay on your Mac.
Download TrimyMac Free → macOS 14 Sonoma or later · Free to download · No account requiredAfter Removing Malware: What to Check Next
Removing a LaunchAgent or LaunchDaemon is a good start, but sophisticated malware often installs multiple persistence mechanisms simultaneously. After removing a confirmed malicious entry, run through this checklist to ensure nothing was missed:
Check the other persistence paths yourself. Security Scan does not read Login Items or cron. Some malware installs a second LaunchAgent that puts the first one back. After you remove one, look again in ~/Library/LaunchAgents, /Library/LaunchAgents, and /Library/LaunchDaemons, then check Login Items and cron as described earlier in this guide.
Check your browser extensions. Many Mac adware infections originate from malicious browser extensions and use a companion LaunchAgent to ensure the extension cannot be permanently removed. After removing the LaunchAgent, go through your browser extensions in Safari (Safari > Settings > Extensions), Chrome (chrome://extensions), and Firefox (about:addons) and remove any you do not recognize.
Check for unauthorized profiles. Configuration profiles installed by malware can redirect DNS, install root certificates, or force-install browser extensions. Go to System Settings > Privacy & Security > Profiles (or System Preferences > Profiles on older macOS). If you see any profile you did not install yourself, remove it.
Change passwords for sensitive accounts. If the malware you removed was a keylogger or credential stealer (common categories of Mac spyware), change passwords for your email, financial accounts, and Apple ID. Enable two-factor authentication on any account that does not already have it.
Frequently Asked Questions
How do I check if my Mac has malware?
The most reliable method is to inspect your Mac's persistence paths — the locations where software registers itself to run automatically at login or boot. Open Finder, press Command + Shift + G, and navigate to ~/Library/LaunchAgents/. Examine the plist files there: legitimate entries have reverse domain name labels like com.dropbox.agent.plist; suspicious ones have UUID-style names or point to binaries in /tmp/.
For a faster list of files already found by a storage scan, TrimyMac's Security Scan lists LaunchAgents and LaunchDaemons for you to review; it does not judge whether they are safe.
What is a LaunchAgent on Mac?
A LaunchAgent is a property list (plist) configuration file that tells macOS's process manager (launchd) to automatically start a specific program when a user logs in. LaunchAgents run in the context of the logged-in user, meaning they have access to user files, browser data, and the keychain.
LaunchAgents are used by many legitimate applications — Dropbox, 1Password, software update daemons, and developer tools all use them. The problem is that macOS requires no special permission to install a LaunchAgent in the per-user folder (~/Library/LaunchAgents/), which makes it a favorite persistence mechanism for malware and adware.
How does Mac malware persist after a restart?
macOS malware achieves persistence primarily through four mechanisms: LaunchAgents (which run at user login), LaunchDaemons (which run at system boot as root), Login Items (visible in System Settings), and cron jobs (scheduled recurring tasks). LaunchAgents and LaunchDaemons are the most common because they are reliable, run silently, and — in the case of per-user LaunchAgents — require no administrator password to install.
When you restart your Mac, launchd reads all plist files from these persistence directories and starts the corresponding processes automatically. This means malware that has installed a LaunchAgent will restart itself invisibly every time you log in, regardless of how many times you force-quit it.
How do I remove malware from my Mac?
The most important step is to remove the persistence mechanism, not just kill the malicious process. Killing a process without removing its LaunchAgent means it will simply restart at the next login.
To remove malware from your Mac: first, identify the malicious LaunchAgent plist by inspecting ~/Library/LaunchAgents/, or read the Unknown rows from a Security Scan. Then unload it with launchctl unload ~/Library/LaunchAgents/malicious.plist in Terminal. Delete the plist file and the binary it points to. Restart your Mac. Finally, check your browser extensions and system profiles for any additional components. Security Scan can move one home-folder file to the Trash. It does not unload the job, and it does not hold the file for 30 days.
What do LaunchAgents do on Mac?
LaunchAgents instruct macOS to automatically launch background processes when a user logs in. They are used for tasks that need to run continuously in the background: syncing files (Dropbox, iCloud), checking for updates (many apps), running helper processes (1Password mini), monitoring folder changes (backup software), and more.
Each LaunchAgent is a plist file specifying what binary to run, when to run it (at login, on a schedule, or when triggered by a file change), whether to restart it if it crashes (KeepAlive), and what environment to run it in. Malware exploits the same mechanism to keep its payload running persistently alongside legitimate software.
Can I safely delete all unknown LaunchAgents on my Mac?
No — blindly deleting all unknown entries can break legitimate software. Many utilities, developer tools, and small apps install LaunchAgents that are perfectly safe but simply not well-known enough to appear in threat databases. Before deleting any entry, look up the label name and binary path online to identify what software installed it.
TrimyMac lists LaunchAgents and LaunchDaemons for you to review; it does not judge whether they are safe. If you are unsure, move the file to your Desktop before you delete it so you can put it back.
What is the difference between a LaunchAgent and a LaunchDaemon?
The key difference is privilege level and when they run. LaunchAgents run in the context of a logged-in user — they start when a user logs in and have that user's privileges. They can be installed in a per-user folder without administrator access. LaunchDaemons run as root at system boot, before any user logs in. They have full system privileges and require administrator access to install.
From a security perspective, a malicious LaunchDaemon is significantly more dangerous than a malicious LaunchAgent because it runs as root and can modify system files, bypass security controls, and persist even across user account changes. However, LaunchDaemons are rarer in malware because they require the user to enter an administrator password during installation — which makes their installation more visible.
Summary
macOS is secure by design, but no operating system is immune to software that a user knowingly or unknowingly installs. LaunchAgents and LaunchDaemons are the primary tools that both legitimate applications and malware use to persist across reboots. The difference between the two is usually visible in the details: a reverse domain name label, a signed binary in a predictable path, and sensible plist keys are hallmarks of legitimate software. A UUID-style name, a binary in /tmp, or an unsigned executable are hallmarks of something that should not be there.
Regular inspection of your Mac's persistence paths is the single most effective proactive security measure available to macOS users outside of keeping the OS updated. TrimyMac's Security Scan lists LaunchAgents and LaunchDaemons for you to review; it does not judge whether they are safe.
Check Your Mac for Suspicious Persistence Entries
Lists LaunchAgents and LaunchDaemons for you to review; it does not judge whether they are safe. Files and scan results stay on your Mac, and TrimyMac connects only to check the license with Lemon Squeezy and to check trimymac.com for updates.
Download TrimyMac Free → macOS 14 Sonoma or later · No account required · Scan results stay on your Mac