Beta. The Device SDK is live for design partners: Dopl issues your project's keys while the developer portal is being built, and @dopl/sdk is available on request. Agents that act for one signed in Dopl user can use the hosted MCP server instead.
A reply that reads well on a laptop is too long for a lens, and a question that works on a phone is unsafe in a car. Dopl handles this with context: it knows which device the user is on, hands your agent a profile that says how to write for that device, and enforces the device's limits on the way out without changing a word. Dopl ships a default profile for every device kind, and each project can replace any of them.
The context object
Read a user's context with GET /v1/users/{external_user_id}/context, or dopl.users.context() in the SDK. The project MCP server's context tool returns the same object, and its deliver tool includes it in every result.
{
"active_device": {
"id": "8b0c6f1e-3d2a-4c51-9a7e-2f4d6b1c9e30",
"kind": "glasses",
"model": "even_g2",
"last_seen_s": 4
},
"posture": "glanceable",
"available": [
{
"kind": "glasses",
"id": "8b0c6f1e-3d2a-4c51-9a7e-2f4d6b1c9e30",
"capabilities": [
"presence.read",
"present.notify",
"present.display",
"ask.choice",
"input.utterance",
"input.tap"
]
}
],
"profile": {
"id": "ar-glasses",
"prompt_append": "The user is wearing AR glasses and is probably on the move. Answer in at most three short plain lines, lead with the answer, and offer choices as options instead of asking them to type.",
"output": {
"max_lines": 3,
"max_chars": 240,
"format": "plain",
"markdown": false
}
},
"source_of_last_message": null
}active_device is the user's most recently seen online device, and available lists every online device with its capabilities. posture is inferred from the active device's kind: glanceable on glasses and watches, seated at a desktop, driving in a vehicle, hands_free near a home hub, and unknown otherwise. profile is the profile that applies to the active device. source_of_last_message is reserved for the kind of device the user last spoke from, and stays null until device input is recorded.
Profiles
A context profile applies to devices by kind, model or posture.
| Field | What it does |
|---|---|
match | Which devices the profile applies to: any of kind, model and posture, all of which must hold |
prompt_append | Text your agent appends to its system prompt while the user is on a matching device |
output | The limits Dopl enforces: max_lines and max_chars, plus the format (plain, markdown or blocks) and markdown your agent should write in |
allowed_capabilities | The capabilities requests may use on a matching device, such as present.* |
confirmation | How each risk tier is confirmed: none, on_device, trusted_surface or deny |
overflow | What happens when content exceeds the limits: truncate, callback or { "send_to": <kind> } |
version | Every saved change is a new version, and each event records the version that applied |
Dopl defaults
Every device kind has a default profile, so a project with no configuration still gets output that fits. The glasses default carries the same guidance Dopl's own agents use on the lens: about five short plain lines, no tables, code or long lists, and anything glasses cannot do left for the user's computer. Even Realities G2 glasses get even_g2-default, which is the glasses default with the lens limits taken from the G2's own descriptors.
| Kind | Profile | Max lines | Max characters | Format | Overflow |
|---|---|---|---|---|---|
glasses | glasses-default | 5 | 300 | plain | send_to phone |
phone | phone-default | None | 2000 | markdown | truncate |
desktop | desktop-default | None | None | markdown | truncate |
watch | watch-default | 2 | 100 | plain | send_to phone |
home_hub | home_hub-default | 4 | 400 | plain | truncate |
home_device | home_device-default | None | None | plain | truncate |
vehicle | vehicle-default | 1 | 120 | plain | truncate |
robot | robot-default | None | None | plain | truncate |
Every default denies T4 capabilities, and the device's own descriptors can set tighter limits than the profile, in which case the tighter one wins.
Customize a profile
A project profile replaces the default for every device it matches. For example, an assistant built for AR glasses can append its own instructions to the system prompt whenever the user is wearing them, tighten the limits and send anything longer to the phone:
{
"id": "ar-glasses",
"match": {
"kind": "glasses"
},
"prompt_append": "The user is wearing AR glasses and is probably on the move. Answer in at most three short plain lines, lead with the answer, and offer choices as options instead of asking them to type.",
"output": {
"max_lines": 3,
"max_chars": 240,
"format": "plain",
"markdown": false
},
"allowed_capabilities": [
"present.*",
"ask.*"
],
"confirmation": {
"T3": "on_device",
"T4": "deny"
},
"overflow": {
"send_to": "phone"
}
}Profiles are configured by Dopl for each design partner today. Send your profile to sales@usedopl.com and it is applied to your project. A self serve editor comes with the developer portal.
Your agent then reads the matched profile from the context before each turn and appends it to its system prompt:
const context = await dopl.users.context("usr_123");
const system = [BASE_SYSTEM_PROMPT, context.profile?.prompt_append].filter(Boolean).join("\n\n");Which profile applies
For each candidate device, Dopl takes the first of these that exists:
- The project profile you name with
profileon a Deliver request, for that request only. An ID with no active profile fails withinvalid_request. - Your project profile whose
matchfits the device. When several fit, the most specific wins: amodelmatch beats akindmatch, which beats aposturematch, and a tie goes to the higher version. - A Dopl model default, such as
even_g2-default. - The Dopl default for the device kind, which always exists.
Routing
Deliver takes a target: auto (the default) considers every device the user has connected, a device kind considers only devices of that kind, and a device ID considers only that device. Dopl then picks in four steps:
- Filter. Keep the devices that are online, publish a capability the intent accepts that their profile also allows, and are covered by the user's grant.
- Rank. The device kind the user last spoke from comes first once device input is recorded, then the most recently seen device, then the fallback order:
phone,glasses,watch,desktop,home_hub,vehicle,home_device,robot. - Apply `urgency`.
normalreaches the top device.highreaches every eligible device at once, the top one with the full content and the others held to their own limits.lowreaches only the active device, and fails withdevice_offlineif that device cannot take it. - Record the decision. The response's
routed_tonames the device and the reason, and the event for the call stores the reason and every candidate.
When nothing is left, the error names the step that emptied the list: device_offline when no device is online, capability_unsupported when none can take the intent, the grant's own code when none is granted, and not_found for an unknown device ID.
Intents and capabilities
| Intent | Capabilities it accepts |
|---|---|
message | present.display, then present.notify, then present.speak |
notify | present.notify, then present.display |
display | present.display |
ask | ask.choice with two or more options or a choice block, otherwise ask.text, then ask.confirm |
Limits are enforced, never rewritten
Dopl never rewrites or summarizes your agent's words. Your model writes for the device using the profile, which keeps your voice and keeps model costs on your side, and Dopl only enforces the limits: the tighter of the profile's output and the device's descriptor for the capability in use. When content still exceeds them, overflow decides what happens:
| `overflow` | Result |
|---|---|
"truncate" | Dopl delivers an exact prefix of the content: lines first, then characters, then whole UTF-8 characters, and whole blocks up to the device's block limit. Nothing is added, not even an ellipsis, and the reason in routed_to says it was truncated |
{ "send_to": "phone" } | Dopl delivers the unchanged content to the user's device of that kind, under that device's own profile. If the user has none, or it is too long there as well, Dopl truncates instead |
"callback" | Dopl delivers nothing, sets the status to failed and returns the limits and what it measured in overflow_callback, so your agent can write a shorter version |
{
"delivery_id": "4f7e2a10-6c1b-4d9e-8a35-0b2c7d9e1f42",
"routed_to": {
"device_id": "8b0c6f1e-3d2a-4c51-9a7e-2f4d6b1c9e30",
"kind": "glasses",
"reason": "fallback chain"
},
"status": "failed",
"overflow_callback": {
"profile_id": "ar-glasses",
"limits": {
"max_lines": 3,
"max_chars": 240,
"max_bytes": 960,
"max_blocks": 12
},
"measured": {
"lines": 9,
"chars": 812,
"bytes": 812,
"blocks": 0
}
}
}