> For the complete documentation index, see [llms.txt](https://herd-security.gitbook.io/herd-security-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://herd-security.gitbook.io/herd-security-docs/google-workspace/google-workspace-device-posture.md).

# Google Workspace Device Posture

Let Herd read the devices Google endpoint management lists for your Workspace, so a compromised phone counts toward a person's risk score.

Herd can read the devices Google endpoint management lists for your Workspace and count a compromised phone toward a person's **Account & access hygiene** risk factor. It is optional. User and group sync work without it.

## Turn it on

In the Google Admin console, open **Security → Access and data control → API controls → Domain-wide delegation**. Edit Herd's client ID and add either or both read-only scopes to the existing ones (comma-separated). The first setup is described in [Google Workspace](https://herd-security.gitbook.io/herd-security-docs/google-workspace/google-workspace.md).

| Scope                                                                      | What Herd reads                                                                                                                                               |
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `https://www.googleapis.com/auth/admin.directory.device.mobile.readonly`   | Mobile devices: the synced account's email, model, OS, approval status, whether Google detected the device compromised (rooted or jailbroken), and last sync. |
| `https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly` | ChromeOS devices: recent managed users and the assigned user, model, OS version, status and last sync.                                                        |

Both are read only. Herd never approves, blocks, wipes, disables or deprovisions a device. Herd reads them nightly, before risk scores are recalculated, with a separate token per scope. A missing scope stops only its own read and never the directory sync.

## How Google's device states count

| Google says                                                                   | Herd records                                                                                  |
| ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| Mobile, **Approved**, "Compromise detected"                                   | Managed, noncompliant: counts as **Signed in from a device that fails the compliance policy** |
| Mobile, **Approved**, "No compromise detected"                                | Managed, compliant                                                                            |
| Mobile, **Approved**, compromise status not reported                          | Managed, compliance not known (counts for nothing)                                            |
| Mobile, **Pending** approval, Blocked, Wiping/Wiped, Unprovisioned or Unknown | Not recorded: the device has no access to work data, or Google is not saying                  |
| ChromeOS, **Active**                                                          | Managed, compliance not known: Google reports no compliance verdict for a Chromebook          |
| ChromeOS, Disabled, Deprovisioned, Inactive, pre-provisioned or shipping      | Not recorded                                                                                  |

Google lists only the devices it manages, so Google devices never count as unmanaged. Personal devices outside management are reported by the sign-in sources (for example the Microsoft Entra sign-in log). People are matched to devices by email. A device stops counting 30 days after its last sync.

## When a scope is missing

If a scope is not in the delegation entry (Google refuses the token with `unauthorized_client`), or the admin Herd acts as may not read devices, the Google Workspace tile shows that device list as not measured. It names the scope to add. If the scope is already there, it tells you to give the admin Herd acts as a role that can read devices.

Devices Herd recorded from that list earlier stop counting once the refusal repeats the next night, because one refusal can be Google's own hiccup. A read that fails for any other reason (a timeout, throttling) is retried the next night and changes nothing. A complete read is the whole inventory, so a device Google no longer lists as approved or active (blocked, wiped, deprovisioned) stops counting on that read.
