Overview
Agent Sentinel exposes two MCP protocol endpoints:/mcp for agents executing governed tools and /mcp/admin for platform administration. Both use JSON-RPC 2.0 over stateless streamable HTTP with JSON responses, without persistent sessions or an SSE stream. The older /api/v1/mcp/* REST facade is documented below.
Endpoint and auth
Send requests toPOST /mcp with Authorization: ApiKey <agent-bound-key>, Content-Type: application/json and Accept: application/json, text/event-stream.
Only agent-bound API keys are accepted. The organization and agent identity come from the key; X-Sentinel-Agent-Id cannot override them. A user session or unbound key receives HTTP 403 with top-level reason_code: "agent_bound_key_required". Missing authorization receives HTTP 401.
The server supports initialize, ping, tools/list and tools/call. Use an MCP client to initialize and negotiate the protocol before calling tools. tools/list returns only enabled governed tools in the caller’s organization, ordered by name; it does not expose the admin tools.
For example, after registering the send tool below, list tools:
inputSchema field (the registry uses input_schema):
Registering governed tools
Operators register executable targets through/api/v1/governed-tools, using a user session. All registry routes refuse API keys, bound or unbound. Reads require organization membership; writes require OWNER or ADMIN. Tools belong to the active organization; another organization’s tool returns 404.
Send this JSON body to POST /api/v1/governed-tools (201 on success):
[A-Za-z0-9_.-]{1,64} and be unique within the organization. input_schema must be an object schema of at most 16 KiB serialized. Only POST targets are supported; timeouts range from 1 to 30 seconds (default 10). Use GET on the collection or /{tool_id} to inspect registrations, PATCH /{tool_id} to update and DELETE /{tool_id} to remove them.
Target URLs must use HTTPS, contain no userinfo and resolve only to global addresses. Loopback, private, link-local (including cloud metadata), multicast, reserved and unspecified addresses are refused. HTTP is permitted only with ENVIRONMENT=local. GOVERNED_TOOL_ALLOW_PRIVATE_TARGETS bypasses address checks only when ENVIRONMENT=local; it is ignored elsewhere. Targets are checked at registration and again at execution.
For credential binding and injection, see AgentVault Credentials.
tools/call lifecycle
Call a registered tool by name:- Validate before writes. The tool must be enabled in the caller’s organization. Arguments must be a JSON object, contain only finite numbers, fit within 64 KiB as canonical JSON and satisfy
input_schema. Invalid or unresolvable schema references are refused; remote schemas are never fetched. Optional_meta.run_idand_meta.approval_request_idmust be UUIDs. - Ask the gateway. The executor hashes canonical arguments (sorted keys, compact UTF-8 JSON) into
inputs_digest. Action name, impact, cost and tags come from the tool registration. The gateway can allow, deny or require approval. Denial and approval-required decisions never contact the target. - Verify the decision token. An allow executes only if its token verifies and matches the organization, agent, action and input digest.
- Execute a DNS-pinned POST. The executor revalidates DNS and connects to a checked address while preserving the original Host and TLS SNI. It posts the canonical arguments with
X-Sentinel-Decision-Token. Redirects are not followed, compressed responses are refused, and response reading stops at 1 MiB. - Record and reconcile. A signed
tool_resultledger row records status, response byte count and SHA-256, never the response body. Recording and reservation reconciliation share a transaction; an unverifiable signature prevents that transaction from committing. Whenever the target returned a response status, including a non-2xx status or a failure while reading the body, the reservation reconciles the registered estimated cost. Only a call that never received a response (refused target, connection failure, timeout before headers) reconciles zero. Retries of failed calls therefore consume budget. After validation, the decision, execution and recording task survives caller cancellation.
delivered ✓, success is an HTTP 200 JSON-RPC result:
result.isError: true and result.structuredContent.reason_code. For example, passing {"to":5} fails the registered schema:
Approvals
When the gateway returnsrequire_approval, the tool result has isError: true and structuredContent containing decision, reason_code and approval_request_id. Its text directs the caller to poll GET /api/v1/approvals/{approval_request_id}/poll. No target request has occurred yet.
After approval, retry the same tool with the same arguments, passing the returned UUID in params._meta.approval_request_id:
approval_inputs_mismatch without consuming the approval. Approval redemption is single-use; pending, expired, rejected or already-redeemed approvals cannot authorize execution. See the Approvals API.
Limits
Malformed JSON also produces
-32700. Compressed target responses are refused with tool_response_encoded rather than decompressed.
Error reason codes
These are all reason-code constants defined by the governed tool executor. Read them fromresult.structuredContent.reason_code; execution failures may also include status_code (null if no response was received).
Gateway decisions and refusals can additionally pass through gateway reason codes, such as
no_policy_for_write, monthly_budget_exceeded, group_budget_exceeded and kill_switch_active. Denials include decision: "deny"; approval-required results include decision: "require_approval" and approval_request_id.
Transport and admin errors have separate meanings:
Authentication errors on the protocol mounts are ordinary JSON with a top-level
reason_code when provided, rather than JSON-RPC tool results.
Admin mount
UsePOST /mcp/admin with a user session or an unbound API key and the same content and accept headers as /mcp. Agent-bound keys receive HTTP 403 agent_bound_key_forbidden, including for initialize and tools/list.
This separate server identifies itself as agent-sentinel-admin. tools/list advertises only platform tools with implemented handlers. Unbound keys can list these tools and call read-only handlers such as list_runs; management handlers such as create_policy require a user session. Unknown and handler-less tools return tool_not_found before the management check (for example, get_policy and create_api_key are not advertised).
For example, a user session can send:
structuredContent object containing the handler’s success, data, error and metadata, with isError: false. An unbound key calling this management tool instead gets isError: true with structuredContent.reason_code: "user_session_required". These handlers manage platform state; they do not execute registered governed targets through the /mcp lifecycle.
Legacy REST facade
The remaining examples document the legacy/api/v1/mcp/* REST facade, not the JSON-RPC protocol endpoints. Use /mcp for agent-bound governed tool execution and /mcp/admin for protocol-based administration.
Agent-bound keys are refused with HTTP 403 agent_bound_key_forbidden on the legacy facade’s execution routes: POST /api/v1/mcp/call, GET /api/v1/mcp/resources/{uri} and POST /api/v1/mcp/prompts/{name}. The discovery listings (GET /api/v1/mcp/tools, /resources and /prompts) still accept them. Use a user session for management operations or an unbound key for permitted read-only operations. The following REST payloads retain their legacy field names and envelopes.
Legacy overview
The REST facade exposes platform functionality as:- Tools: Actions LLMs can execute (create policies, approve actions, query data)
- Resources: Data LLMs can read (runs, approvals, stats, policies)
- Prompts: Pre-configured workflows (analyze costs, review approvals, generate reports)
Authentication: management requires a user session
The legacy REST endpoints accept a user session (console login JWT) or an unbound API key, but unbound API keys can only call read-only tools and prompts. An agent must not be able to edit its own governance.- Management tools:
create_policy,update_policy,delete_policy,approve_action,reject_action,create_api_key,revoke_api_key. Management prompt:create_budget_policy. These require a user session. Any API key, bound to an agent or not, gets403with"management operations require a user session, not an API key". - Read-only tools and prompts (listing,
get_*, stats, compliance, the advisor tools includingdraft_policy_update, which never applies its draft) stay available to unbound API keys. - The rule is default-deny: a tool or prompt that is not explicitly classified read-only is refused to API keys.
GET /api/v1/mcp/toolsandGET /api/v1/mcp/promptslist everything, withrequires_user_session: trueon management entries.
Legacy endpoints
List available tools
Execute MCP tool
List available resources
Get resource data
List available prompts
Execute prompt template
Using the legacy facade with Claude
Give Claude access to Agent Sentinel via tool use:Using the legacy facade with OpenAI
Legacy example workflows
Autonomous approval management
Cost optimization analysis
Compliance reporting
Legacy best practices
See also
- SDK MCP Client - Python SDK for MCP integration
- Approvals API - Approval workflow endpoints
- Policies API - Policy management endpoints