<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecCodeStatus",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@E@SecCodeStatus"
  },
  "title" : "SecCodeStatus"
}
-->

# SecCodeStatus

Operational flags attached by code signing services to running code.

```
struct SecCodeStatus
```

## Overview

These flags are maintained by the code’s host, and can be read by anyone. Running code may change its own flags, and root may change anyone’s flags. However, each of these flags can change in only one direction and never back, for the lifetime of the code. Not even root can violate this restriction.

All of the bits in the [`SecCodeStatus`](/documentation/Security/SecCodeStatus) enumeration are reserved by Apple. If you set any bits not defined here, the behavior is undefined.

## Topics

### Initializers

[`init(rawValue:)`](/documentation/Security/SecCodeStatus/init(rawValue:))

### Constants

[`valid`](/documentation/Security/SecCodeStatus/valid)

The code is dynamically valid.

[`hard`](/documentation/Security/SecCodeStatus/hard)

The code prefers to be denied access to resources if gaining access would invalidate it.

[`kill`](/documentation/Security/SecCodeStatus/kill)

The code wants to be terminated if it ever loses its validity.

[`debugged`](/documentation/Security/SecCodeStatus/debugged)

The code has been debugged by another process that was allowed to do so.

[`platform`](/documentation/Security/SecCodeStatus/platform)

The code ships with the operating system and is signed by Apple.



---

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)