---
title: "Keep hardened runtime exceptions to the · Agent Wranglers"
url: https://agentwranglers.se/playbook/desktop-apps/signing-and-notarisation/mac-entitlements
id: DSK-33
level: Recommended
updated: 2026-10-27
build: a2a6bdfed830
tokens: 1089
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Keep hardened runtime exceptions to the few the app uses

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

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

- ID: DSK-33
- Level: Recommended
- Chapter: [Signing and notarisation](https://agentwranglers.se/playbook/desktop-apps/signing-and-notarisation.md)
- Rule: Sign Mac apps with a written list of hardened runtime exceptions and resource entitlements, each with a reason. Ship no exception the app does not use, and put exceptions only on executables, never on libraries.
- Check: A CI step runs `codesign -d --entitlements - --xml` on each executable in the release and compares the keys with the approved list in the repository. It fails on any key the list does not hold, and on `get-task-allow` in a release build.
- How: The hardened runtime blocks code injection, library swaps and writable executable memory. Each exception turns one of those protections off. Apple's documentation says to use only the entitlements the app's features cannot work without. An app whose JavaScript engine compiles code at run time, such as an Electron app, may need `com.apple.security.cs.allow-jit`. Most apps need none of `allow-unsigned-executable-memory`, `allow-dyld-environment-variables` or `disable-library-validation`. Those last two together let any program load its own library into yours, which [load libraries only from folders attackers cannot write](https://agentwranglers.se/playbook/desktop-apps/installs-and-local-privileges/safe-library-loading.md) guards against. Resource entitlements such as camera or microphone follow [ask for system permissions only when a feature needs them](https://agentwranglers.se/playbook/desktop-apps/installs-and-local-privileges/privacy-prompts.md). Sign helpers and frameworks with their own, shorter lists, as [sign and notarise every Mac build](https://agentwranglers.se/playbook/desktop-apps/signing-and-notarisation/mac-notarisation.md) does for the app.

## 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.

### XML example

```xml
<!-- entitlements.mac.plist: one exception, because Electron's JavaScript engine compiles code at run time -->
<plist version="1.0">
<dict>
  <key>com.apple.security.cs.allow-jit</key>
  <true/>
</dict>
</plist>
```

### Shell example

```bash
codesign -d --entitlements - --xml "Ledgerly.app/Contents/MacOS/Ledgerly" | plutil -convert json -o - - \
  | jq -r 'keys[]' | sort > found.txt
diff found.txt approved-entitlements.txt
```

## Sources

- [Apple, Hardened Runtime](https://developer.apple.com/documentation/security/hardened-runtime)
- [Apple, Configuring the hardened runtime](https://developer.apple.com/documentation/xcode/configuring-the-hardened-runtime)

## Related rules

- DSK-27 [Load libraries only from folders attackers cannot write](https://agentwranglers.se/playbook/desktop-apps/installs-and-local-privileges/safe-library-loading.md) in Desktop apps and extensions
- DSK-39 [Ask for system permissions only when a feature needs them](https://agentwranglers.se/playbook/desktop-apps/installs-and-local-privileges/privacy-prompts.md) in Desktop apps and extensions
- DSK-1 [Sign and notarise every Mac build](https://agentwranglers.se/playbook/desktop-apps/signing-and-notarisation/mac-notarisation.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/signing-and-notarisation/mac-entitlements">Agent Wranglers desktop apps and extensions playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Sign Linux packages and the repository that serves them](https://agentwranglers.se/playbook/desktop-apps/signing-and-notarisation/linux-package-signing.md)
- [Signing and notarisation](https://agentwranglers.se/playbook/desktop-apps/signing-and-notarisation.md)
