This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
I built Ghost in the Document, a local-first document privacy tool that helps identify sensitive information and hidden content in documents before they are shared.
The idea came from a simple concern: a document can reveal more than what is visible on the page. It may contain personal information, author metadata, comments, tracked changes, or other traces that are easy to overlook.
I wanted to build something that could help people find these details without having to upload their documents to an online service.
Ghost in the Document scans supported PDF, DOCX, and TXT files, identifies potential sensitive information, and lets users review the findings before choosing what to redact. It also performs checks on the resulting document to help verify the changes.
For this challenge, I interpreted "Ghost in the Machine" as the hidden traces that remain inside our digital files. The goal was to make those traces easier to find before they become a privacy problem.
Demo
Here is a walkthrough of Ghost in the Document, showing the application and its document scanning and redaction workflow.
Code
GitHub Repository: Github Repository
The project is written in Python and is designed to run locally on the user's machine.
How I Built It
I built the application in Python, using Gradio for the interface and a combination of rule-based detection, open-source AI, and local language models.
The detection workflow has multiple layers.
First, regular expressions and predefined rules identify structured information such as email addresses and phone numbers. This provides a fast way to detect information that follows recognizable patterns.
Next, I used GLiNER for named entity recognition. This helps identify information such as people, organizations, and locations that may not follow a predictable format.
I also integrated Ollama to support analysis using a locally running language model. This layer can help identify context-dependent sensitive information that simpler rules might miss. The application checks that proposed findings actually occur in the source text instead of blindly accepting model output.
Beyond visible text, the application checks supported document structures for selected hidden content, including metadata, comments, tracked changes, and hidden text.
Once the scan is complete, users can review the findings and select the information they want to redact. The application creates a redacted copy and runs post-save checks on the result.
One of the main challenges was bringing these different components together into a workflow that is practical to use. Detecting a possible privacy issue is only one part of the problem. The user also needs control over what gets removed, and the application needs to check the resulting file.
The current version supports text-based PDFs, DOCX, and TXT files. Scanned PDFs and image-based documents requiring OCR are not supported.
Why Does Open Innovation Matter?
For a project focused on document privacy, sending the document to an external service for analysis would defeat part of the purpose.
Open-source tools and locally runnable models made it possible to build a workflow where documents can be processed on the user's own machine. This also means the application does not need to depend on a paid hosted AI API for its core local workflow.
Another advantage is flexibility. Different detection methods can be combined, tested, and improved independently. Developers can experiment with different open models and adapt the system to their needs instead of being tied to a single closed service.
Open innovation makes it easier to explore these ideas, understand how the components work, and build tools that give users more control over their data.
Local processing is not a guarantee of perfect security, and AI models can still miss sensitive information or produce incorrect findings. That is why the project includes a review step and post-redaction checks, while acknowledging that the verification process has limitations.
The Spirit of It
The interesting thing about documents is that they can preserve traces of their past. A comment may remain after a discussion has ended. Personal information may appear in a place nobody thinks to check. A change that seems to have disappeared may leave something behind.
That idea became the foundation of Ghost in the Document.
I wanted the project to feel connected to the theme while solving a practical problem. Instead of treating the ghosts as fictional creatures, I treated them as the hidden remnants of information that we leave behind when working with digital files.
Building this also reminded me that privacy is not just about detecting sensitive data. It is about giving people a way to review it, make informed decisions, and check the results before sharing their work.
There is still room to improve the detection coverage and verification process, but this project is a step toward making those hidden traces easier to understand and manage.
Other Team member : @gaurikasethi88
Top comments (0)