Inspiration

Over the past year, we watched our own workflow change completely. Like most developers in 2026, we now let AI write a huge share of our code — Cursor drafts the component, Claude Code writes the API route, and we review and ship. It's fast. Maybe too fast. At a hackathon a few months ago, one of our teammates shipped an app in a single night. It worked beautifully. It also had an OpenAI key embedded in a client-side component, an LLM API call inside an unbounded for loop, and a SQL query built with string concatenation — all suggested, innocently, by an AI assistant that was just trying to be helpful. That was our wake-up call. We ran the project through the tools we trusted — and they caught the SQL injection, but completely missed the exposed AI key and the loop that would have burned $400 of API credits on the first traffic spike. Legacy scanners were built for a world where humans wrote all the code. We don't live in that world anymore. We built GlitchQ to be the safety net we wished we had: a pre-launch auditor that understands how AI-assisted code actually fails.

What it does

GlitchQ audits a codebase across five risk dimensions in a single scan: Security vulnerabilities — SQL injection, command injection, path traversal, SSRF, insecure deserialization, via Semgrep SAST rules Hardcoded secrets — API keys, cloud tokens, private keys, database URIs, via Gitleaks Supply chain risk — known CVEs in your dependencies and their transitive tree, via Google's OSV database AI safety flaws — prompt injection vectors, client-side exposed LLM keys (dangerouslyAllowBrowser: true), unvalidated model output Financial / cost leaks — unthrottled LLM and API calls inside loops, missing timeouts, streaming without limits But finding issues is only half the product. GlitchQ's AI Prompt Studio turns each finding into a ready-to-paste remediation prompt engineered specifically for autonomous coding agents — Cursor, Claude Code, Antigravity, Aider — so a developer can go from "critical finding" to "fixed and verified" in minutes, not sprints. It also ships with differential PR gates for CI/CD: the gate compares your pull request against the baseline branch and only fails if you introduce new critical or high findings. Your legacy debt never blocks your velocity.

How we built it

The core is a Next.js 16 (App Router) + React 19 + TypeScript application, but the real work happens in the scan orchestration layer: Ingestion with paranoia. We accept ZIP uploads or GitHub repos/PRs, but every archive is treated as hostile: Zip-Slip path traversal defense, zip-bomb detection (50x decompression ratio cap, 500MB unpacked limit, 20k file cap), extraction into isolated 0o700 scratch directories, and automatic cleanup. Three battle-tested engines, one unified output. We orchestrate Gitleaks, OSV-Scanner, and Semgrep as isolated child processes (never shell execution) with strict allowlisting, 2-minute timeouts, and 20MB output buffer guards. Each engine's wildly different output format gets adapted into a single RiskFinding contract. Finding intelligence. Raw scanner output is noisy, so we built a deterministic fingerprinting layer — SHA-256 hashes over invariant finding characteristics — plus multi-engine deduplication, cluster detection, and a diminishing-returns scoring model: score=min(100, c∈clusters∑w c⋅log 2(1+n c)) where w c is the severity weight of a cluster and n c ​ its instance count — so 50 copies of the same minor CVE can't panic-score your project to 100/100. Agent-ready remediation. The Prompt Studio compiles architecture context, framework versions, code snippets, and advisory data into structured prompts, then scrubs everything through a multi-stage redaction layer before any context touches an LLM API. Defense in depth everywhere. Secrets never touch disk or the database (only an explicit metadata allowlist is persisted), local filesystem paths are normalized out, and persistence runs on Supabase with row-level security — with a zero-config local JSON fallback for offline use.

Challenges we ran into

Taming three scanners into one truth. Gitleaks, OSV, and Semgrep each report the same underlying problem differently — different paths, different line numbers, different severities. Building canonical fingerprints that stay stable across runs, engines, and file shifts took more iterations than everything else combined. A finding that re-appears under a new ID after a one-line edit breaks differential PR gating entirely, so this had to be right. Scoring without crying wolf. Our first scoring model summed severity weights linearly — and a single popular vulnerable transitive dependency (hello, 800 affected lockfile entries) instantly red-lined every project. The logarithmic damping was the fix, but tuning it so real risk still surfaced took painful trial and error on real repos. Cost-leak rules that don't cry wolf either. "API call inside a loop" sounds simple until your rule flags every legitimate batch job, test harness, and build script in existence. Separating a genuine financial burn from intended behavior is a context problem, not a regex problem — and we're still refining it. The redaction paradox. The better our AI remediation features got, the more code context we needed to send to LLM providers — and the more terrifying that became for a security product. One leaked credential through our own pipeline would be game over. Designing the multi-stage scrubbing and strict allowlist persistence took real discipline, and it changed how we architect everything.

Accomplishments that we're proud of

A scanner that understands AI-generated code. Prompt injection, exposed client-side LLM keys, and runaway API loops are first-class findings — not afterthoughts. Differential PR gating that engineers actually want in CI. Baseline debt never fails a build; only new critical/high regressions do. We think this is the difference between a scanner teams tolerate and one they love. Sub-two-minute full-stack scans with three engines, complete with a real-time multi-stage progress visualization. Genuinely offline-capable — bundled binaries, local JSON storage, no account required. It works air-gapped. The Prompt Studio. Watching a finding go from "Critical — hardcoded Stripe key" to a Cursor-ready fix prompt with the exact file, line, and replacement code in one click never gets old.

What we learned

Velocity without verification is debt. AI coding agents are force multipliers for bugs as happily as for features — and the failure modes are different from human-written bugs. New tooling paradigms need new safety paradigms. Determinism beats cleverness. Every time we tried a "smart" non-deterministic approach to dedup or scoring, it came back to bite us across runs. Invariant fingerprints and logarithmic damping — boring, testable, reproducible — won every time. Trust is the product. For a security tool, one false claim or one leaked secret destroys everything. We learned to architect defensively even against ourselves: allowlists over blocklists, spawn over exec, redaction at every boundary. Hackathons compress learning brutally. We deleted more code than we shipped — the payment simulation, half the prompt formats, three shader experiments. Scope-cutting is a feature.

What's next for GlitchQ

Precision-tuned AI-safety rule packs with published benchmarks. We want to prove — not just claim — that our prompt-injection and cost-leak detection beats pattern-matching noise, with open precision/recall numbers against labeled corpora. For a security tool, trust is earned with data. Pre-merge cost-leak simulation. Go beyond flagging unthrottled LLM loops — estimate the actual dollar burn of a code path before it ever hits your cloud bill, using token counts, loop bounds, and pricing data. "This loop costs ~$380 per 1k requests" turns an abstract warning into an undeniable priority. Team workspaces with shared triage memory. Triage decisions (false_positive, resolved) currently live per-user. Next, they propagate across an entire engineering org — so when one developer marks a finding a false positive, the whole team stops being re-alerted. Institutional memory as a feature. SARIF + open interchange exports. Native support for SARIF, CycloneDX SBOMs, and JSON/XML report formats, so GlitchQ findings flow into whatever security stack a team already runs — SIEMs, vulnerability managers, compliance dashboards — without lock-in. Self-hosted and air-gapped enterprise deployments. Our offline-first architecture (bundled binaries, local JSON storage, zero external calls) was built for this. Next step: a one-command Docker deployment with org-wide policy enforcement and audit trails — for teams whose code can never leave their network. Live remediation verification loop. After an AI agent applies a fix, GlitchQ re-scans the changed code and confirms the finding's fingerprint is actually gone — closing the loop from detect → fix → verify automatically, with a risk-score delta to prove it. A public rule-pack registry. Open-sourcing our Semgrep rule packs for AI safety and cost leaks, so the community can contribute detectors for new AI frameworks, SDKs, and failure modes as fast as they appear. The threat landscape moves weekly; the rulebook should too.

Built With

  • antigravity
  • openai
Share this project:

Updates

Submission history