Skip to content

Fangcun-AI/Fangcun-Guard

Repository files navigation

Fangcun Guard

Open-Source AI Guardrails Platform

简体中文

Fangcun AI License Version

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.

Highlights

  • 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.

Core Capabilities

Guard Model Router

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.

See Guard Model Router docs

Data Leakage Prevention (DLP)

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.

Agent Safety

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.

Hallucination Detection

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.

Quick Start

Requires Docker and an OpenAI-compatible detection model API.

pip install fangcunguard
fangcunguard init
fangcunguard up

For detailed deployment steps, see the Quick Start & Deployment Guide.

Documentation

License

Apache License 2.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors