---
title: "Start at login only after the user turns · Agent Wranglers"
url: https://agentwranglers.se/playbook/desktop-apps/installs-and-local-privileges/login-item-consent
id: DSK-29
level: Recommended
updated: 2026-10-22
build: a2a6bdfed830
tokens: 926
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Start at login only after the user turns it on

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Installs and local privileges](https://agentwranglers.se/playbook/desktop-apps/installs-and-local-privileges.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: DSK-29
- Level: Recommended
- Chapter: [Installs and local privileges](https://agentwranglers.se/playbook/desktop-apps/installs-and-local-privileges.md)
- Rule: Add the app to the login items or startup list only when the user turns on a switch in its settings. The switch starts off. Stop every background process when the user quits, unless they chose to keep one running.
- Check: On a fresh install on each platform, the login items and startup lists hold no entry for the app. Turning the switch on adds one, and turning it off or uninstalling removes it. After the user quits, no process of the app is left running.
- How: Apple's App Review Guideline 2.4.5(iii) forbids Mac App Store apps to launch at login without consent. It also forbids processes that keep running after the user quits. People who find an unwanted startup entry often uninstall the app. On macOS 13 and later, register the app with `SMAppService.mainApp`. Electron offers `app.setLoginItemSettings`, and Windows packaged apps declare a startup task. Show the switch from the system's own state, since users can remove the entry in system settings. Remove the entry when the app is uninstalled. A helper that must keep running also follows [Check who is calling before a privileged helper acts](https://agentwranglers.se/playbook/desktop-apps/installs-and-local-privileges/privileged-helper-callers.md).

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
import { app } from 'electron';

export const setOpenAtLogin = enabled => app.setLoginItemSettings({ openAtLogin: enabled });
export const opensAtLogin = () => app.getLoginItemSettings().openAtLogin;
```

### Plain text example

```swift
import ServiceManagement

func setOpenAtLogin(_ enabled: Bool) throws {
    if enabled { try SMAppService.mainApp.register() } else { try SMAppService.mainApp.unregister() }
}

var opensAtLogin: Bool { SMAppService.mainApp.status == .enabled }
```

## Sources

- [Apple App Review Guidelines, 2.4.5](https://developer.apple.com/app-store/review/guidelines/)

## Related rules

- DSK-28 [Check who is calling before a privileged helper acts](https://agentwranglers.se/playbook/desktop-apps/installs-and-local-privileges/privileged-helper-callers.md) in Desktop apps and extensions

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/desktop-apps/installs-and-local-privileges/login-item-consent">Agent Wranglers desktop apps and extensions playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Check who is calling before a privileged helper acts](https://agentwranglers.se/playbook/desktop-apps/installs-and-local-privileges/privileged-helper-callers.md)
- Next: [Ask for system permissions only when a feature needs them](https://agentwranglers.se/playbook/desktop-apps/installs-and-local-privileges/privacy-prompts.md)
- [Installs and local privileges](https://agentwranglers.se/playbook/desktop-apps/installs-and-local-privileges.md)
