Agent-Hellboy / Agent-Hellboy/mcp-runtime

feat(gateway): add pluggable MCP guardrail pipeline

Đang mở
#258 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
6
Fork
1
Merge trung bình
11 giờ 33 phút
Pull request đã merge (30 ngày)
13

Mô tả

## 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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.