Docs / Admin: Compliance

Compliance

mcpgate's compliance surface is four layers stacked on the same audit trail. Each one answers a different question — what flowed through, what got redacted, when a lot suddenly left, and what was blocked before it ever happened.

The compliance surface, end to end

AI client Claude · ChatGPT · … Policy hooks pre-dispatch deny / enrich / route PII sanitizer pseudonymize out rehydrate back Upstream tool Jira · Drive · … Audit log — actor · service · action · payload size · result · timestamp every hop appended here, no PII (uses pseudonyms), retained per your config Throughput DLP lens · alerts Slack: user@co exceeded 50 MB/h outbound

1. Audit log

Every action that touches the gateway appends a row to the audit log: which actor (pseudonymized user ID), which service, which action, request and response byte counts, the result code, and the timestamp. No PII — the audit log uses the same pseudonym layer the LLM does, so even an exfiltrated audit dump does not reveal real names or emails.

Where it lives: Admin Panel → Evidence → Audit Log. Filterable by actor, service, action, time window, and result.

Retention: 90 days, fixed. For a longer trail, export to your own archive.

The mcpgate Admin Panel showing the Audit log page (Compliance section). Sidebar visible on the left with sections General, Workload, Compliance (current group), and Help. Main content shows a chronological event stream — Instance Config Changed in yellow, multiple Hook Denied Action rows in red across different services (Slack, Jira, GitLab, Notion delete/archive operations), a cluster of Throughput Alert Fired rows for user a4e8c6b2 (alert_30m level), and a sequence of Tool Call Completed rows in green for google_workspace_write_actions / drive_files_export. Right-side severity filters (RED / YELLOW / GREEN), Any-time toggle, Auto-tail toggle. Footer reads '125 events shown · 125 stored · 90-day retention'.
The Audit log surface in the Admin Panel. The branding-change event (yellow `Instance Config Changed` at the top) was captured during this screenshot session — proof that audit captures real activity alongside the seeded demo events below.

2. PII sanitization

Before any payload reaches the LLM, the sanitizer replaces emails, phone numbers and other matched values with tokens. Names in free text are replaced only with the option Baseline + name detection. The replacement map is encrypted (AES-GCM) and stored with a 24-hour TTL by default. On the way back, the upstream tool call receives the real values — the LLM never sees them.

Where it lives: Admin Panel → Protection → Data Sanitization (/admin/pii; named PII Sanitization before v2.0.3797). The built-in pattern set covers emails, phones, IBANs, credit cards, and IPs. The page sets a display level for all services and an exception per service. Every value becomes one token; the level decides how much of the value the token shows.

Audit interaction: Each PII post-hook invocation persists a decision row in the audit DB (which fields matched, how many, whether they were redacted or allowed through). That decision row is the forensic record if you ever need to prove what the LLM did or did not see.

3. Throughput as a DLP lens

The Throughput dashboard reads the same audit log, but groups by actor and time window — so a sudden 50 MB outbound spike at 3 am from one user is one row at the top of the page, not a needle in a 50,000-line haystack.

This is what makes Throughput a compliance feature, not just an ops metric. The design intent is data-exfiltration detection. The fact that an admin can also see "who is the heavy user this month" is a side-effect, not the purpose.

What it surfaces:

  • Per-user inbound and outbound byte volume, rolled up to hour / day / week
  • Per-service breakdown — was the volume in Drive downloads, Gmail attachments, BigQuery exports?
  • Anomaly markers when a user crosses a configurable threshold

Where it lives: Admin Panel → Evidence → Data Usage (/admin/throughput). The page shipped in v2.0.819, with persistence moved from Redis to the audit DB in v2.0.822 (so the data survives a Redis flap).

The Data Usage page (per-user volume, 90-day retention). 'Group by user' toggle is on. Filter set to '1 h'. Five users in the table — user a4e8c6b2 stands out with 80.19 MB outbound across 14 calls (full-width brown volume bar, ~21 million tokens estimated). The remaining four users sit at 0.29 to 0.45 MB each (tiny bars). Columns: User, Tool, Client, Calls, Volume (MB), ~Tokens, Last seen.
The exfiltration-shaped anomaly in one frame: in the last hour, one user moved 80 MB out of the gateway while everyone else moved less than half a megabyte. Without this view, that one user is a needle in a 50,000-line audit haystack.

