AI-Entwicklung

Wie blockiert die NVIDIA Open Agent Safety Platform unberechtigte MCP-tools/call? 2026 OpenShell-L7-Policy und Audit-JSON

Ca. 16 Min.

Eine MCP-Verbindung heißt nicht: nur freigegebene Tools dürfen aufgerufen werden. 2026 prüft der OpenShell-Supervisor-L7-Proxy jedes ausgehende tools/call an params.name, stoppt Schreib-Tool wie refund_order über deny_rules und protokolliert diffbare Audit-JSON. Fokus: MCP-Sicherheit und Rechteüberschreitung—kein Sandbox-Lifecycle, keine Angriffsschritte.

Vor dem Lesen

Capability OpenShell / platform facts (2026 docs & PR) What stops overflow
L7 MCP enforcement Parses sandbox egress JSON-RPC; MCP endpoints match method and tools/call tool name protocol: mcp, deny_rules, tool / params.name
Batch fail-closed One denied tools/call denies the whole JSON-RPC batch batch_index, batch-wide deny
Argument blind spot Docs: tool arguments are not matched; allowed tools accept any arguments Overflow control = tool name + host Schema
Platform audit Supervisor decides outside the workload; Sentry optional out-of-band correlation outcome, matched_rule, params_redacted

Facts through 2026-11-10: NVIDIA Open Agent Safety Platform blog, OpenShell Policy Schema (MCP rules), L7 json-rpc/mcp enforcement PR. Order A-1042 and audit JSON are fictional illustrations.

MCP-Überschreitung stoppen = L7-Deny nach Tool-Name + Batch fail-closed + Egress-Audit-JSON

Enterprise “overflow” often means: the session approved lookup only, but the sandbox still sent refund_order; or on one TCP connection the agent called tools beyond lookup_order. With only network: full to the MCP host, every tools/call can pass—the gap OpenShell issue #1793 describes. 2026 adds L7 rules on MCP endpoints with enforcement: enforce: explicit allow for initialize, tools/list, and read tools; writes go in deny_rules.

  • Tool-name layer: the supervisor reads the egress body, not model prose; refund_order hitting deny stops the call.
  • Batch layer: do not mix lookup and refund in one batch; one deny blocks the whole array.
  • Argument layer: OpenShell does not validate order_id; host Schema is still the second gate (see the four-layer model).

Sandbox creation and TOFU binaries: OpenShell runtime sandbox. Schema + policy + sandbox stack: four-layer JSON security model. MCP wire shape: how a coding agent calls MCP. Session allow is not egress: the coding-agent permission model.

Überschreitung, wenn TCP offen ist, tools/call aber nicht eingegrenzt

Allowing lookup_order in the harness only approves this turn’s intent. The runner inside the sandbox sends HTTP. If network policy is only access: full to orders.example.com:443, any MCP method on that connection can be tried—including tools never shown in the UI. L7 MCP security pushes the decision to each JSON-RPC frame: the supervisor parses the method, reads params.name on tools/call, and applies allow / deny tables. Parse failures, response-shaped frames, or ambiguous batches fail closed.

This is not “forbid refunds in the prompt.” The model still fills JSON; the boundary must sit in the supervisor outside the workload—aligned with out-of-band enforcement on the safety platform. Sentry on BlueField is an optional correlation and isolation layer; it does not replace listing refund_order in deny_rules.

Vier diffbare JSON-Beispiele

1. Allowed tools/call (read). The proxy matches allow rules before forward:

{
  "jsonrpc": "2.0",
  "id": "call_lookup_1",
  "method": "tools/call",
  "params": {
    "name": "lookup_order",
    "arguments": { "order_id": "A-1042" }
  }
}

2. Same batch carries a write (whole batch denied). The second hop refund_order triggers deny; batch_index goes to audit:

[
  {
    "jsonrpc": "2.0",
    "id": "batch-1",
    "method": "tools/call",
    "params": {
      "name": "lookup_order",
      "arguments": { "order_id": "A-1042" }
    }
  },
  {
    "jsonrpc": "2.0",
    "id": "batch-2",
    "method": "tools/call",
    "params": {
      "name": "refund_order",
      "arguments": { "order_id": "A-1042", "reason": "agent_requested" }
    }
  }
]

3. Least-privilege policy slice (same fields as official YAML). deny_rules evaluate after rules; wildcard tools need strict_tool_names: true:

{
  "version": 1,
  "network_policies": {
    "orders_readonly": {
      "name": "orders_readonly",
      "endpoints": [{
        "host": "orders.example.com",
        "port": 443,
        "path": "/mcp",
        "protocol": "mcp",
        "enforcement": "enforce",
        "mcp": {
          "strict_tool_names": true,
          "allow_all_known_mcp_methods": false,
          "versions": ["2025-11-25"]
        },
        "rules": [
          { "allow": { "method": "initialize" } },
          { "allow": { "method": "notifications/initialized" } },
          { "allow": { "method": "tools/list" } },
          {
            "allow": {
              "method": "tools/call",
              "tool": { "any": ["lookup_order", "list_orders"] }
            }
          }
        ],
        "deny_rules": [
          { "method": "tools/call", "tool": "refund_order" },
          { "method": "tools/call", "tool": "cancel_shipment" }
        ]
      }],
      "binaries": [{ "path": "/usr/bin/python3" }]
    }
  }
}

