issue_preview_token
Issue a single-use token after user approves a file preview to authorize printing and prevent unauthorized prints.
Instructions
Issue a preview-confirmation token for a file about to be printed.
Call this AFTER rendering a preview (``visualize_model`` /
``preview_generated_model``) and showing it to the user. The user
approves → you call this tool → you pass the returned token as
``preview_token`` to ``start_print`` or ``fulfillment_order``.
Without a valid token, ``start_print`` refuses to execute (unless
``KILN_SKIP_PREVIEW_GATE=1``). This is the deepest safety gate
that prevents an agent from sending a print to the physical printer
without the user ever seeing what's about to be printed.
Tokens are single-use and expire after ``ttl_seconds`` (default 600
seconds / 10 minutes). Scoped to the specific file hash and
optionally to a specific printer_id so a token for one file can't
be reused to approve a different file.
Args:
file_path: Path to the file to be printed (STL, 3MF, or .gcode).
Hashed to bind the token to specific bytes. If the file
changes between issuing and using the token, the token is
rejected.
printer_id: Optional printer model ID to scope the token to a
specific printer. When set, using the token with a different
printer will be rejected.
ttl_seconds: Lifetime of the token (default 600).
Returns:
Dict with ``token`` and ``expires_at`` (unix timestamp).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| printer_id | No | ||
| ttl_seconds | No |