delete_file call deletes a file. A send_email call sends an email. An execute_sql call mutates a database. The risk model is not “could this response be harmful?” — it is “should this agent have been allowed to invoke this tool at all?”
Most observability platforms log LLM completions. None of them see inside MCP tool invocations unless you instrument the transport layer. Cognisafe closes this gap by intercepting the LLM calls that orchestrate tool selection, and by providing a proxy wrapper for MCP client transports that logs every tool invocation as a first-class event.
Why MCP governance is different
Architecture
Governance framework
1
Inventory — know every tool your agents call
Before you can govern tool use, you need a complete inventory. Deploy the Cognisafe MCP interceptor (below) and run your agents in audit-only mode for one sprint. At the end, query:This gives you the full tool call matrix: which agents call which tools, and how often. This is your baseline. Any tool appearing after this baseline was established will trigger a first-seen alert.
2
Trust levels — define agent-to-tool authorisation
Encode your authorisation policy as a Cognisafe custom scorer. The simplest form is a
keyword_list scorer that fires when a restricted tool is called by any agent not on an allowlist.Create evals/scorers.yaml entries for each sensitivity tier:3
Audit — tamper-evident log for every tool invocation
Every MCP tool call is written to
llm_requests with:request_body:{"type": "mcp_tool_call", "tool_name": "send_email", "arguments": {...}}response_body: the tool resultagent_name: the calling agentcreated_at: timestamp (TimescaleDB hypertable — immutable by partition)safety_scores: any scorer results
llm_requests table append-only for the application role.4
Alerting — webhook on threat_detected
Configure a Cognisafe webhook for The webhook payload includes
threat_detected events. Every time a mcp_destructive_tool or mcp_external_comms scorer fires, your security team receives a notification within seconds.agent_name, tool_name, arguments, session_id, and a link to the full request in the Cognisafe dashboard.Python implementation
Wrap the MCP client’scall_tool method to route invocations through Cognisafe before they reach the MCP server.
Dangerous tool patterns
These are the tool name patterns that most commonly appear in security incidents involving agentic AI systems. Add them to your custom scorers as your inventory grows.File system operations
write_file, delete_file, move_file, execute_command, run_script, create_symlinkRisk: data destruction, code execution, privilege escalation via symlinkExternal communications
send_email, post_message, create_ticket, http_post, slack_send, teams_notifyRisk: data exfiltration, social engineering at scale, shadow communication channelsData access and export
query_database, export_data, read_secrets, get_credentials, list_users, dump_tableRisk: credential theft, PII exfiltration, bulk data exposureInfrastructure control
restart_service, scale_deployment, modify_config, update_dns, revoke_certificateRisk: availability impact, lateral movement, configuration driftPolicy patterns
Block on PII in tool arguments (regex scorer)usage_alert webhook for new_tool_detected events. When an agent calls a tool name that has never appeared in your llm_requests table for that project_id, Cognisafe fires the webhook. Your operations team reviews and approves or blocks the tool before it becomes routine.
Require human-in-the-loop for financial tools
For tools that trigger financial transactions (create_payment, issue_refund, transfer_funds), implement a HITL gate in your orchestrator that pauses execution and awaits approval:
Compliance evidence
The MCP tool invocation log in Cognisafe directly satisfies the following SOC 2 controls:
For ISO 27001 (A.12.4 — Logging and monitoring), export the
llm_requests table (filtered to request_body->>'type' = 'mcp_tool_call') to your evidence repository at each audit cycle.
MCP is a rapidly evolving specification. Tool name conventions vary between MCP server implementations. Build your keyword_list scorers based on your own inventory (Step 1) rather than assuming standard tool names across all MCP servers.

