<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 4.0.0 -",
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSURL/BookmarkCreationOptions/withSecurityScope",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSURLBookmarkCreationOptions@NSURLBookmarkCreationWithSecurityScope"
  },
  "title" : "withSecurityScope"
}
-->

# withSecurityScope

Specifies that when creating a security-scoped bookmark, upon resolution, it provides a security-scoped URL allowing read/write access to a file-system resource.

```
static var withSecurityScope: NSURL.BookmarkCreationOptions { get }
```

## Discussion

For use in an app that adopts App Sandbox. For more information, see [App Sandbox Design Guide](https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AboutAppSandbox/AboutAppSandbox.html#//apple_ref/doc/uid/TP40011183).

> Note:
> This flag can’t be used in conjunction with either ``doc://com.apple.foundation/documentation/Foundation/NSURL/BookmarkCreationOptions/minimalBookmark`` or ``doc://com.apple.foundation/documentation/Foundation/NSURL/BookmarkCreationOptions/suitableForBookmarkFile``.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)