<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.5.0 - 10.6.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecHostSetGuestStatus",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecHostSetGuestStatus"
  },
  "title" : "SecHostSetGuestStatus"
}
-->

# SecHostSetGuestStatus

Updates the status and attributes of a particular guest.

```
OSStatus SecHostSetGuestStatus(SecGuestRef guestRef, uint32_t status, CFDictionaryRef attributes, SecCSFlags flags);
```

## Parameters

`guestRef`

The guest code object of the code on whose behalf this thread is acting.

`status`

A new set of code status flags for the guest (see [`SecCodeStatus`](/documentation/Security/SecCodeStatus). The host must enforce the restrictions on changes to guest status: the [`valid`](/documentation/Security/SecCodeStatus/valid) bit can only be cleared and the [`hard`](/documentation/Security/SecCodeStatus/hard) and [`kill`](/documentation/Security/SecCodeStatus/kill) flags can only be set. Pass the previous guest status to indicate that no change is desired.

`attributes`

A key-value dictionary of attributes that can be used to identify this particular guest among all of the caller’s guests. If you include this dictionary, it completely replaces earlier-specified attributes. Pass `NULL` for this parameter if you do not want to change the attributes for this guest. Although you can specify any key-value pairs in this attributes dictionary, the keys in [Guest Attribute Dictionary Keys](/documentation/Security/guest-attribute-dictionary-keys) are conventionally used for this purpose.

`flags`

Optional flags; see [`SecCSFlags`](/documentation/Security/SecCSFlags) for possible values. Pass `kSecCSDefaultFlags` for standard behavior.

## Return Value

A result code. See [Code Signing Services Result Codes](/documentation/Security/code-signing-services-result-codes).

## Discussion

This function must be called by a host acting in proxy mode every time the status of a guest changes so that Code Signing Services can update the information cache for that guest. The specified guest must have been created using the [`SecHostCreateGuest`](/documentation/Security/SecHostCreateGuest) function.

---

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)