Are you an LLM? You can read better optimized documentation at /docs/agent-guard/operations/uninstall.md for this page in Markdown format
Uninstall and clean up
agentguard uninstall removes Agent Guard's state, credentials, and data from your Mac. Use it when you are done with Agent Guard, when you want to start over from a clean slate, or when you are preparing a machine for someone else.
Run uninstall
bash
agentguard uninstallBy default, this removes:
- All Keychain entries Agent Guard created (
vm-claude-code-credentials,vm-gemini-credentials,vm-codex-credentials). - Credential staging files (
~/.agentguard/github-token,~/.agentguard/auth.json). - Every named environment under
~/.agentguard/vm/environments/. This includes installed packages, auth tokens, and overlay state for every workspace. - Configuration files:
state.json,ruleset.json,sandbox.sb,strict-sandbox.sb. - The policies directory:
~/.agentguard/policies/. - The bin directory:
~/.agentguard/bin/. - Process ID files and legacy audit logs inside
~/.agentguard/. - The top-level
~/.agentguard/directory if nothing else is left in it.
The agentguard binary itself in /usr/local/bin/ is left in place. Remove it yourself if you do not want it.
Preview the uninstall
Run with --dry-run to see exactly what would be removed without deleting anything:
bash
agentguard uninstall --dry-runUseful before running uninstall on a machine that has been used for a while, just to confirm what is about to disappear.
Keep your configuration
--keep-config preserves ~/.agentguard/config.json, which holds policy source references and registry authentication. Useful if you want to reset state but plan to reinstall Agent Guard later without re-running every agentguard policy add.
bash
agentguard uninstall --keep-configWhen --keep-config is set, the final sweep that removes the ~/.agentguard/ directory is also skipped, so the config file has somewhere to live.
What is intentionally preserved
~/Library/Logs/AgentGuard/ is not touched by uninstall. The policy audit log and the policy server log stay where they are.
This is intentional. If you later reinstall Agent Guard or need to forensically review what an agent did on this machine, the audit trail is still there. To wipe the logs as well, delete the directory manually:
bash
rm -rf ~/Library/Logs/AgentGuard/Do this only when you are sure you no longer need the audit history.
Clean up the rootfs cache separately
The 500 MB rootfs disk image lives at ~/.agentguard/vm/rootfs.img. It is removed when uninstall sweeps the ~/.agentguard/ directory at the end. If you used --keep-config (which skips the sweep) and want to reclaim that disk space, remove it manually:
bash
rm ~/.agentguard/vm/rootfs.imgIf you reinstall Agent Guard later, the next agentguard run will re-download the image.
Wipe Keychain entries manually
agentguard uninstall removes the Keychain entries it knows about. If you want to confirm nothing is left over, list them:
bash
security find-generic-password -s AgentGuardTo delete an entry by hand:
bash
security delete-generic-password -s AgentGuard -a vm-claude-code-credentials
security delete-generic-password -s AgentGuard -a vm-gemini-credentials
security delete-generic-password -s AgentGuard -a vm-codex-credentialsThis is mainly useful when a previous Agent Guard install left entries behind that the current install did not recognize.
Reinstalling later
If you uninstalled with the defaults (including config) and want to come back later, the install flow is identical to the first time. Curl the installer, configure policies, run your first agent. There is no state to migrate.
If you uninstalled with --keep-config and want to come back later, reinstall the binary and your configured policy sources will start syncing automatically on the next agentguard run.
Full cleanup checklist
For a complete removal with nothing left behind:
bash
agentguard uninstall # state, env, policies, config
rm -rf ~/Library/Logs/AgentGuard/ # audit logs
sudo rm /usr/local/bin/agentguard # the binary itself
# Optional: confirm no Keychain entries remain
security find-generic-password -s AgentGuard 2>&1 | grep -v "could not be found"After this, the machine has no trace of Agent Guard.
