Requirements
- The instance must be reachable at
PUBLIC_URLby the person drawing. The link isPUBLIC_URL/sketch/{token}, and the canvas page submits toPUBLIC_URL/api/sketch-links/{token}, so whoever the agent sends the link to must be able to open that address from their own browser. On an install run by a hosting operator this is already the case. A self-hosted instance behind a VPN or private network works only for people on that network; to collect drawings from anyone else, expose at least those two paths publicly. Formation does not check reachability; an unreachablePUBLIC_URLproduces links that fail to open. PUBLIC_URLmust be anhttpsURL, or plainhttpon a loopback host for local development. A sketch link is a bearer credential, so Formation does not issue one that would travel in cleartext. With any otherPUBLIC_URL,sketch_requestis not offered.- A database. Without one, no sketch tool is offered and the sketch routes return
503 sketches_unavailable.
How a person experiences it
Someone describes a dashboard layout in three paragraphs. The agent replies that this would be quicker to sketch and posts a link. The person opens it on a laptop or phone without signing in, sees which agent is asking and what it asked for, draws, optionally adds a note, and sends it. The agent then replies in the same thread with what it understood and continues the work. A person can also simply ask for a canvas (“let me just draw it”); the agent calls the tool because they asked.Tools
The agent’s primary model decides when to ask, with a tool call.
The tool description tells the agent to ask only when a layout, interface,
architecture, flow, or physical space would be quicker to sketch than to
describe, never in place of a question with a short text answer, and at most
once per thread unless the person asks for a canvas.
What the agent receives
Submitting a drawing wakes the agent in the thread it asked from. The wake run is anchored to the message the agent was answering, so the reply lands in the same place. If the conversation already has an active run, for example the agent’s own turn is still finishing, the wake is retried every five seconds until it can start. Each wake starts exactly one run. The wake run carries:- the drawing as a PNG image;
- the person’s note, if any;
- the text labels in the drawing, extracted from the Excalidraw scene, at most 100 labels and 4,000 characters in drawing order, with a notice when text was left out.
view_sketch require an image-capable model
from automatic model routing. If the model
that runs still cannot accept images, the agent gets the note and labels and is
told the drawing itself is not shown.
Links
- A link accepts one drawing within 24 hours. There is no renewal; the agent can ask again.
- Opening or previewing a link does not use it, so chat link unfurling cannot consume it.
- Unknown, used, revoked, and expired links all show the same “no longer active” state.
- Operators can list open links and revoke them.
Cache-Control: no-store. Token path parameters are scrubbed from audit logs.
The agent has to post the link, so the full URL is conversation content: it is
stored in the posted message, the tool result, and the model requests recorded
for that turn, the same as a vault drop link.
The canvas page
The page isPUBLIC_URL/sketch/{token}. It uses Excalidraw, loaded only on
this route. Fonts are served by Formation itself, so the page makes no
third-party requests and works on air-gapped installs. The CJK handwriting font
is not bundled; drawings with CJK text use the browser’s own font.
Limits are kept while drawing, so a finished drawing is never rejected:
The page warns when text in the drawing would be too small to read in the
export. A draft is saved in the browser’s local storage per link, so a closed
tab does not lose the drawing; it is cleared after a successful send.
The server enforces every limit again. It checks the PNG’s declared dimensions
before decoding, then decodes it fully and refuses malformed files.
Storage and retention
Drawings are stored in Postgres: the PNG in animages table, the Excalidraw
scene and note beside it. Every row belongs to a conversation and is deleted
with it. Deleting the anchor message removes its sketch request, submission, and
image. Sketch content is stored the same way as message bodies; see
Content protection.
Operator API
Request and response shapes and error codes are in
Sketch requests in the operator API. The
dashboard has no sketch views yet; use these routes.