maisecrets menu

maisecrets / PDFs and images

Choose what happens to PDFs and images

maisecrets cannot look inside an image or a PDF. When the AI reads one, the client sends its bytes to the model, and a password or an address in it goes along. You decide what happens, per type.

The AI reads a file Read tool: a PDF, an image A shell command pdftotext, strings, cat You paste or drop an image into the prompt An MCP tool returns an image maisecrets read_pdf, read_image: allow · ask · block · convert masks the text like any command output The model your choice masked text no hook sees it no hook sees it
The setting decides only for a file that the AI reads with the Read tool of Claude Code. Text from a shell command is masked like any output. A pasted image and an image from an MCP tool pass, whatever you set.

What the model sees

invoice.pdf on your disk
Invoice 2026-118
Billing: billing@acme-gmbh.de
IBAN DE89 3704 0044 0532 0130 00
The model gets, with convert
Invoice 2026-118
Billing: ⟦EMAIL_c3:bi•••@•••.de⟧
IBAN ⟦IBAN_c2⟧

With convert, the program pdftotext extracts the text on your computer, and maisecrets masks it like any tool result. The PDF itself never reaches the model and does not stay in the session transcript.

The setting

Settingallow (default)askblockconvert
read_pdfthe PDF goes as it isClaude Code asks you firstrefusedonly its text goes, masked
read_imagethe image goes as it isClaude Code asks you firstrefusednot available: no OCR

Send it as your own prompt, for example /maisecrets:settings read_pdf convert. convert needs pdftotext: on macOS brew install poppler, on Debian or Ubuntu sudo apt install poppler-utils. Without it, maisecrets refuses every PDF and says so. It never lets the PDF through.

  • A PDF locked by a password is refused, and the AI is told the cause and not to ask you for the password. A PDF with only an owner password converts.
  • A scanned PDF has no text. Below 25 characters of text per page, maisecrets says that the PDF looks scanned, and the AI gets nothing of it.
  • A damaged or very large PDF is refused: more than 6 seconds or 512 MB of memory for pdftotext. Text after 32K characters is cut.
  • Folders you know are clean, such as your own screenshots: /maisecrets:settings clean_dirs add ~/Pictures/Screenshots. A file counts only if it was there before the session began.

Limits

  • block acts on the Read tool of Claude Code. A shell command such as pdftotext x.pdf - still gives the AI text, and maisecrets masks that text like any command output.
  • An image that you paste into the prompt, and an image in the result of an MCP tool, reach the model without a hook. maisecrets cannot stop them.
  • In Codex, these settings change nothing that was measured: Codex has no Read tool.
  • On Windows, convert refuses: there is no fixed install folder for pdftotext.

All details and the measurements: README.