Prepare a brief that the operations team can review, then export an approved copy to PDF. This guide is for a person who can check the source material and authorize a local file write. It uses a fictional support pilot; no customer data or connected service is needed.
Before you start
Use Sonny 0.12.7 and Python 3 on Linux. The export was executed with the
released Linux amd64 binary at commit 192e590. Its document tools created,
validated, and read back the PDF. The one-page output was also visually reviewed.
Other platforms and document formats need their own export checks.
For drafting, first complete Getting started and configure a model connection. Supplied text goes to that provider under your account and terms. The export step needs no provider or API key. Sonny’s commercial license and access requirements still apply.
Create an empty working directory. Download and inspect the two public inputs:
mkdir sonny-brief
cd sonny-brief
curl --fail --location https://sonny.sh/examples/cookbook/approved-brief.md --output approved-brief.md
curl --fail --location https://sonny.sh/examples/cookbook/export-brief.py --output export-brief.py
The approved Markdown includes the notes, checked calculations, and a reference brief. The export helper is a small Python client for Sonny’s document tools. It does not generate a draft, install a plugin, contact a model, or send the brief to a service.
Draft from the notes
Start sonny in your working directory. Paste the three source notes from
approved-brief.md into the session, then ask:
Prepare an outline for a one-page project brief for the operations team using only these notes. Include purpose, scope, responsibilities, risks and open questions. Cite Note A, B or C for observations. Mark any missing individual owner or date as unresolved. Do not infer improved customer satisfaction. Return the outline in the conversation; do not write files or contact a service.
Review the outline before asking for a full draft. Correct the scope or missing facts in the conversation. Then ask for the approved outline as Markdown, keeping source labels and unresolved items. Compare the result with the original notes:
| Check | Required result |
|---|---|
| Pilot rates | Note A: 30/40 = 75%; Note B: 35/50 = 70% |
| Change | A decrease of five percentage points |
| Combined result | 65/90, approximately 72.2% |
| Satisfaction | No survey; no satisfaction improvement established |
| Responsibility and date | Individual owner and review date remain unresolved |
A plausible sentence is not evidence. If the draft invents a date, an owner or a cause, correct it against the notes and review again. These reference checks do not certify any model’s answer quality. For a reusable drafting policy, see Recipe authoring .
Approve the content and local write
The downloadable approved-brief.md is a checked reference output. To reproduce
the reviewed PDF, leave it unchanged. For your own brief, save the text you have
reviewed under that name and inspect the entire file before exporting. Do not put
confidential material in this example directory merely to try the exporter.
The next command starts sonny mcp-server with explicit host effects enabled
and exposes exactly doc_write, doc_read, doc_validate, and doc_inspect.
It writes review-brief.pdf in this directory. This standalone export is not a
claim of isolation-realm containment. It inherits your operator configuration;
trusted policy can refuse it. Stop on a policy refusal rather than disabling it.
Only run this after approving both the content and that local write:
python3 export-brief.py --export
The helper negotiates MCP, confirms the exact four-tool surface, calls
doc_write with expected_absent: true, then calls doc_validate and doc_read.
It checks that the approved source stayed unchanged and prints a PDF digest and
tool results. It uses no shell, network, messaging, or issue-tracker tool.
Sonny can write local traces or audit records in its configured state directories;
the source, exported text, and paths can therefore enter local records.
Inspect the result
Open review-brief.pdf in your PDF viewer. Compare it with the
checked sample PDF
. The reference is one
page with a three-row evidence table, readable headings, all calculations, and
visible unresolved responsibility/date fields. Check wrapping, page breaks,
missing text and reading order before sharing your own output.
Structural validation and text read-back do not establish visual quality. The read-back may report that a table was inferred from aligned PDF text; that warning is retained. PDF export also does not promise that an arbitrary Word, spreadsheet, presentation or existing PDF layout will round-trip unchanged. Those operations are outside this example’s qualification.
If a step fails
Without --export, the helper refuses before starting Sonny or writing a PDF.
If review-brief.pdf already exists, it refuses and leaves that file unchanged.
Inspect the existing output; use a fresh directory for another export instead of
removing the safeguard. If a write times out, inspect the directory before retrying:
a completed output can exist even when the caller did not receive its result.
A missing sonny, refused policy, unavailable tool, invalid result or failed
validation stops the helper. Preserve the error, check sonny version, and use
troubleshooting
. Do not treat a partial file or an exit
code alone as a reviewed deliverable.
Next steps
Keep the source and exported copy together for review. Sharing is a separate action: select the recipient and exact document, review it, then use your normal approved channel. This tutorial does not send or upload anything.
Continue with workflows or build a read-only integration using APIC . For other document formats, check that your installed tool supports the specific operation and validate an actual artifact before relying on it.