4. Fictional egress audit event. Decision logs redact params for compliance and JSONPath spot checks (not a Sentry wire schema):

{
  "decision_id": "eg_9c4e02ab",
  "timestamp": "2026-11-10T06:44:11Z",
  "sandbox_id": "sb_agent_demo_7f3a",
  "endpoint": "orders.example.com:443/mcp",
  "protocol": "mcp",
  "binary": "/usr/bin/python3",
  "outcome": "denied",
  "matched_rule": "deny_rules.tools/call.refund_order",
  "jsonrpc": {
    "method": "tools/call",
    "tool": "refund_order",
    "batch_index": 1,
    "params_redacted": true
  },
  "platform": {
    "stack": "nvidia-open-agent-safety-platform",
    "component": "openshell-supervisor-network",
    "l7_enforcement": "mcp",
    "fail_closed": true
  }
}

Was MCP-Policy 2026 matchen kann und nicht

Align with docs before writing rules—do not assume arguments or server responses are filtered:

Object L7 MCP policy Overflow still possible
tools/call tool name allow / deny_rules; tool and params.name Any arguments inside an allowed tool—need host Schema
MCP methods initialize, tools/list, etc. must be listed unless allow_all_known_mcp_methods Missing handshake methods—connection never starts
JSON-RPC batch Any element denied → whole batch denied Split reads and writes; do not probe with mixed batches
Server response / SSE Current docs: forward without policy inspection Validate response bodies with Schema / business rules
Policy load path YAML and proto should match; a past bug dropped params matchers on proto load Proto-only deploy may widen tool allows—diff both paths

Argument gates: why AI needs JSON Schema. OpenShell + Sentry tool-name intro: OpenShell and Sentry—this piece goes deeper on deny, batches, and audit JSON.

Sechs Schritte Least Privilege für MCP

Accept with fictional order A-1042 in staging before widening allows:

  1. Mark endpoints protocol: mcp and enforcement: enforce; split legacy json-rpc by host or path.
  2. Default mcp.allow_all_known_mcp_methods: false; list handshake methods in rules.
  3. Read tools in allow with tight globs; writes only in deny_rules—no “allow all tools/call then deny one”.
  4. No mixed read/write batches: send lookup and refund separately; test batch-wide deny.
  5. Bind host Schema per allowed tool; OpenShell does not match arguments.
  6. JSON-diff policy changes + prover; audit streams keep matched_rule and batch_index.

Incremental policy update --add-endpoint does not accept mcp yet—full openshell policy set is easier to review for overflow surface.

Bei Verdacht vier JSON-Objekte legen

Compare model tool_use, actual sandbox egress body, live policy, and audit events.

  • Egress body and policy with format; validate arguments with Schema validate for A-1042.
  • Use JSONPath extract for $[1].params.name and $.network_policies.*.endpoints[*].deny_rules.
  • Diff policy before/after widening with JSON Diff; check new tool allows before changing prompts.
  • openshell logs --tail --source sandbox for matched_rule and fail-closed.
  • Redact tokens in audit and messages with redact. JSONSort runs locally in the browser.

When all four align, you can tell harness Allow mistakes, L7 deny, batch collateral, or missing Schema on arguments.

Häufige Fallen

  • Assuming MCP connect equals least privilege. Without L7 tool rules, any tools/call on the same socket may pass.
  • Allow * tools/call then deny one write. Docs forbid combining a catch-all tools/call rule with tool-specific allows.
  • Hiding a refund inside allowed tool arguments. L7 ignores arguments; writes must be denied by tool name.
  • Ignoring batch semantics. Lookup plus refund in one array denies both—split requests.
  • Checking only model output, not sandbox egress. The supervisor sees process JSON-RPC.
  • Treating this as the full four-layer stack. MCP overflow focus; see agent-sandbox-schema-tool-policy for Schema + manifest + sandbox.

FAQ

How is this different from nvidia-openshell-agent-sandbox-json?

That article covers openshell-sandbox, Landlock, TOFU, and protocol split. This one is L7 tools/call overflow, batches, and audit JSON.

Are deny_rules the same as harness deny?

No. Harness blocks session tool intent; deny_rules block specific tool names on egress to the MCP endpoint. Keep both policies.

Can policy deny by order_id in arguments?

OpenShell docs do not support params/argument matching today. Use host JSON Schema for order id shape.

Does MCP security filter tools/call response JSON?

Per current docs, server responses and SSE MCP messages are forwarded without policy parsing. Still validate return bodies.

What does Sentry do on the safety platform?

Optional hardware layer: correlates policy decisions, tool access, and identity; isolates on overflow. It does not replace deny_rules in policy.

Fazit

Stopping MCP overflow is supervisor L7 work: least privilege per outbound tools/call, fail-closed batches, decisions as audit JSON—not prompt wishes.

Put lookup_order in allow, refund_order in deny_rules, A-1042 in Schema—align all three and the overflow surface shrinks.

Weiterlesen

Changelog: Erstveröffentlichung