Guardrails
Rate limiting, alerts and the audit trail for MCP tool calls.
The MCP adapter wraps every tool call with rate limiting, alerting and audit. The point is that an agent can't quietly hammer your data or slip past RBAC.
- Rate limiting — a per-agent-key sliding window (default 100 / 60s). Over-limit calls return an
isErrorresult and fire awarnalert. - Alerts — an injected
AlertSink(default console; webhook/slack via config underadapters.mcp.guardrails.alerts). - Audit — every tool attempt writes
mcp.tool.<name>to the unifiedweavekit_audittable (action prefixACTION_PREFIXES.MCP_TOOL), including RBAC denials and failures.actorIdis the agent key;metacarries{ onBehalfOf, subjectId, roles, agentLabel, tool }. Audit is best-effort — a failing sink never blocks the tool call. - Impersonation — a call-level
onBehalfOftool argument is disabled by default (mcp.impersonationdefaults tooff); set it to'directory'to let an agent switch to any identity in the configured directory per call. See Identities.
For the policy pipeline behind these (custom tools, requireApproval, replay), see
Custom tools & guardrails. For the durable trail,
see Audit.