Fangcun Guard is an open-source AI security platform that provides protection for AI applications across content safety, prompt attacks, data leakage, agent behavior security, and more.
- Guard Model Router: 15 predefined safety dimensions with a classification router that automatically identifies the relevant dimension for each input and dispatches it to the corresponding detection model. Users can freely choose which model to use for each dimension.
- Defense in Depth: Content safety, prompt injection, data leakage, agent behavior, hallucination detection — all covered by one unified platform.
- Quick to Deploy: One-command Docker deployment — configure your detection model URL and go.
- Platform Management: Web UI for all configuration, multi-tenant isolation, real-time dashboard monitoring.
Fangcun Guard predefines 15 safety dimensions (content safety, prompt injection, jailbreak, toxicity, PII, code security, image safety, etc.). The classification router automatically identifies the relevant dimension for each input and dispatches it to the corresponding detection model for parallel execution. Users configure a detection model for each dimension — just provide the API URL. Supports self-hosted models, third-party APIs, and any OpenAI-compatible endpoint.
Multi-path sensitive data detection (LLM semantic recognition + regex matching + keyword matching). Four disposal strategies upon detection: block directly, anonymize before sending and restore in response, automatically switch to a private model, or pass through with logging.
Security audit of agent tool calls — detects 19 attack patterns including shell injection, SQL injection, and path traversal, with tool whitelist and blacklist support. Also audits reasoning chains (CoT) for goal hijacking and data exfiltration intent.
Detects factual consistency between LLM output and reference context, verifies whether output content is grounded in source material, and checks for internal contradictions within the context. Suitable for output quality control in RAG scenarios.
Requires Docker and an OpenAI-compatible detection model API.
pip install fangcunguard
fangcunguard init
fangcunguard upFor detailed deployment steps, see the Quick Start & Deployment Guide.
- Quick Start & Deployment — Deployment, model configuration, local development
- Guard Model Router — Multi-model routing configuration
- Basic Guard — Core safety capabilities
- Agent Safety — Agent protection