Challenges and verdicts
Every attestation is a challenge and an answer. Your server issues a challenge that says what the device has to prove, the device answers it, and your server passes the answer to verify for a verdict.
const { nonce, challenge } = await rh.issueChallenge({
ask: ["identity", "posture"],
});
const result = await rh.verify(evidence, { nonce });Choose what to ask for
The ask says what the device has to prove. Ask for what you'll act on: a smaller ask produces a smaller verdict. Posture includes identity. Leave ask out and you get identity, plus posture if your key has a posture policy.
| ask | Device proves | Collected | Verdict adds |
|---|---|---|---|
| identity | Same enrolled installation as before. | Quote over PCR 7. No event log. | ueid, quoteVerified, real-device. |
| posture | How it booted. | PCRs 0–4 and 7, event log, Secure Boot variables. | Boot booleans, trustworthinessVector, cohort block, secure-boot / oem-keyed. |
Not every client can answer every ask: a Mac and an iPhone answer identity only. A client refuses an ask it can't serve before it touches the network, with AskUnsupportedError or RH_ERR_ASK_UNSUPPORTED; ask for less. A posture ask also needs a posture policy on your key, or issueChallenge fails with 422 posture_not_bound. An ask that isn't identity or posture fails with 400 invalid_ask. Keys are minted by their own ceremony, never by a challenge; see Mint a key.
Send the challenge to the client
issueChallenge gives you two things. Send the challenge string to the client as it is, without parsing it: the client reads the ask from it, and Root Herald has tied the ask and your key's policy to it, so evidence for a tampered challenge is refused. The nonce is how verify finds the challenge again; keep it, or send it along and have it come back with the answer.
A challenge works once and expires after five minutes. Every challenge string starts with rhc1., and the clients refuse anything else.
Bind the challenge to a device
Pass expectedDevices with the device IDs you expect, or expectedKey with a key ID you kept, when you issue the challenge, and pass the same values to verify. A verdict from any other device fails with reason.code expected_device_mismatch and carries no facts about the device that answered; the mismatch counts as a verify. An ID your account doesn't know fails issueChallenge with 422 expected_unknown. The verdict echoes what was enforced under expected, and verify refuses a verdict that does not echo what you passed.
app.post("/challenge", async (req, res) => {
const deviceId = await deviceOf(accountOf(req));
const { nonce, challenge } = await rh.issueChallenge({
ask: ["identity"],
expectedDevices: [deviceId],
});
await rememberNonce(accountOf(req), nonce);
res.json({ nonce, challenge });
});
app.post("/attest", async (req, res) => {
const { nonce, evidence } = req.body;
const deviceId = await deviceOf(accountOf(req));
const result = await rh.verify(evidence, {
nonce,
expectedDevices: [deviceId],
});
if (result.device.verdict !== "pass") {
return res.sendStatus(403);
}
res.sendStatus(204);
});Answer on the client
Use RootHeraldAttest with the attestation key blob to sign the challenge with the TPM and write the evidence into a buffer, then post the evidence and the nonce to your server. Size the buffer as the Native C SDK page describes.
size_t n;
if (!load_ak_blob(ak, sizeof ak, &ak_len)) {
return enroll_then_attest();
}
RH_STATUS st = RootHeraldAttest(rh, challenge, ak, ak_len,
evidence, sizeof evidence, &n);
if (st != RH_OK) {
return 0;
}
post_evidence("/attest", nonce, evidence);With no attestation key blob stored, enroll first; if the blob no longer loads, you get RH_ERR_KEY_UNLOADABLE. See When to enroll.
Verify on your server
Pass the evidence and the nonce to verify. Root Herald finds the challenge by its nonce, checks the evidence against the policy that challenge was issued under, and returns the verdict on the same call. The verdict stays on your server; tell the client only what you decide.
app.post("/attest", async (req, res) => {
const { nonce, evidence } = req.body;
const result = await rh.verify(evidence, { nonce });
if (result.enrollmentRequired) {
return res.json({ enroll: true });
}
if (result.device.verdict === "fail") {
return res.sendStatus(403);
}
res.sendStatus(204);
});verify returns normally, with device.verdict set to fail or warn. Only problems with your key, the challenge, the evidence, the policy or your quota come back as errors; the codes are in the API reference.
Read the verdict
Fields are either present or left out, never null. A smaller ask gives a smaller verdict, and a policy that needs a field your ask didn't collect fails the device.
| Field | Type | Meaning |
|---|---|---|
| assuranceClaimsMet | string[] | rootherald:assurance:* URNs the device satisfied. |
| enrollmentRequired | boolean | No live installation of yours signed the proof. Enroll it, then start again with a fresh challenge. |
| verdict.acr | URN | urn:rootherald:device:any or urn:rootherald:device:high: the tier the device met. |
| verdict.amr | string[] | The method, per RFC 8176: ["hwk_tpm"] on every platform today, and empty when the device isn't enrolled. |
| verdict.userId | uuid | The device's ueid; on this path the device is the principal. |
| verdict.authTime / expiresAt | ISO-8601 | When the device was appraised, and when the verdict stops being fresh, five minutes later; both the same moment when the device isn't enrolled. |
| verdict.expected | { key?, devices? } | What the challenge bound and the server enforced. Present only when the challenge named a key or devices. |
| verdict.reason | { code, text } | On a warn or a fail, the rule that decided it: a code from a fixed set, and one line naming it. Absent on a pass. |
| device.ueid | uuid | The device's ID: the one enrollment returned. |
| device.verdict | pass | warn | fail | The outcome. |
| device.earStatus | affirming | warning | contraindicated | The IETF EAR tier: allow, step up, deny. |
| device.attestationType | tpm20 | apple-se | ios-appattest | unknown | Which root of trust produced the evidence; unknown when the device isn't enrolled. |
| device.quoteVerified | boolean | The quote's signature verified against the installation's attestation key. |
| device.secureBootVerified | boolean | A quote-bound event log showed Secure Boot on. Posture ask only. |
| device.eventLogVerified | boolean | The event log replayed to the signed PCRs. Posture ask only. |
| device.platform | windows | linux | macos | ios | The platform of the installation that answered. Left out when unknown. |
| device.hardwareModel | string | A finer model, when known; usually left out today. |
| device.trustworthinessVector | Record<string, int> | AR4SI tiers for instance-identity, configuration, executables and hardware. |
| device.cohort* | block | cohortPrevalence, cohortPrevalencePerPcr, novelProfile, cohortScope, cohortKey, cohortSampleSize. Advisory; see Policies. |
{
"verdict": {
"acr": "urn:rootherald:device:high",
"amr": ["hwk_tpm"],
"authTime": "2026-07-03T17:08:13Z",
"expiresAt": "2026-07-03T17:13:13Z",
"userId": "1ade0832-6a16-cf50-a2bd-2a5c4cb498a5",
"expected": { "devices": ["1ade0832-6a16-cf50-a2bd-2a5c4cb498a5"] },
"device": {
"ueid": "1ade0832-6a16-cf50-a2bd-2a5c4cb498a5",
"verdict": "pass",
"earStatus": "affirming",
"attestationType": "tpm20",
"platform": "windows",
"quoteVerified": true,
"secureBootVerified": true,
"eventLogVerified": true,
"trustworthinessVector": { "instance-identity": 2, "configuration": 2, "executables": 2, "hardware": 2 }
}
},
"assuranceClaimsMet": ["rootherald:assurance:real-device", "rootherald:assurance:secure-boot", "rootherald:assurance:oem-keyed"],
"enrollmentRequired": false
}Gate on assurance claims
Rather than checking which platform a device is, check the claims you need: allow the request when every claim you require is in assuranceClaimsMet.
const required = ["rootherald:assurance:secure-boot"];
const met = result.assuranceClaimsMet ?? [];
const allowed = required.every((claim) => met.includes(claim));rootherald:assurance:real-device— a hardware, firmware or mobile-hardware class, and a proved root of trust.rootherald:assurance:trusted-tpm-root— the TPM's endorsement certificate chains to a root Root Herald ships: a TPM maker's, or a cloud provider's for a cloud VM. Onlyreal-devicemeans a physical chip. A device admitted under a policy that relaxes this keeps a real identity but never claimsreal-device.rootherald:assurance:secure-boot— Secure Boot on, proven by a quote-bound event log.rootherald:assurance:oem-keyed— the Secure Boot platform key belongs to a known OEM. This is the firmware's key, not the chip's certificate, and it needs Secure Boot on.rootherald:assurance:cloud-vtpm— a cloud virtual TPM, admitted by a permissive policy.
Limit what the verdict reveals
Pass requestedDisclosureClass to verify to cap what the verdict reveals: verdict (booleans and enums, no identifier), pseudonymous (adds ueid), derived (lifecycle facts) or full. Leave it out and you get the key's ceiling, which you set on the key in the dashboard and which starts at pseudonymous. Webhook endpoints set their own.