Agent-Hellboy / Agent-Hellboy/mcp-runtime

feat(gateway): add pluggable MCP guardrail pipeline

Abierto
#258 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Go
Estrellas
6
Forks
1
Merge medio
11 h 33 min
PR fusionados (30 d)
13

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.