
Bouncer Gates
io.github.ajeermahmoodPublished by GitHub account ajeermahmoodv0.5.0Updated Oct 24, 2026
Stops secrets, cross-tenant queries and unsafe migrations before they merge.
Overview
Runs five static checks on a repository to catch hardcoded secrets, unscoped multi-tenant queries, float money maths, unsafe migrations and broken doc links.
- What you can do
- Bouncer Gates exposes its five gates over MCP so an agentic editor can call them while writing code. The checks are secrets, scope (queries on tenant-owned tables with no tenant filter), money (currency handled as floats), migration-safety (SQL migrations that break the running app) and doc-links (markdown links to missing files). Findings name the file, line, problem and suggested fix, and can be excused with a reasoned comment or recorded in a baseline so only new findings block. It also runs as a CLI, a post-edit hook and a GitHub Action.
- When to use it
- Use it when an assistant writes or edits code in a repository and you want the same cheap guard applied in the editor and in CI. It suits teams with multi-tenant data models, money handling or SQL migrations who want obvious mistakes caught before merge.
- Requirements
- Node.js and npx to run the npm package locally over stdio. A git repository for the changed-file and migration checks. Optional configuration file written by the init command; no accounts, API keys or environment variables are declared.
Installation
In SourceWeft
- Open Bouncer Gates in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
bouncer-gates
Five checks that stop the expensive mistakes before they merge, whether a person or an agent wrote the code.
Hardcoded secrets. Database queries that leak one customer's data to another. Float maths on money. Migrations that break the running app. Docs that link to files which no longer exist.
Agents write most new code now, and they make exactly these mistakes: a key pasted in to make a test pass, a query with no tenant filter because the prompt never mentioned tenants. bouncer-gates runs inside Claude Code and Cursor, so the agent hears about it in the same turn it wrote it, and again in CI so nothing gets through.
Try it on any repository in ten seconds:
Or paste some code into the playground and watch the same checks run on it.
Quick start
Add it to GitHub Actions:
That is the whole setup. Everything below is detail.
In the editor, with the agent
--init-agents commits two things into the repository: an MCP server the agent
can call, and a hook that scans every file the agent writes. When a file has a
blocking finding, the agent sees the file, the line, what is wrong and what to
do instead, in the same turn:
Any other MCP client can run npx -y bouncer-gates --mcp, and any post-edit
hook can pipe its event to npx -y bouncer-gates --hook.
How it works, and what it will not do.
What it checks
Each check exists because of a real, expensive bug. None is a style opinion. The gate reference explains every rule with a bad example and a fixed one.
When it finds something
Every finding names the file, the line, what is wrong and what to do instead:
You have three options, in this order:
- Fix it. Usually the right answer.
- Explain why it is fine. Put a comment on the line, or the line above it, with a reason. The reason is required; a bare marker does nothing.
- Record existing problems so only new ones block. On a codebase that already has findings, run this once and commit the file it writes: Old findings stop blocking. Anything new still does. The file is readable, and the count in it should only ever go down.
Configuration
bouncer-gates --init writes this for you. Edit it by hand any time.
- exclude: files not to scan at all. The run prints how many files each pattern removed, every time, so the list cannot grow quietly.
- scope.models / tables: the models and tables that belong to a tenant.
--initfills these from any model in your Prisma schema that has atenantIdfield. - scope.clients: plain client names, like
prisma, whose queries should be checked for the tenant column. Use this when you do not have a scoped wrapper. - scope.rawAccessor: if you do have a scoped wrapper, this is the name of
the raw client it hides, like
db.raw. Reaching for it gets flagged. - doc-links.repoUrl: lets absolute links back to your own repository be checked as file paths too.
Without a scope section, the scope check reports skipped, not passed.
All the commands
Exit code 0 means clean, 1 means something blocked, 2 means the tool
itself could not run (bad flag, broken config, not a git repository). CI treats
1 and 2 differently on purpose: a broken tool should not look like a
codebase full of problems.
What it does not do
Honest limits, so nobody trusts it further than it deserves:
- It matches shapes in text. It does not understand your code. A tenant filter built in a helper the check cannot see will be reported, and the comment above is the fix.
- The money and scope checks only read JavaScript and TypeScript.
- The migration check only reads
.sqlfiles. Migrations written in JavaScript or TypeScript are not checked. - Secrets split across lines, or with no recognisable prefix, are not found. For deep history scanning use gitleaks or trufflehog; this is the cheap guard on the door, not the audit.
- A query inside
prisma.$transaction(async (tx) => ...)uses a client the check cannot follow.
Every rule's blind spots are listed in the gate reference.
Words used here
- Gate or check: one of the five things it looks for.
- Finding: one problem it reports, with a file and line.
- Blocking: a finding that makes the run exit
1. Warnings do not. - Baseline: the file that records findings you have chosen to live with for now, so only new ones block.
- Acknowledge or excuse: the
bouncer-gates-okcomment that says a specific line is fine, and why.
Telemetry
One anonymous ping a day: a random id, the version, the runtime, the OS and the
Node major. Nothing about your code, ever. BOUNCER_TELEMETRY=0 turns it off.
Everything it sends.
More
- Inside the editor: the MCP server and the hook, what the agent sees, other editors
- Gate reference: every rule, a bad and a good example, what it misses
- Rolling it out on an existing codebase
- Design notes: why it never fails open, why findings never quote the secret, the false-positive story, and the speed work
- Architecture: gates are pure functions, which is why the same code runs in the CLI, in a Cloudflare Worker and in your browser
- Deployment: the playground, the API and npm
- Contributing: adding a gate, and how to decide whether something should be one
Development
Licence
MIT. Take any of it.
Built by Ajeer Mohammed. The rules come from the checks that gate a multi-tenant platform where most of the code is written by a coding agent, and where missing one meant a merchant seeing another merchant's orders. How that workflow fits together.
Source: README.md at commit a12b315
Tools
0Version history
1- v0.5.0LatestSep 20, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts