Skip to content

feat(runtime): per-skill capability scopes + inline MCP broker#113

Open
theyavuzarslan wants to merge 3 commits into
GoPlusSecurity:mainfrom
theyavuzarslan:feat/skill-capabilities-mcp-broker
Open

feat(runtime): per-skill capability scopes + inline MCP broker#113
theyavuzarslan wants to merge 3 commits into
GoPlusSecurity:mainfrom
theyavuzarslan:feat/skill-capabilities-mcp-broker

Conversation

@theyavuzarslan

Copy link
Copy Markdown
Contributor

Summary

Two independent runtime features for review:

  • Per-skill capability scopes — resolve an exec/network/filesystem allowlist per skill and emit CAPABILITY_*_DENIED reasons when an action falls outside it. Local capability manifests overlay cloud policy with local precedence; capability denials bypass the auto-allow gate.
  • Inline MCP broker — a JSON-RPC stdio proxy that vets tools/call traffic against the runtime policy and fails closed on both block and require_approval. Exposed via a new mcp-broker CLI command.

Test plan

  • npm run build (tsc, clean)
  • node --test dist/tests/*.test.js — 436 tests, 0 failures
  • New coverage: src/tests/capabilities.test.ts, src/tests/mcp-broker.test.ts

🤖 Generated with Claude Code

theyavuzarslan and others added 2 commits June 22, 2026 19:04
Resolve a per-skill capability scope (exec/network/filesystem allowlists)
and emit CAPABILITY_*_DENIED reasons when an action falls outside it.
Local capability manifests overlay cloud policy with local precedence,
and capability denials bypass the auto-allow gate.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add a JSON-RPC stdio proxy that vets tools/call traffic against the
runtime policy and fails closed on both block and require_approval.
Exposed via a new `mcp-broker` CLI command.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

AgentGuard PR Review

I found one actionable issue in the patch.

  1. severity: highsrc/runtime/mcp-broker.ts (runMcpBrokerStdio, child stderr handling)
    • What can go wrong: the broker forwards the downstream server’s stderr directly to the client’s stderr without serialization or framing, while synthesized JSON-RPC veto responses are written to stdout. For clients that merge both streams, a malicious or buggy downstream MCP server can emit JSON-looking content on stderr that is indistinguishable from broker output, or race with broker diagnostics and confuse parsers/logging. More importantly, the broker’s own onBlocked logs in src/cli.ts also write to stderr, so downstream output and broker warnings can interleave unpredictably and corrupt operator-facing audit trails.
    • Concrete fix: route all broker-generated and downstream diagnostic output through a dedicated, framed writer or keep downstream stderr isolated from broker diagnostics. At minimum, prefix and serialize broker logs separately from child stderr, and avoid emitting JSON-RPC-like content on stderr.

- mcp-broker: funnel downstream stdout and synthesized JSON-RPC errors
  through a single serialized, backpressure-aware writer so an injected
  veto can never interleave mid-message with a downstream response.
- mcp-broker: wait for in-flight evaluations and their client writes to
  drain before resolving on child exit, so a block response is never
  dropped when the child exits early. Child exit code still propagates.
- capabilities: distinguish a missing manifest (silent, normal) from a
  present-but-malformed one (loud stderr warning) instead of silently
  dropping all per-skill confinement.
- capabilities: document that the "*" wildcard scope only applies to
  skills without an explicit entry and is an opt-in, never an override.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant