Agent-Hellboy / Agent-Hellboy/mcp-runtime

feat(gateway): add pluggable MCP guardrail pipeline

オープン
#258 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
6
フォーク
1
平均マージ
11時間 33分
マージ済み PR(30日)
13

説明

## Summary

Add a pluggable guardrail pipeline in the MCP gateway so every MCP request and response can be inspected, blocked, redacted, or annotated before it reaches a tool server or returns to an agent.

This is inspired by the Google Cloud remote MCP security guidance and Model Armor pattern, but should stay provider-neutral.

## Why

Enterprise MCP deployments need inline protection against prompt injection, jailbreak attempts, tool poisoning, malicious URLs, sensitive-data leakage, and unsafe tool arguments. MCP Runtime already owns the gateway path, policy evaluation, audit emission, and PII redaction pieces; this issue turns those into a first-class extensible runtime guardrail layer.

## Proposed design

- Add a gateway guardrail pipeline with request and response phases.
- Support pluggable providers such as built-in regex/PII rules, Presidio, Google Model Armor, OPA/Rego, and custom HTTP webhooks.
- Let policies choose fail-open or fail-closed behavior per namespace/server/tool.
- Record guardrail decisions in Sentinel audit events without storing raw payloads by default.
- Expose guardrail status in API/UI for admins and server owners.

## Acceptance criteria

- Gateway can run request argument inspection before forwarding MCP tools/call.
- Gateway can run response inspection before returning tool output.
- Providers can return allow, deny, redact, or warn decisions with reason codes.
- `MCPServer` or gateway policy can opt into a named guardrail profile.
- Audit events include server, namespace, tool, session, agent, decision, provider, rule/template, input hash, output hash, and redaction counts.
- Default behavior is secure and deterministic when a provider times out.
- Unit tests cover allow, deny, redact, timeout, and provider error paths.
- Docs explain how to configure a local provider and an external provider such as Model Armor.

## References

- https://cloud.google.com/blog/products/identity-security/how-to-secure-your-remote-mcp-server-on-google-cloud
- https://cloud.google.com/security/securing-ai
- https://cloud.google.com/blog/products/identity-security/how-model-armor-can-help-protect-your-ai-apps

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。