Agent-Hellboy / Agent-Hellboy/mcp-runtime

feat(gateway): add pluggable MCP guardrail pipeline

Offen
#258 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Go
Sterne
6
Forks
1
Ø Merge
11 Std. 33 Min.
Gemergte PRs (30 T.)
13

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.