DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to scan screenshots and PDFs for keys before upload with Preflight

Let Preflight decode images and PDFs locally, run OCR, and sanitize them before inference.

Who it is forA developer who attaches screenshots or PDF exports to an agent session and may not notice a key visible in the image.

The problemAttachments are a common path for secrets, and a key in a screenshot is easy to miss.

The outcomeAttachments are decoded and OCR'd locally, and supported sanitization rewrites them before the model receives them.

What you need first

  • A running underclass instance on 127.0.0.1:8080
  • Nix (for `nix run`) or devenv and Cargo for a local checkout
  • A coding harness or client that can change its base URL to http://127.0.0.1:8081/v1
  • Bubblewrap available for the default sandboxed attachment workers

Steps

  1. Start the proxy with nix run github:ghuntley/preflight -- serve
  2. Point the harness at http://127.0.0.1:8081/v1
  3. Attach a screenshot containing a test key from <test-file> and send a prompt about it
  4. Check the logs for an attachment.inspected event with rebuilt: true when a rewrite happened
  5. Confirm that a finding without a safe replacement returns an error rather than forwarding

Prompt for your agent

Using the preflight repo at github.com/ghuntley/preflight, run the proxy with default settings, attach the image <test-file> containing a fake key to a request, and report the response status and the attachment.inspected log event. Verify that the forwarded attachment no longer shows the key or that the request was rejected.

Caveat. Attachments that cannot be sanitized are blocked, and PDF page blacking out is off unless allow_page_redaction is set to true.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page