NeuralTrust controls
The trustguard-cursor-plugin
package provides the firewall hooks and can also register TrustGate as an MCP
server. Configure the two functions independently.
Deployment options
Before you start
Create the policy in Observe mode. Observe records decisions in Activity
without enforcing them. Review the results, then switch the policy to
Enforce. See Policies.
Set up prompt and tool screening (TrustGuard)
Install the plugin
In Customize → Plugins, import the trustguard-cursor-plugin repository from GitHub or a Git URL. Exact UI labels vary by Cursor version. Teams can distribute the plugin through the Cursor Team Marketplace. For an offline pilot, or to use Customize → Plugins → Add → From Local Repo, clone the repository locally:make install-local copies the plugin into
~/.cursor/plugins/local/trustguard. Cursor rejects out-of-tree symlinks.
Deploy the managed config
Deploy this file with MDM:
On first use, the plugin bootstrap downloads the checksum-pinned
trustguard-cursor binary from GitHub Releases. MDM can deploy the config file;
distribute the plugin package separately if you need to pin a private fork.
For pilots without MDM, write the same JSON shape to
~/.trustguard/cursor.json and chmod 600 it.
Set up governed tool access (TrustGate)
Cursor treats TrustGate as a remote MCP server: oneurl per MCP consumer,
and the agent sees the merged toolkit that consumer is routed to. Copy the
endpoint or Cursor snippet from the consumer’s Connect tab:
mcp.json, but not both. Two entries
pointing to the same URL duplicate every tool.
Option A: plugin variables
The same plugin registers a remote MCP server named TrustGate. Values are Cursor plugin variables (Customize → Plugins → Configure), notcursor.json:
OAuth consumers need only the URL. Cursor starts the login flow on first tool
use. A team admin can set the variables for a Team Marketplace installation.
Option B: mcp.json
Write the server into.cursor/mcp.json (project) or ~/.cursor/mcp.json
(global). Cursor loads both files; see Configuration for
precedence.
OAuth consumers (recommended). Omit headers and let Cursor run the
handshake:
${env:VAR} in url and headers, so a committed project file
does not contain the secret. Export the variable through a shell profile or your
secret-management tooling, then reload the window.
Private (Hybrid) data plane. Add the
gateway slug unless the MCP host already scopes
the gateway:
X-AG-Gateway-Slug alone.
After editing mcp.json, refresh the server (or toggle it off and on) in
Customize. Editing the file alone does not reconnect an already-loaded
server.
Team rollout
For a team rollout, register the consumer in the Cursor dashboard instead of requiring each developer to editmcp.json:
Allowlisting approves a configuration; it does not install or enable the server.
Keep the tool scope on the consumer or role. The Cursor-side tool allowlist
governs automatic execution, not what the agent can see.
Verify
Firewall.- Open Cursor and send a test prompt.
- Confirm the event in TrustGuard Activity.
consumer_idis typicallycursor:<email>when the Cursor account email is present.
- Confirm TrustGate is enabled under Customize → MCP, and that its tools appear under Available Tools in chat.
- Ask the agent to list or use a tool from a toolkit bound to that consumer.
- Confirm the call in TrustGate telemetry. See Metrics.
Cmd+Shift+U) and
select MCP Logs.
Reference
Coverage
TrustGuard evaluates Cursor prompts, tool calls, and tool results on the
developer’s machine.
Ask. Cursor displays an approval prompt for Ask on tool calls. The prompt
reads
A TrustGuard policy needs your approval to continue. rather than the gate
name. At beforeSubmitPrompt, Ask submits the prompt with a warning because no
approval dialog is available. Use Block to stop a prompt.
Limits. This collector does not support redaction. transform maps to ask
by default, so a masking policy becomes a warning unless
transform_action: "deny" is set.
postToolUse is warn-only. A finding is added as untrusted context; no permission
decision is emitted, and the completed tool call cannot be revoked. The hooks do
not evaluate model responses or tool declarations. Use TrustGate to control which
tools are available.
Full comparison: Coverage.
What is evaluated
Every hook calls
POST /v1/evaluate with the
collector tgk_… key, and the policy’s
detectors decide the verdict. MCP tool calls
pass through the hooks like any other tool call.
For a hook name such as mcp__<server>__<tool>, tool.name is the final
<tool> segment. It does not include the server name. Gate on the short tool
name, not the full hook tool_name.
Configuration
cursor.json (TrustGuard firewall only). Keys: data_url, api_key,
fail_mode. It never holds MCP values. When the managed file includes
api_key:
- Locked:
api_key,data_url,fail_mode. A user file and environment variables cannot replace them. - User-overridable settings may still be loaded from
~/.trustguard/cursor.json:timeout_ms,transform_action,events,consumer_id.
~/.trustguard/cursor.json (chmod 600).
mcp.json (TrustGate only). Two scopes are loaded:
When the same server name exists in both, the project configuration takes
precedence in that workspace. Cursor infers the transport from the keys:
url means remote,
and command means local. Do not mix them in one entry. TrustGate always uses
url.
Auth headers. TrustGate accepts X-AG-API-Key, x-api-key, or
Authorization: Bearer ag_…. For OAuth it advertises discovery at
/.well-known/oauth-authorization-server and
/.well-known/oauth-protected-resource and supports dynamic client
registration. The Cursor configuration does not require a client ID or secret.
Cursor authenticates from two fixed callbacks:
https://www.cursor.com/agents/mcp/oauth/callback (web and Cloud Agents) and
http://localhost:8787/callback (desktop). TrustGate accepts both, so they do
not need to be allowlisted per developer. Cursor’s static auth block
(client ID and secret) is for providers without dynamic registration and is not
needed here. The consumer configuration determines which IdP handles the login.
See Auth.
Use OAuth for consumers that resolve tools per user. The identity used to log in
selects the roles, and therefore the registries and tools, on
Identity-based consumers.
Tools and approvals
TrustGate defines the consumer’s tool set. Cursor applies additional settings on the local machine:
Cursor Run Mode and server visibility apply only to the local client. Configure
restrictions that must apply to every client on the consumer or role. To limit
MCP tool calls, attach the Per-Tool Rate
Limiter policy. The Tool Injection policy
is LLM-only and does not affect MCP.
Attributes
attributes.collector.type = "ide"attributes.source.application = "cursor-plugin"attributes.cursor.event, workspace, and related fieldsconsumer_idtypicallycursor:<email>
consumer_id, providing
per-developer attribution when the email is available.
Gate on source.application and/or tool.name / tool.command. Do not rely on
attributes.tool for MCP preToolUse; the name is on the payload.
Troubleshooting
Related
- Policies: Gates: Ask and Block configuration
- Evaluate API: requests sent by the hooks
- MCP overview: consumers, catalog merging, and upstream authentication
- Plugin repository: source, releases, and the hook contract
- Cursor MCP documentation and Cursor plugin variables
- TrustGate authentication: API key and OAuth2 authentication for MCP consumers
- Coverage: comparison of Cursor with other collectors