Niubi Guard Overview
Albert-Weasker published
Installation and Configuration
The CLI installs through npm. Run npm install -g niubi-guard followed by niubi-guard init to generate a configuration file based on guard.config.example.json. The setup supports Docker via the included Dockerfile. Configuration covers detection signals, allowlists, model endpoints, prompts, and confidence thresholds. Dry-run mode executes by default. Explicit enablement of apply mode activates response actions like close, lock, or block.
The stack combines a Next.js frontend with Node.js backend components. TypeScript definitions sit in tsconfig.json and tsconfig.build.json. Source files reside in src and app directories, while tests occupy a dedicated tests folder. Multilingual support covers English and Simplified Chinese in the UI and documentation.
Detection and Response Mechanics
Detection combines keyword matching, username checks, and an OpenAI-compatible model. Each flagged item receives labels, evidence excerpts, AI confidence scores, and planned actions. Maintainers set their own base URL, API key, model name, and threshold. The system logs every decision with traceable reasons.
Response actions stay off until configured. Available operations include delete, close, lock, block, and interaction limits. Coordinated abuse patterns receive priority over standard promotion activity. The project ships under the Apache-2.0 license with separate files for code of conduct, security policy, and contribution guidelines.
Trade-offs for Maintainers
Self-hosting gives full control over data and model choices but requires ongoing maintenance of the Next.js application and database. The hosted option at niubistar.com/guard removes setup steps yet removes the ability to inspect or modify the detection logic locally. Configuration complexity rises when custom prompts or multiple signals are added. The transparent logging helps audit decisions, yet false positives still demand manual review before apply mode runs.
FAQs
Does Niubi Guard require an OpenAI key? No. Any OpenAI-compatible endpoint works, including local models that expose the same API format.
Can actions run automatically without review? Only after apply mode is enabled in the configuration and the maintainer accepts the dry-run output.
Is the project limited to English repositories? The first release includes Simplified Chinese support in the UI and documentation, with detection rules that can target any language through custom keywords or prompts.
---
๐ Related articles
- Agentic Coding: Una Trappola per lo Sviluppo Software?
- File agents.md: utili per gli agenti di coding?
- Lean-ctx: Ottimizzatore Ibrido Riduce Consumo Token LLM del 89-99%
Need a consultation?
I help companies and startups build software, automate workflows, and integrate AI. Let's talk.
Get in touch