Fill and sign PDFs with an AI agent on the Mac, in Preview

How an AI agent fills PDF forms and signs them in Preview on the Mac: example prompts, steps, scanned forms, what a drawn signature is legally, and when a script or a signing service fits better.

By Paul Kasten · Updated

Short answer: An AI agent can fill and sign a PDF on the Mac by operating Preview, which already fills form fields, adds text boxes to forms without fields and places signatures. With ShadowCursor, Claude Code, Codex or any MCP agent does this in a Preview window of its own: it reads the fields, types the values from your documents and signs with a real pen stroke or your saved signature, then saves. A drawn signature is a simple electronic signature, not a qualified electronic signature, so it does not replace a handwritten signature where the law requires written form.

What Preview already does

You do not need Acrobat or an online PDF service to fill and sign a PDF on the Mac. Preview can (Apple's guide):

  • Fill form fields: click a field and type.
  • Handle forms without fields: if a PDF does not let you type into the form, add a text box instead.
  • Sign: create a signature once with the trackpad, the built-in camera (signature on white paper) or an iPhone or iPad, then pick it from the list and place and resize it on the page.

For one form you fill once, doing it yourself in Preview takes a few minutes. An agent is worth it when the values have to be collected from other documents, when you have a stack of similar forms, or when you want it done while you work on something else.

Which way fits

SituationSimplest way
One short form, data in your headFill it yourself in Preview
A fillable PDF filled many times with data from a tableA script, for example with pypdf
Forms with values spread over emails, invoices and other PDFsAn AI agent operating Preview
Scanned forms without fieldsAn AI agent with Preview text boxes, then a careful check
A document that legally needs written form or a qualified signatureA qualified signature from a trust service provider, or pen and paper

For fillable PDFs, the pypdf library fills fields by name from a script with update_page_form_field_values(). A coding agent can write that script for you in a minute, and it is repeatable. It does not help with scanned forms, and it does not draw signatures.

How an agent does it with ShadowCursor

ShadowCursor is a Mac app and MCP server that gives AI agents their own cursor, keyboard and clipboard. The agent opens the PDF in a Preview window of its own and works there in the background, even when your windows cover it. It sees only that window, and its keys reach only that window. Its cursor is drawn on screen in its color with a name tag, so you can see where it is signing.

Signatures are one of the places where a human-like pointer matters: the agent can draw a real pen stroke, for example to sign a PDF in Preview, and signature fields on web pages react to it as they do to a person.

Example prompts

Fill out ~/Documents/forms/insurance-claim.pdf in Preview with the details from
the email "Water damage" in Mail and the invoice ~/Documents/plumber.pdf.
Use my saved signature in Preview to sign at "Signature of policyholder" and
add today's date. Save it, but do not send anything.
The three PDFs in ~/Documents/onboarding are forms from the same provider.
Fill each with the data in ~/Documents/onboarding/me.txt. Where a form has no
fields, use text boxes aligned with the lines. Leave the signature lines empty
and show me each page when you are done.
Make a copy of contract.pdf named contract-signed.pdf, open the copy in Preview,
sign on page 4 above "Contractor" and save.

What happens step by step

  1. It prepares a copy. Working on a copy keeps the original untouched and lets the agent save with Command-S, so no save dialog is needed. In a terminal-based agent, cp contract.pdf contract-signed.pdf and open -a Preview contract-signed.pdf do this without any dialog at all.
  2. It reads the form. Every action returns a screenshot of the Preview window plus its accessibility elements, so the agent sees the labels and which fields are fillable.
  3. It collects the values from the sources you named: an email in Mail, another PDF, a text file.
  4. It fills the fields. For fillable fields it types into each field. For scanned forms it adds text boxes and places them on the lines.
  5. It signs. It places your saved signature from Preview's signature list or draws a pen stroke where you told it to, and positions it on the page.
  6. It saves and reports what it entered on which page.

Should the agent sign for you?

A signature is your declaration, not the agent's. The cleanest setup is to create your signature in Preview yourself once, with the trackpad, the camera or your iPhone, and let the agent only place it. A stroke the agent draws is not your handwriting, even if it looks like a signature. Either way, read the filled document before you send it, and tell the agent not to send, upload or email anything on its own.

In the EU, the eIDAS Regulation distinguishes simple, advanced and qualified electronic signatures. Only a qualified electronic signature has the same legal effect as a handwritten signature (Article 25(2)); other electronic signatures may not be denied legal effect merely because they are electronic, but their weight depends on national law and the context (Regulation (EU) No 910/2014). A signature image placed in Preview is a simple electronic signature.

In Germany, for example, replacing a legally required written form with electronic form requires a qualified electronic signature (§ 126a BGB). A qualified signature needs a qualified certificate from a trust service provider; neither Preview nor an AI agent creates one. For everyday forms, insurance claims, delivery confirmations or internal approvals, a simple signature is usually what is asked for. When in doubt, ask the recipient which form they accept. This is general information, not legal advice.

Pitfalls

Scanned forms

A scan has no fields, so the agent places text boxes by eye. Check alignment and that nothing overlaps printed text, especially on dense forms. Ask the agent to show each page after filling.

Autocorrect

Typed text can be autocorrected, which changes names, policy numbers and IBANs. ShadowCursor detects such corrections and retypes the word, but check numbers against the source.

Dates and formats

Forms often expect a specific date or number format, or one character per box. Mention it in the prompt when it matters.

Files and dialogs

Dragging a PDF from Finder onto Preview or a signed file into an email is a system drag that follows the real mouse; ShadowCursor cancels it. Name file paths in the prompt and work on copies so the agent can save in place.

Window state

Minimized and hidden windows cannot be seen or operated; covered windows can. Leave the agent's Preview window open somewhere, behind yours is fine.

Sensitive documents

The agent's model receives screenshots of the windows it works in, so a contract or ID form it fills is visible to that model. The guide on whether it is safe to let AI control your Mac covers what to keep closed and what to watch.

FAQ

Is a signature added in Preview legally binding?

It is a simple electronic signature. Under eIDAS it cannot be rejected only for being electronic, and it is accepted for many everyday documents, but it is not a qualified electronic signature and does not replace a handwritten signature where the law requires written form. Ask the recipient if you are unsure.

Can an AI sign a PDF for me?

Technically yes: an agent can place your saved signature or draw a stroke in Preview. Whether it should is your decision. Let it prepare and place the signature, and review the document yourself before it goes anywhere.

Do I need Adobe Acrobat to fill and sign PDFs on a Mac?

No. Preview fills form fields, adds text boxes and places signatures. Acrobat or a signing service becomes relevant for workflows like collecting signatures from several people or qualified signatures.

Can the agent fill a scanned PDF?

Yes, with text boxes placed on the lines, since a scan has no fields. Check the placement on every page.

Does the document leave my Mac?

ShadowCursor runs locally, and an agent sees only the windows it works in. The screenshots of those windows go to the agent's model, as with any computer use tool.

What does ShadowCursor cost?

There is a 7-day free trial without a card, then $12.99 per month or $69.99 per year, with unlimited agents on up to three devices. It needs macOS 15 Sequoia or later.