4. Slack alerts on threshold breach

Real-time DLP is the difference between "we noticed something Tuesday" and "the security team got a Slack ping at 3:07 am." One set of thresholds applies to the instance: a warning and an alert for 30 minutes, and an alert for 24 hours, checked for each user. A breach posts to one Slack channel with a deep-link back to the audit row.

Where it lives: Admin Panel → Evidence → Data Usage → Alert thresholds…. The threshold-editor modal accepts sub-MB values (since v2.0.830), so you can alert on small but unusual volumes (a single 200 KB Slack DM with a CSV attachment, say).

A Slack message from the Mcpgate Bot at 16:01 titled 'Throughput alert (30 min)' with fields: User f9e65aa7…, Tool notion_read_actions, Volume 1.62 MB, Calls 10, and a last-seen timestamp.
Real-time DLP — the Slack-channel post fired by the alert scanner when a user crosses the 30-minute outbound threshold. The user hash links straight back to the audit row.

5. Policy hooks — the prevention layer

Audit tells you what happened. Hooks decide what is allowed to happen. They run before dispatch and can deny, enrich, or route based on the actor, the action, the payload, or any combination.

Two-layer scope: company-wide hooks live in Workload → Hooks (or config/hooks/admin/*.yaml) and apply to everyone. Per-user hooks can override or extend them with per-actor logic. Both reload on file change — no restart needed.

Common patterns:

  • Deny destructive actions from a specific group of users (read-only research interns can list_issues but not delete_project)
  • Require confirmed=true for an action with a large reach (container destroy, bulk delete, instance credential reset, device wipe). The gateway asks the caller once; every other write follows the settings of the AI client.
  • Admin-approval gate for the catastrophic class — a generic API passthrough is stopped at the gateway until an admin enables it. The permanent-delete category is off by default and blocks nothing; an admin can turn it on. A container destroy, a bulk delete, an instance credential reset and a device wipe get one question to the caller. See destructive-action governance.
  • Auto-enrich Jira issue descriptions with project templates, add Slack-thread back-links, convert Markdown to ADF
  • Block based on PII match — if the outbound payload contains a customer email not in the allowlist, deny before dispatch

Where it lives: Reference at /docs/hooks/. The Admin Panel → Workload → Hooks page lists which hooks are active and which fired recently.

Where each surface lives in the Admin Panel

SurfaceAdmin Panel sectionShipped in
Overview dashboard (live KPIs + alert deep-links)Overviewv2.0.832
Audit logEvidence → Audit Logbaseline
PII sanitization configProtection → Data Sanitizationbaseline
Sanitization counts (delivered, withheld, replaced values, NER lookups)Evidence → Sanitization Statsv2.0.3797
Throughput dashboardEvidence → Data Usagev2.0.819
Threshold & Slack alertsEvidence → Data Usage → Thresholdsv2.0.820
Policy hooksWorkload → Hooksbaseline
Data Usage retention & storage limitsEvidence → Data Usagev2.0.826

Configuration reference

The audit retention is 90 days and has no setting. The PII levels live in Protection → Data Sanitization (file config/pii_sanitization.yaml).

Throughput thresholds

Defaults in config/throughput_thresholds.yaml. The threshold editor on the Data Usage page overrides them at runtime.

warning_mb_30m: 50
alert_mb_30m: 200
alert_mb_24h: 500
alert_slack_channel: ""        # empty = log only
alert_cooldown_minutes: 60

Where alerts go when something fires

The compliance surface raises alerts in two places. Throughput threshold breaches post to a chosen Slack channel through the throughput page’s own delivery path (configured above). OAuth refresh failures, blocked high-risk actions, PII scrub failures and secret reveals flow through the unified Notifications dispatcher: Slack DM → Microsoft Teams bot → SMTP email, all over your own infrastructure. Setup and the full delivery model live on that page.

Related