Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/AlphaBitCore/nexus-gatewayWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/alphabitcore/nexus-gateway/vk-org-resolution)<a href="https://agentmods.dev/rules/alphabitcore/nexus-gateway/vk-org-resolution"><img src="https://agentmods.dev/badge/rules/alphabitcore/nexus-gateway/vk-org-resolution/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/alphabitcore/nexus-gateway/vk-org-resolution"><img src="https://agentmods.dev/badge/rules/alphabitcore/nexus-gateway/vk-org-resolution.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00740 |
| Opus 5.5 | $0.00000 | $0.00296 |
| Sonnet 5.5 | $0.00000 | $0.00148 |
| Haiku 4.5 | $0.00000 | $0.00074 |
Grade A, and why
vk-org-resolution scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.
VK org resolution — two join chains (binding)
packages/ai-gateway/internal/platform/store/virtualkey.go:vkSelectSQL resolves VirtualKey → Organization through TWO independent chains:
| VK type | Chain |
|---|---|
application |
VirtualKey.projectId → Project → Organization |
personal |
VirtualKey.ownerId → NexusUser → Organization |
The SQL JOINs both and COALESCEs the application chain first.
Required SQL pattern
LEFT JOIN "Project" p ON vk."projectId" = p.id
LEFT JOIN "Organization" org ON p."organizationId" = org.id
LEFT JOIN "NexusUser" u ON vk."ownerId" = u.id
LEFT JOIN "Organization" u_org ON u."organizationId" = u_org.id
COALESCE(p."organizationId", u."organizationId") AS organization_id
COALESCE(org.name, u_org.name) AS organization_name
COALESCE(org.timezone, u_org.timezone) AS organization_timezone
When to apply
Touching any of:
vkSelectSQLitself (or any sibling SELECT that joins through Project/Org/NexusUser)- A new column on
traffic_eventthat depends on the VK's parent (timezone, billing account, primary AccountManager, parent org id) - A new VK type beyond
application/personal - The audit pipeline's
identityJSONB stamping
Why this matters
Latent bugs in the personal-VK code path hide indefinitely when traffic is dominated by application VKs — a missing join surfaces only on the first personal-VK request. Touching personal-VK-adjacent code without testing both VK types = silent NULL columns in prod. Memory anchor: [[feedback_vk_org_dual_join_chain]].
Forbidden
- "Simplifying" the SQL by dropping the second
LEFT JOINor theCOALESCE. The twoOrganizationjoins via different aliases (org,u_org) are load-bearing. - Adding a Go-side fallback in caller code (e.g. "if
meta.OrganizationID == ""then look upmeta.OwnerIDand readnexus_user.organizationId"). The fallback belongs in SQL — caller code reads the resolved value, not raw chains. - Adding a new VK-derived column without verifying it has both chains' coverage.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 63 lines · 0 tokens per session scan A 603238aff624
vk-org-resolution is a cursor rule published in the GitHub repository AlphaBitCore/nexus-gateway (25 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 740 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
ehs-ims-conventions
EHS IMS app — RBAC, data layer, tRPC, migrations, AI boundaries.
skill-layered-design
Layered Design — enforce arquitetura estrita Handler→Service→Repository→Model em todos os projetos DARE, independente de linguagem. Inspirado em "Layered Design for Ruby on Rails Applications" de Vladimir Dementyev (Evil Martians).
nodejs-mongodb-jwt-express-react-cursorrules-promp
description: "Cursor rules for Node.js development with MongoDB, JWT, Express, and React integration." globs: / alwaysApply: false.
web-backend-database-patterns
Best practices for working with databases in backend applications.
convex-development---general
Applies general rules for Convex development, emphasizing schema design, validator usage, and correct handling of system fields.
django-orm-for-database-operations
Specifies that Django's ORM should be used for interacting with the database when defining models. This encourages a consistent approach to database operations across the project.