This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
What if your terminal had a ghost that could help you investigate suspicious code?
Meet PHANTOM, a local-first AI coding and security investigator built to help developers uncover potential security issues and understand what to investigate next.
Security scanners can flag suspicious patterns, but understanding the context and deciding what to do about each finding can still take time. PHANTOM combines deterministic security scanning with locally running AI models to make that investigation process more accessible.
I interpreted the Ghost in the Machine theme as an intelligent presence inside the developer's environment: something that quietly examines code, surfaces hidden risks, and helps explain what might be going wrong.
👻 Key features
- Security scanning: Detects potential exposed credentials, unsafe code patterns, and risky configurations.
- AI-assisted investigations: Uses a locally running language model to help explain relevant findings.
- Local-first inference: Connects to Ollama and locally available open-weight models rather than requiring a cloud AI API for its core inference workflow.
- Secret-aware handling: Includes redaction safeguards intended to reduce accidental exposure of sensitive values.
- Investigation history: Stores investigation records locally with SQLite.
- Exportable reports: Supports Markdown and JSON reports.
- Developer-focused interface: Includes an investigation dashboard, terminal-inspired UI, AI Console, history, and settings.
The goal isn't to replace security professionals or claim that AI can find every vulnerability. PHANTOM combines predictable scanning logic with AI-assisted explanations so developers can investigate potential risks more effectively.
Demo
🎥 Watch PHANTOM in action:
▶️ Watch the PHANTOM demo video
The demo video showcases the project and its workflow.
Code
💻 GitHub repository: msairitvik/phantom
PHANTOM is built with an open-source technology stack:
- Frontend: React, TypeScript, Vite, and Tailwind CSS
- Backend: Python and FastAPI
- AI inference: Ollama with local open-weight language models
- Storage: SQLite
- Testing: Pytest
Explore the source code, review the implementation, and contribute ideas or improvements through the repository.
How I Built It
I built PHANTOM by connecting a React and TypeScript frontend to a Python FastAPI backend, with Ollama providing access to locally running language models.
The application follows a workflow:
- Scan: Examine a selected codebase for potential security issues using deterministic checks.
- Filter: Prioritize relevant findings before sending useful context to the AI.
- Investigate: Ask a locally running model to help explain findings and provide context.
- Review: Present investigation results through the frontend.
- Record and export: Store investigation history locally and generate Markdown or JSON reports.
The open-weight AI component
I experimented with locally available models, including gemma2:2b, qwen3:4b, and qwen3:0.6b, through Ollama.
One important engineering challenge was balancing model capability with response time. Smaller models can be useful for local workflows, but they have limited context and may produce inconsistent responses. I worked on relevance filtering, context limits, timeout handling, and request management to make the investigation experience more practical.
The backend test suite passed 20 tests during development.
The AI is an assistant to the scanning process, not a replacement for deterministic checks. That distinction matters because AI-generated explanations can be incomplete or incorrect.
Why Does Open Innovation Matter?
Open innovation made it possible to build PHANTOM using tools and models that developers can inspect, run, experiment with, and adapt.
Ollama and locally available open-weight models let me explore AI-assisted security investigation without making a hosted AI API a mandatory part of the core inference workflow.
This approach offers several advantages:
- Experimentation: I can compare models and adjust prompts and context limits.
- Developer control: Users can run inference locally with a compatible model and machine.
- Transparency: The application code and scanning logic can be inspected and improved by contributors.
- Accessibility: Developers can experiment without requiring a paid cloud AI API for local inference.
- Community improvement: Other developers can extend the scanners, improve explanations, add tests, and suggest new workflows.
Local-first doesn't automatically guarantee privacy or perfect security. File access, logs, configuration, and the application's own behavior still matter. But open tools give developers greater control over how they build and evaluate these systems.
My Agent Session
PHANTOM's development involved iterating on the application, investigating timeout issues, improving model-response handling, and validating changes through automated tests.
I also used development tools to refine the implementation and verify that the backend test suite continued to pass.
Project repository: https://github.com/msairitvik/phantom
Agent session recording: Add your DevRelay session link or embed here if you have saved and shared one. Otherwise, this optional section can be removed.
The Spirit of It
The most interesting part of PHANTOM was exploring how a small local AI model could become part of a practical developer workflow rather than just another chatbot.
A suspicious line of code is only the beginning. The more useful question is: Why might this be dangerous, what context matters, and what should I investigate next?
That is the idea behind PHANTOM's ghost: a quiet investigator inside the development environment, helping bring hidden risks into view.
Building this project also reinforced an important lesson: making an AI application useful involves more than connecting a model. Reliability, context management, testing, privacy-conscious design, and clear explanations all matter.
Prize Categories
Select only the partner prize categories that PHANTOM actually qualifies for under the official challenge rules.
Potentially relevant categories to check:
- Local AI / open-weight models, if offered by the challenge
- Any applicable agent or developer-tool category, if offered and if PHANTOM meets its requirements
I have not verified the current partner-category list, so confirm the exact category names on the official challenge page before entering them.
Built for the Hacktoberfest 2026 Open-Source AI Challenge — Week 4: Ghost in the Machine.
👻 GitHub: https://github.com/msairitvik/phantom
🎥 Demo: https://drive.google.com/file/d/1TtAtsLQvHBBelNzTngE2q4feAnFAzcA-/view?usp=sharing
Top comments (0)