Warden — Getting Started
This guide covers the normal Warden rollout flow: install with MDM, write a first rule, test it, and then deploy rules to endpoints.
For practical use-case walkthroughs, see examples.md. For full rule syntax, see rules_reference.md.
1. Install Warden with MDM
Warden installation on managed macOS devices is a two-step push:
- Push the latest
warden-<version>.pkgfrom GitHub Releases (or in the Github Actions outputs while it is still in pre-release) - Push a managed
.mobileconfigpolicy for Warden
2. Write your first rule
Rules are YAML files. Create my-rules.yml:
version: 1
rules:
- id: remove-todo
description: Removes TODO comments from the file
file: notes.txt
patterns:
- contains: "TODO"
actions:
- delete:
Create a test file notes.txt:
This rule watches notes.txt. Whenever the file is saved with the substring TODO, Warden removes every occurrence. After enforcement:
The
deleteaction removes the exact matched text — in this case the literal stringTODO. It does not delete the whole line.
3. Test your rule before rollout
Use the test command to run a rule against a file and inspect the result.
Run a one-shot test with one rules file:
This enforces the rule and shows what matched. To evaluate without modifying
the file, add --dry-run:
Use this flow to validate rule behavior before adding rules to your managed policy or signed bundle.
4. Roll out rules to endpoints
After validation, deploy rules through the managed policy:
- Use
rules-urlfor hosted signed bundles - Use
rulesfor inline base64 rule entries - Use both for a baseline-plus-dynamic strategy
See MDM Configuration & Bundle Signing for the policy fields and signing workflow.
Next steps
- Rule Examples — walkthroughs for MCP enforcement, secret redaction, webhooks, and more.
- Rules Reference — every pattern type, action, and option.
- MDM Configuration & Bundle Signing — deploy rules to your fleet.