Sandbox and protocol reference. Request digests and test authorization tokens are available. A
test token covers fictional fixtures only; it does not authorize use of a real talent or prove
provider enforcement.
Start with the runnable quickstart and sandbox support matrix.
reuse, its authorization covers that request and nothing else, bound by request_digest. If you
check your user’s words but send the model something different, the decision does not cover what
you generated. With reuse, the authorization also covers later requests whose inputs differ, as
Reuse explains.
Send what the model receives
Most products change a request before the model sees it. They add system text, expand the prompt, attach reference images, or prepend conversation history. Each change can add a person, a scene or a claim the user never typed. A prompt expansion that adds “holding a cold beer” breaks a rule such as “Do not show alcohol or tobacco”, even though the user only asked for “Maya Okafor on a trail”. So the check takes the effective request, in order, with arole for each part:
Send
prompt even when the model receives only your rewritten_prompt. The check evaluates what
the model receives, and a reviewer of an escalation sees what your user asked for.
The planned protocol accepts a file ID from POST /v1/files,
or a fetchable url with its sha256 and media_type.
The file-based examples below are planned protocol examples and do not run in the sandbox.
Test mode rejects file IDs and never fetches URLs. It accepts media
sha256 and media_type
as digest metadata only; this does not resolve talent from media or evaluate its content.
Use the quickstart for a supported text-input check.tlp.request_digest claim.
How request_digest is computed
The digest is sha256: followed by the lowercase hex SHA-256 of one JSON object with three keys,
inputs, use and execution, in tlp-json-1 canonical form:
inputskeeps the order you sent. A text input becomes{ "role", "text" }. A media input becomes{ "role", "sha256", "media_type" }, with the digest of the file’s bytes.useis the use object as you sent it. Arrays keep their order.executionholds onlyproviderandmodel.
tlp-json-1 is UTF-8 JSON with object keys sorted by Unicode code point, no insignificant
whitespace, numbers in shortest round-trip form, and no duplicate keys.
For the check above, where the reference file’s sha256 is
7c1e3a5b9d2f4e6a8c0b2d4f6e8a0c2e4b6d8f0a2c4e6b8d0f2a4c6e8b0d2f4a, the canonical form is this one
line:
sha256:2640a5beb8f3b4db0e46ef7be645699340d9dd19e16222d229bf123e024fab94.
Both functions below produce it.
file input, use the sha256 and media_type of the file object.
Compute the digest in your pipeline just before you call the model, and compare it with
check.request_digest. Without reuse, a mismatch means the model is about to receive a request
that was not checked.
Compute it over the inputs as checked. Adding the check’s own generation_instructions to what the
model receives is the one change the check expects, and it does not change the digest.
When the request changes
Withoutreuse, anything inside the digest is part of the decision. Change it and you need a new
check. With reuse, only the use, the talent, the execution and the end user are fixed.
A new check needs a new
Idempotency-Key. Reusing a key with a changed body returns
422 idempotency_key_reused.
Reuse
request_digest and reuse answer different questions. request_digest records the one request
the check decided. reuse says which later generations the same authorization may cover.
- Send
reuse: { "max_generations": 200, "ttl": "PT15M" }on the check, up to 1,000 generations andPT15M. - Until either limit runs out, the authorization covers generations of the same use, talent, execution and end user, even when their inputs differ, such as each line of a text-to-speech script.
check.request_digestand the token’stlp.request_digeststay the digest of the request the check decided. Do not compare later requests with them.- Every output is still checked. Submit each one as a generation, as the
generation_checkobligation requires, and omitcandidate_index: generations under reuse do not have one. - A revocation ends the window at once.
Escalated requests
When an escalated check is allowed, its authorization covers exactly the request you escalated. If your user edits the request while it waits, cancel the check and send a new one. The edited request may escalate again. See Handle escalations.What a generation tool checks
You passauthorization.token to the tool or provider that generates. Before it runs, the tool
verifies the signature against the JWKS, checks aud, exp and the model, and counts generations
against tlp.max_generations. A tool that receives the same inputs you checked can also recompute
the digest and compare it with tlp.request_digest. Under reuse, that comparison holds only for
the request the check decided. The
authorization token format lists every claim.
In
prompt_handling.mode: "withheld", text never reaches Reflections and the digest covers text
digests instead. See Privacy modes.Related
Decisions
What
allow, deny and escalate cover.Authorization token
Claims and verification of the check token.
Model providers
Verifying tokens at the inference API.
Privacy modes
Full, redacted and withheld prompts.