
Yagami AI Context Firewall
io.github.MatthewTracy由 GitHub 账号 MatthewTracy 发布v0.8.6更新于 Nov 3, 2026
开源 AI 上下文防火墙,用于受管控的模型、检索、记忆和工具访问。
AI 翻译由 AI 模型根据下方的原文描述翻译,可能有误。
原文描述
Open-source AI context firewall for governed model, retrieval, memory, and tool access.
概览
Yagami AI Context Firewall 的本地 MCP 服务;无需登录;STDIO。
暂无 AI 概览:以下信息来自注册中心条目和服务本身。
安装
在 SourceWeft 中
- 打开 控制台中的 Yagami AI Context Firewall,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Yagami
An AI router that chooses models and protects privacy.
Yagami automatically routes requests to local or cloud models based on the task and your privacy policy. Detected sensitive information, including PHI, stays local under the default policy. Local models can reduce cloud API costs; more demanding work and image generation can use cloud providers when allowed.
[CI] [PyPI] [Python] [License: MIT]
Documentation | Gateway API | Deployment | Security | Roadmap
Watch Yagami in action
[Preview of Yagami generating an image with the cloud route highlighted]
Watch the 59-second demo: local
answers, a fictional patient case kept on the machine, and cloud image
generation. The recording uses real models, synthetic patient information,
and configured providers with yagami serve. The no-credential demo below
keeps cloud routing disabled.
Try it in 60 seconds
The no-credential demo uses your configured Ollama model when it is installed; otherwise it opens a clearly labeled policy-only fallback. Choose one command:
Open http://127.0.0.1:8000, or use
docker compose -f compose.demo.yaml up from a clone. Demo mode blocks cloud
routing while exercising the UI, policy, lineage, storage, and audit path. For
local AI answers, install Ollama and run
ollama pull llama3.2:3b-instruct-q4_K_M before starting the demo.
[Yagami workspace with conversation history, chat, and session insights]
Yagami is for developers and platform/security teams that need to control where agent context goes and which tools it may execute. For example: a coding agent can keep repository secrets on-device and require an identity-bound, one-time approval before a dangerous tool call.
Yagami sits between software and local models, cloud LLMs, retrieval systems,
memory, and tools. Existing OpenAI SDK applications can adopt it by changing
one base_url; Yagami then classifies context locally, applies versioned
policy, and records content-free evidence for each decision.
Take the no-data security tour or run the flagship security demos for secret containment, poisoned retrieval, and identity-bound tool approval.
Protect an application
Initialize persistent user configuration, check the host, and start Yagami:
Install yagami[providers] when the Yagami process or the example client uses
Anthropic/OpenAI-compatible SDKs. PDF ingestion and OS key storage are separate
ingest and desktop extras; see configuration.
Then point an OpenAI client at the gateway:
Supported caller sensitivity values are none, phi, phi_medical, and
secret. A caller hint can make the policy stricter; it cannot lower a
sensitivity detected by Yagami.
For production authentication, policy, and deployment settings, follow the deployment guide.
Why teams use Yagami
- Deterministic containment after classification. Once context is labeled as PHI or secret, default policy permits local backends only. Sensitive history and tool results inherit the same restriction.
- One governed data plane. Chat Completions, Responses, the browser chat, and MCP use the same policy, lineage, transformation, output-DLP, budget, and audit pipeline.
- Policy as code. Preview and replay decisions, run regression cases in CI, and promote deterministic Ed25519-signed policy bundles.
- Evidence without prompt logging. Policy passports, hash-chained audit records, Prometheus metrics, and OpenTelemetry spans carry labels, hashes, IDs, and counts rather than prompt or completion content.
- Model choice without policy duplication. Route to local engines, direct cloud providers, or an existing OpenAI-compatible gateway behind one enforcement point.
- Governed tools. Evaluate function tools and MCP calls before execution, require short-lived one-time approvals, and keep inbound credentials from being forwarded to downstream servers.
Core capabilities
Models and integrations
Local generation works with Ollama, llama.cpp through
the optional llama-cpp-python runtime, and Microsoft Foundry Local through
its loopback OpenAI-compatible service. Direct cloud adapters cover Anthropic,
OpenAI, Mistral, Groq, OpenRouter, Google Gemini, and Stability AI image
generation.
Yagami also works with LangChain/LangGraph, the Vercel AI SDK, Microsoft Presidio, Splunk HEC and generic SIEM webhooks, Slack and Teams approval notifications, and upstream gateways such as LiteLLM, Portkey, Kong, or Envoy. See the integration recipes.
How it compares
Yagami is not trying to replace every gateway, validator, or security scanner. Its focus is deterministic post-classification containment, governed tool execution, and content-free decision evidence. See the honest comparison guide for when LiteLLM, Guardrails AI, NeMo Guardrails, Presidio, LlamaFirewall, or a direct provider SDK is the better choice—and how to combine them with Yagami.
How enforcement works
Policy is the final authority. Slash commands and explicit backend selection cannot override a sensitive-data restriction. Classifier failures fail local by default, and cloud routes can be blocked entirely or stopped at a daily spend cap.
Important limitations
Yagami is an enforcement component, not a compliance certification. Automated detection can miss sensitive data. Strict deployments should declare sensitivity at the caller, use a local-only policy, test organization-specific cases, encrypt storage at the host or volume layer, and review the threat model.
The project is alpha. Validate policy and failure behavior against your own requirements before production use.
Documentation
Contributing
Focused issues and pull requests are welcome. Read CONTRIBUTING.md, the security policy, and the code of conduct.
License
MIT - Copyright (c) 2026 Matthew Tracy and Yagami contributors.
来源:README.md,提交 c56fc99
工具
0版本历史
4- v0.8.6最新Nov 3, 2026
- v0.8.4Oct 30, 2026
- v0.8.3Oct 6, 2026
- v0.7.3Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分