by luisfer via GitHub · MIT licensed · 55 versions
Open source, kept here so you can read it and make your own copy. Not our work.
Peace of mind for vibe-coded apps
About this project (the project's own write-up)
🪷 Ubon
Security scanner for AI-generated apps. Catches the bugs Cursor, Lovable, Windsurf, v0, and Claude routinely ship: hardcoded LLM keys, prompt-injection sinks, leaked Server Actions, hallucinated imports, missing auth on streaming endpoints, and the other "looks fine to a linter" issues that traditional tools miss.
Quick start
# One-shot, no install
npx ubon@latest check
# Or install globally
npm install -g ubon
ubon check
ubon check # fast static scan, exit 1 on errors
ubon scan --interactive # walk through findings one by one
ubon check --json # deterministic JSON for agents/CI
ubon rules list --json # machine-readable rule catalog
ubon check --sarif out.sarif # SARIF 2.1.0 for GitHub code scanning
ubon mcp # serve as an MCP tool to your AI assistant
ubon doctor # check environment and optional deps
Why Ubon?
Modern AI coding assistants are great at producing code that runs. They are routinely careless about code that's safe to deploy:
- Hardcoded LLM API keys in client bundles
- Server Actions with no auth check
- Streaming routes with no rate limit
- MCP server configs with literal secrets
import.meta.env.PUBLIC_*reading server-only values'use client'files importing fromactions/- Edge runtime routes calling Node-only APIs
- Hallucinated imports that pass the type checker because the package never gets installed
Ubon's job is to catch those, fast, with high confidence and file:line
context — and to expose them to the agent itself via JSON / NDJSON / MCP
so the AI can fix what it broke.
v3.2.0 — what's new
v3.2.0 is an additive release for agentic development workflows: installable guardrails, richer machine-readable output, and a validation harness that proves Ubon catches planted AI-era bugs before a release ships.
- Agent harness installer:
ubon agent install --all --writecan generate Cursor, Claude Code, Codex, pre-commit, GitHub Actions, and.gitignoreharness files from one dry-run-first workflow. - Expanded Cursor hooks: templates now cover file edits, shell commands, MCP calls, prompt submission, stop gates, and pre-compaction context.
- Agent-specific rules (
CC009–CC011): catches unknown Cursor hook events, broad agent autonomy, and dangerous reusable commands / skills. - Agent-ready CLI:
ubon changed,ubon verify,ubon review,ubon rules list --json, and presets foragent,ci,release, andlocalworkflows. - MCP upgrade: tools for changed-file scans,
baseSha, verification, status, rule catalog access, and fix planning. - Repair context: JSON / MCP output can include source context so agents have enough local evidence to patch findings.
- Validation harness: fixture benchmarks, CLI/MCP contract tests,
deterministic fix/rescan checks, dogfood, and package dry-run verification
are wired into
npm run verify:release. - Release discipline:
npm run dogfoodscans Ubon itself and must pass with 0 unsuppressed critical findings before publish.
For the original v3 breaking changes (Node 20+, removed Python / Rails / Vue profiles), see MIGRATION-v3.md.
How it compares
| Capability | Ubon | ESLint | npm audit | Lovable scanner |
|---|---|---|---|---|
| LLM / vector-DB hardcoded secrets | ✅ | ❌ | ❌ | ⚠️ Partial |
| Prompt-injection sinks | ✅ | ❌ | ❌ | ❌ |
| Server Actions / Edge runtime checks | ✅ | ❌ | ❌ | ❌ |
| Supabase RLS validation | ✅ | ❌ | ❌ | ⚠️ Existence |
| Insecure cookies / CORS / redirects | ✅ | ❌ | ❌ | ❌ |
| Client env-var leaks (Next/Vite) | ✅ | ❌ | ❌ | ❌ |
| Accessibility basics | ✅ | ⚠️ Plugins | ❌ | ❌ |
| Dependency advisories (OSV) | ✅ | ❌ | ✅ | ❌ |
| MCP server for AI agents | ✅ | ❌ | ❌ | ❌ |
| Code style / formatting | ❌ | ✅ | ❌ | ❌ |
Use them together. ESLint covers code style; npm audit covers CVEs in your dependency tree; Ubon covers the gap that AI assistants regularly leave behind.
Cursor integration
ubon agent install --cursor --write # writes Cursor hooks + rules
Then point Cursor at the MCP server:
// ~/.cursor/mcp.json
{
"mcpServers": {
"ubon": { "command": "npx", "args": ["-y", "ubon@latest", "mcp"] }
}
}
Full Cursor + Lovable + comparison details in docs/INTEGRATIONS.md.
What Ubon catches
The demo fixture in examples/ai-harness-demo
contains the kinds of issues AI agents often leave behind: an LLM key in
source, server-side fetch to a user-controlled URL, a misspelled Cursor hook,
and a reusable agent command that pipes network output into a shell.
ubon check -d examples/ai-harness-demo --preset local
The expected rule IDs are checked by the test suite so the demo stays honest.
Configuration
ubon init # writes ubon.config.json
ubon check --update-baseline # accept current findings as baseline
ubon check --baseline .ubon-baseline.json --focus-new --fail-on error
// ubon.config.json
{
"profile": "next",
"minConfidence": 0.85,
"failOn": "error",
"disabledRules": ["VIBE003"],
"exclude": ["legacy/**"]
}
For the JS variant (executes user code), pass --allow-config-js or
set UBON_ALLOW_CONFIG_JS=1.
Documentation
- docs/CLI.md — every command and flag
- docs/START-HERE.md — two-minute setup and daily commands
- docs/AGENT-HARNESS.md — Cursor / Claude Code / Codex / MCP / hooks
- docs/AGENT-SEMANTICS.md — how Ubon models agent events, rules, and gates
- docs/PROGRAMMATIC.md — Node API, JSON/NDJSON, and MCP contracts
- docs/RULES.md — full rule glossary
- docs/CONFIG.md — config file schema
- docs/INTEGRATIONS.md — Cursor / Lovable / comparison
- docs/MCP.md — Model Context Protocol server
- docs/ADVANCED.md — profiles, suppressions, baselines, output schemas, release policy
- docs/RELEASE.md — release verification and publish checklist
- docs/VALIDATION.md — dogfood, fixtures, contracts, and repair loops
- MIGRATION-v3.md — upgrading from v2.x
- CHANGELOG.md — release history
Requirements
- Node.js 20 or newer (v3 dropped Node 16/18)
- Git (for
--git-changed-sinceand thegit-historyscanner) - Optional:
@modelcontextprotocol/sdkforubon mcp— installed automatically as anoptionalDependencyofubon. If your install flags skipped it, seedocs/MCP.md.
Run ubon doctor to verify.
About
I'm Luisfer Romero Calero. I built Ubon because the gap between "AI shipped this" and "this is safe to deploy" keeps widening. The tool's name comes from the lotus (อุบล) in Thai — clarity in the middle of vibe-coded chaos.
If Ubon helps you ship safer apps, the highest praise is to wire it into your CI and your AI assistant — and tell me what it caught.
License
MIT — see LICENSE.
Versions (55 — latest: Merge pull request #11 from luisfer/dependabot/npm_and_yarn/runtime-2d52912345)
- Version 55 — May 13, 2:54am — Merge pull request #11 from luisfer/dependabot/npm_and_yarn/runtime-2d52912345 latest
- Version 54 — May 12, 2:27pm — chore(deps): bump the runtime group across 1 directory with 3 updates
- Version 53 — May 12, 2:25pm — release(v3.2.3): make release workflow idempotent
- Version 52 — May 12, 2:21pm — release(v3.2.2): sync package metadata
- Version 51 — May 12, 1:33pm — release(v3.2.1): update README release notes
- Version 50 — May 12, 1:10pm — release(v3.2.0): agent harness validation
- Version 49 — Apr 19, 11:26am — release(v3.1.0): fixture fleet + AI-tool coverage
- Version 48 — Apr 19, 4:21am — release(v3.0.2): quick wins — trust, noise, coverage
- Version 47 — Apr 19, 2:05am — fix(v3.0.1): chmod +x dist/cli.js so the published bin is executable
- Version 46 — Apr 18, 9:21pm — chore(v3): scope-sync vscode-extension, tests, drift guard
- Version 45 — Apr 18, 9:19pm — feat(v3)!: modernization, AI-era rules, MCP, scope cut
- Version 44 — Mar 31, 9:34am — Update RULES.md
- Version 43 — Feb 1, 1:59pm — Release v2.0.0: The Vibe Code Edition
- Version 42 — Oct 13, 8:33am — chore: regenerate RULES.md with v1.2.0 rules (auto-generated)
- Version 41 — Oct 13, 8:24am — 🪷 Release v1.2.0: The Lovable Edition
- Version 40 — Sep 18, 5:00am — release: v1.1.6 – documentation completeness fixes
- Version 39 — Sep 18, 4:03am — 🪷 Release v1.1.5: Documentation packaging fix
- Version 38 — Sep 18, 3:31am — 🪷 Release v1.1.4: Smart Contextual Guidance & Integration Guide
- Version 37 — Aug 30, 10:55am — 🪷 Release v1.1.3: Interactive Mode, Beautiful CLI, Development Scanner
- Version 36 — Aug 27, 1:31pm — fix: remove accidentally committed .ubon cache directories
- Version 35 — Aug 27, 1:21pm — feat(next): add experimental NEXT210 server→client secret bleed rule; docs+rules regenerated; tests added; table format + result cache tested
- Version 34 — Aug 25, 4:55am — Update README.md
- Version 33 — Aug 25, 4:40am — release: v1.1.1 – default AI-friendly human preset; --pr-comment; TL;DR; docs/cli/changelog updates
- Version 32 — Aug 24, 4:06pm — release: v1.1.0 – UX polish (--show-confidence, severity grouping, --ai-friendly); P5 Next.js experimental rules; Rails profile; docs hub; FEATURES overhaul; RULES generated; README reorg; progress hints
- Version 31 — Aug 24, 1:11pm — docs(rules): add helpUri links for key rules (OWASP/MDN/Next.js)
- Version 30 — Aug 24, 1:07pm — chore(vscode): add .vscodeignore and vsce package/publish scripts
- Version 29 — Aug 24, 1:03pm — fix(ci): add chokidar dependency for --watch mode
- Version 28 — Aug 24, 1:02pm — docs(vscode): add extension README
- Version 27 — Aug 24, 12:55pm — feat(vscode): quick fixes for COOKIE002 and LOG001; run-on-save configuration
- Version 26 — Aug 24, 12:54pm — feat(vscode): run on save and basic quick fixes for A11Y001/A11Y002
- Version 25 — Aug 24, 12:51pm — feat(vscode): initial VS Code extension scaffolding to run ubon and surface diagnostics
- Version 24 — Aug 24, 12:47pm — feat: SARIF rules include helpUri and rule meta help text
- Version 23 — Aug 24, 12:42pm — feat: P2 features — --create-pr, --base-sha CI gate, --watch; autofix extensions
- Version 22 — Aug 24, 12:37pm — docs: document autofixes and usage (fix-dry-run/apply-fixes)
- Version 21 — Aug 24, 12:25pm — docs: update README/CLI/CHANGELOG and add SUPPRESSIONS guide for v1.1.0 features
- Version 20 — Aug 24, 12:13pm — feat: Next.js JWT/cookie security rules (NEXT007-NEXT011) and COOKIE002
- Version 19 — Aug 24, 12:07pm — feat: implement OSV vulnerability cache system
- Version 18 — Aug 24, 11:57am — feat: inline suppressions system
- Version 17 — Aug 24, 5:07am — feat: add code context and impact explanations
- Version 16 — Aug 24, 5:03am — feat: add result grouping and filtering
- Version 15 — Aug 24, 4:35am — ci: add security-events permission for SARIF upload, only upload once per matrix
- Version 14 — Aug 24, 4:32am — ci: include package-lock.json for CI reproducibility
- Version 13 — Aug 24, 4:21am — fix: Fixed workflow release file duplications, and removed unnecesary script for checking changelog versions
- Version 12 — Aug 24, 4:11am — ci: remove duplicate top-level keys in CI workflow; matrix Node versions
- Version 11 — Aug 24, 4:07am — chore(release): enforce CHANGELOG entry via preversion script
- Version 10 — Aug 24, 4:05am — docs(changelog): add 1.0.2 and 1.0.3 entries (cosmetic CLI updates)
- Version 9 — Aug 24, 4:03am — chore(npm): include CHANGELOG.md in published files
- Version 8 — Aug 24, 3:46am — feat(cli): focus flags and severity triage; fix(SEC018): context-aware, pattern-first; chore: runtime minConfidence for human runs; docs: CLI and CHANGELOG 1.0.4; tests: SEC018 cases
- Version 7 — Aug 24, 3:14am — docs(readme): format User/AI conversation with blockquotes and emphasis
- Version 6 — Aug 24, 3:00am — docs: add AI-generated code debugging section; document non-disruptive release policy
- Version 5 — Aug 23, 2:30pm — chore(cli): cosmetic styling (badges, lotus); release: 1.0.3
- Version 4 — Aug 23, 2:13pm — release: 1.0.2
- Version 3 — Aug 23, 2:13pm — chore(cli): add lotus emoji and read version from pkg
- Version 2 — Aug 23, 2:08pm — fix(ast): lazy TS import; chore: typescript as runtime dep; release: 1.0.1
- Version 1 — Aug 23, 1:48pm — chore(release): prepare v1.0.0
Files (210 · 1.9 MB)
- .cursor/1 file · 1.7 KB
- .github/3 files · 4.4 KB
- branding/2 files · 814.5 KB
- docs/15 files · 64.0 KB
- examples/24 files · 9.8 KB
- scripts/7 files · 19.7 KB
- src/139 files · 648.2 KB
- vscode-extension/5 files · 8.4 KB
- .gitignore956 bytes
- .npmignore374 bytes
- .nvmrc3 bytes
- CHANGELOG.md39.0 KB
- CONTRIBUTING.md5.5 KB
- LICENSE1.1 KB
- MIGRATION-v3.md5.8 KB
- README.md8.4 KB
- eslint.config.js2.8 KB
- jest.config.js943 bytes
- package-lock.json259.0 KB
- package.json3.5 KB
- tsconfig.json589 bytes
- ubon.config.json237 bytes
Open a version to see exactly what changed in it, or download the zip for everything.
Get it on your computer
With the Library Mode tool: librarymode get ken/ubon
Or tell Claude Code / OpenCode: "get ken/ubon from Library Mode"