Skip to main content

What it does

The Guard MCP Server intercepts Claude Code tool calls before OS execution. It governs bash, read_file, write_file, and web_fetch by routing each call through the Sector8 Admission Controller. This is not a separate policy path. The MCP server uses the same guard engine, invariants, evidence hashing, and telemetry model as the rest of the Guard Module.

Installation

Primary path after installing the SDK:
Then run:
This writes .claude/settings.json for the current project and preserves existing settings keys. The installer writes a relative command entry that targets the checked-in MCP server launcher from the repo root. On Windows it prefers the .cmd wrapper when present. Manual fallback:
On Windows, replace the args path with the .cmd wrapper if present:

How it works

The Guard MCP Server uses the same Admission Controller as the REST API. Policy, telemetry, and forensic records are unified across both paths.

Security guarantees

Fail-closed on guard exception

If any unhandled exception occurs in the evaluation path, the decision is DENY. The tool does not execute. Returned denial:
  • reason_code: GUARD_INTERNAL_ERROR
  • non-empty evidence_hash
  • has_forensic_payload: true
  • decision_trace_id
  • policy_version_id
There is no fail-open path.

Forensic completeness on deny

Every denied MCP response includes:
  • decision
  • reason_code
  • evidence_hash
  • has_forensic_payload
  • decision_trace_id
  • policy_version_id
This is enforced by the deny invariant in CI.

Authorization is enforced, not advisory

The admission path enforces:
  • tool registration
  • capability checks
  • object-level authorization (BOLA)
  • function-level authorization (BFLA)
  • semantic threat scoring
  • segmented-input safety
  • request-risk checks such as SSRF and sensitive path access
  • admission rate limiting

Governed tools

web_fetch protections

web_fetch is not guarded by a simple hostname allowlist. The current request-risk path blocks:
  • raw private IP targets
  • loopback and localhost
  • link-local targets such as 169.254.169.254
  • DNS results that resolve to private IP space
  • unsupported URL schemes
  • URL credentials
  • non-allowlisted external domains
This is designed to stop common SSRF paths, including cloud metadata access.

Example - blocked call

Example - allowed call

Verify the connection

Inside Claude Code:
You should see sector8-guard as a connected server. Then test one allow and one deny:
Expected:
  • echo hello -> ALLOW
  • rm -rf / -> DENY

Fleet deployment

Distribute .claude/settings.json through the repo or developer environment management. Each engineer then gets governed tool execution with the same denial schema and forensic model.

Non-MCP agents

MCP-compatible agents are covered natively. Non-MCP tool callers, including containerized Codex CLI integrations, use the SDK adapter and POST /api/v1/evaluate. See the non-MCP integration guide for the container pattern, required environment variables, and enforcement examples.