[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-83056":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":9,"pushedAt":9,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},83056,"niubi_guard","Albert-Weasker\u002Fniubi_guard","Albert-Weasker","Open-source GitHub repository abuse detection and response system.",null,"TypeScript",262,113,43,1,0,6,110,180,41,6.17,"Other",false,"main",true,[],"2026-06-12 02:04:30","\u003Cp align=\"center\">\n  \u003Cimg src=\".\u002Fpublic\u002Flogo.png\" alt=\"Niubi Guard\" width=\"420\" \u002F>\n\u003C\u002Fp>\n\n# Niubi Guard\n\nA free, open-source defense system that protects GitHub maintainers from spam, harassment, and coordinated abuse.\n\n[Apache-2.0 License](.\u002FLICENSE) · [Homepage](#web-ui) · [GitHub](https:\u002F\u002Fgithub.com\u002FAlbert-Weasker\u002Fniubi_guard) · [English](.\u002FREADME.md) · [简体中文](.\u002FREADME.zh-CN.md)\n\n[What it does](#what-it-does) · [Install](#install) · [Web UI](#web-ui) · [AI Detection](#ai-detection) · [Configuration](#configuration) · [CLI](#cli) · [Contributing](#contributing)\n\nNiubi Guard helps maintainers defend their repositories without hiding the policy. You choose the detection signals, users, allowlists, model, prompts, confidence threshold, and response actions. Dry-run is the default. Strong actions only happen when you configure them and run apply mode.\n\nWe built it because maintainers reported coordinated attacks: hostile Issues, repeated copy-paste accusations, and reputation-pressure campaigns. More maintainers are seeing the same pattern. Normal project promotion is allowed. Coordinated harassment is not.\n\n> **Don't want to self-host?** Use the free hosted version at [niubistar.com\u002Fguard](https:\u002F\u002Fwww.niubistar.com\u002Fguard) — no configuration needed. The open-source version is continuously improved. Issues and feedback are welcome on [GitHub](https:\u002F\u002Fgithub.com\u002FAlbert-Weasker\u002Fniubi_guard\u002Fissues).\n\n## What it does\n\n**Transparent.** Every detection carries labels, matched keywords or usernames, AI confidence, reasons, evidence, and planned actions.\n\n**User-controlled.** Delete, close, lock, block, and interaction-limit actions stay off until the maintainer explicitly enables them.\n\n**AI-powered.** Use your own OpenAI-compatible model. Bring your own base URL, API key, model, prompt, and confidence threshold.\n\n**Open source.** The defense logic, UI, CLI, configuration schema, and placeholder brand assets are available for maintainers to inspect and improve.\n\n**Multilingual.** The first release supports English and 简体中文 in the web UI and documentation.\n\n## Install\n\nInstall the CLI from npm:\n\n```bash\nnpm install -g niubi-guard\nniubi-guard init\nniubi-guard scan --config guard.config.json\n```\n\nOr run from source:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FAlbert-Weasker\u002Fniubi_guard.git\ncd niubi_guard\npnpm install\n```\n\nRun the web UI:\n\n```bash\npnpm dev:web\n```\n\nThen open `http:\u002F\u002Flocalhost:3000`. If that port is busy, Next.js will choose another port.\n\nRun a CLI dry-run:\n\n```bash\nexport GITHUB_TOKEN=github_pat_xxx\npnpm dev -- init\npnpm scan -- --config guard.config.json\n```\n\nRun with Docker:\n\n```bash\ndocker build -t niubi-guard .\ndocker run --rm -p 3000:3000 niubi-guard\n```\n\n## Web UI\n\nThe UI is a product console and policy builder:\n\n- GitHub token and repository list\n- detection signals and username defense\n- allow phrases and allow users\n- OpenAI-compatible AI detection\n- confidence threshold and prompt editing\n- review-only or auto-plan mode\n- dry-run or apply mode\n- scan output with detection labels, reasons, AI confidence, and planned actions\n- **Docs button** with a built-in operation manual (bilingual)\n\nAPI keys are not stored by the app. The browser sends them only for the current scan request.\n\n## AI Detection\n\nNiubi Guard can scan your own Issues and comments with an OpenAI-compatible model. It is designed to detect semantic attacks that do not always contain obvious signals:\n\n- malicious Issues\n- bot-like reports\n- coordinated harassment\n- spam campaigns\n- mass-mention abuse\n- template-based copy-paste attacks\n\nThe adapter calls:\n\n```text\nPOST {baseUrl}\u002Fchat\u002Fcompletions\n```\n\nThe model must return strict JSON:\n\n```json\n{\n  \"malicious\": true,\n  \"confidence\": 0.91,\n  \"label\": \"fake_star_accusation\",\n  \"reason\": \"The Issue repeats an accusation template without project-specific evidence.\",\n  \"evidence\": [\"same allegation pattern\", \"no technical detail\"]\n}\n```\n\nBy default, LLM detections are `review_only`. Switch to `auto_plan` only when you want high-confidence AI detections to create planned actions from your enabled policy.\n\n## Configuration\n\nCreate `guard.config.json`:\n\n```json\n{\n  \"repositories\": [\"owner\u002Frepo\"],\n  \"rules\": {\n    \"keywords\": [\"spam template\", \"copy-paste\", \"mass mention\", \"repeated link\"],\n    \"denyUsers\": [\"suspicious-login\"],\n    \"allowPhrases\": [\"good-faith report\", \"security disclosure\"],\n    \"allowUsers\": [\"trusted-maintainer\"]\n  },\n  \"scan\": {\n    \"includeIssues\": true,\n    \"includeComments\": true,\n    \"state\": \"open\",\n    \"since\": null,\n    \"maxPages\": 5\n  },\n  \"llm\": {\n    \"enabled\": false,\n    \"baseUrl\": \"https:\u002F\u002Fapi.openai.com\u002Fv1\",\n    \"apiKey\": \"\",\n    \"model\": \"gpt-4o-mini\",\n    \"temperature\": 0.1,\n    \"confidenceThreshold\": 0.8,\n    \"reviewMode\": \"review_only\",\n    \"systemPrompt\": \"You are Niubi Guard, a GitHub repository abuse detection classifier. Detect spam, harassment, coordinated attacks, and template-based abuse. Do not flag good-faith criticism or valid reports.\",\n    \"userPromptTemplate\": \"Repository: {{repoFullName}}\\nType: {{sourceType}}\\nAuthor: {{actorLogin}}\\nTitle: {{title}}\\nBody:\\n{{body}}\"\n  },\n  \"actions\": {\n    \"deleteComments\": false,\n    \"closeIssues\": false,\n    \"lockIssues\": false,\n    \"deleteIssues\": false,\n    \"blockUsers\": false,\n    \"setInteractionLimits\": false\n  },\n  \"interactionLimits\": {\n    \"limit\": \"existing_users\",\n    \"expiry\": \"one_month\"\n  }\n}\n```\n\nDestructive actions are disabled by default. Maintainers can enable them per repository policy.\n\n## CLI\n\nCreate a starter config:\n\n```bash\nniubi-guard init\n```\n\nDry-run:\n\n```bash\nniubi-guard scan --config guard.config.json\n```\n\nApply enabled actions:\n\n```bash\nniubi-guard scan --config guard.config.json --apply\n```\n\nWithout `--apply`, Niubi Guard only prints detections and planned actions.\n\n## Development\n\n```bash\npnpm install\npnpm check\npnpm build\nnpm pack --dry-run\n```\n\nThe npm package publishes the CLI\u002Flibrary surface from `dist\u002F`. The Next.js Web UI is built and deployed separately through `pnpm build`, `pnpm start:web`, or the included Dockerfile.\n\n## Contributing\n\nWe welcome:\n\n- attack samples\n- false-positive samples\n- prompt improvements\n- model adapter improvements\n- language translations\n- UI and accessibility improvements\n- GitHub App, GitHub Action, and self-hosted deployment ideas\n\nPlease read [CONTRIBUTING.md](.\u002FCONTRIBUTING.md), [SECURITY.md](.\u002FSECURITY.md), and [CODE_OF_CONDUCT.md](.\u002FCODE_OF_CONDUCT.md) before opening issues or pull requests.\n\nNiubi Guard is a defensive project. It does not provide growth services, manipulate metrics, or declare official truth. It gives maintainers a transparent risk detection and response system they can control.\n\n## Roadmap\n\n- `v0.1`: rule detection, AI detection, web UI, audit output, manual response\n- `v0.2`: review queue, labels, false-positive management\n- `v0.3`: threat fingerprints and community threat feed\n- `v1.0`: GitHub App, GitHub Action, and self-hosted deployment\n","Niubi Guard 是一个开源的GitHub仓库滥用检测与响应系统，旨在保护GitHub维护者免受垃圾信息、骚扰和有组织的攻击。该项目采用TypeScript编写，具备透明化检测、用户自控操作、AI驱动分析等核心功能，支持自定义检测信号、白名单、模型、提示词、置信度阈值及响应动作。其设计适用于需要防止恶意行为但又希望保持政策公开透明的GitHub项目场景中。此外，Niubi Guard还提供了多语言界面（包括简体中文），并允许通过CLI或Web UI进行配置与管理，既可自行部署也可使用免费托管版本。",2,"2026-06-11 04:10:03","CREATED_QUERY"]