T06 · System Persistence
- Location
modules/macos-patterns.md:75- Finding
Persistent macOS Launch Agent Registration Without Adequate Safety Gates
- Content
View full analysis
Label com.example.myagent ProgramArguments /usr/local/bin/myagent RunAtLoad ``` ```text User-scoped agents go in `~/Library/LaunchAgents/`. System-scoped daemons go in `/Library/LaunchDaemons/` and require root. Load with `launchctl load -w `, unload with `launchctl unload`. ``` ### Technical Analysis The module documents the essential components needed to register an executable as a persistent macOS `launchd` service: - `ProgramArguments` specifies the executable launched by the service. - `RunAtLoad` causes execution when the service is loaded. - Placement under `~/Library/LaunchAgents/` enables per-user startup persistence. - Placement under `/Library/LaunchDaemons/` enables system-wide persistence and requires elevated privileges. - `launchctl load -w` persistently enables the service. The declared purpose of the Skill is progressive module loading and token-budget management. Installing an operating-system startup service is not necessary for that purpose and exceeds its minimum required privileges. The documentation does not require explicit user authorization before registration, validate the executable's ownership or provenance, restrict deployment to user scope, or require review of the generated property list. Although the Skill does not automatically execute this command, an ...[truncated 1346 chars]- Remediation
View remediation
