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
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.
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).
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).
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_issuesbut notdelete_project) - Require
confirmed=truefor 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
| Surface | Admin Panel section | Shipped in |
|---|---|---|
| Overview dashboard (live KPIs + alert deep-links) | Overview | v2.0.832 |
| Audit log | Evidence → Audit Log | baseline |
| PII sanitization config | Protection → Data Sanitization | baseline |
| Sanitization counts (delivered, withheld, replaced values, NER lookups) | Evidence → Sanitization Stats | v2.0.3797 |
| Throughput dashboard | Evidence → Data Usage | v2.0.819 |
| Threshold & Slack alerts | Evidence → Data Usage → Thresholds | v2.0.820 |
| Policy hooks | Workload → Hooks | baseline |
| Data Usage retention & storage limits | Evidence → Data Usage | v2.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
- Action Usage — which actions agents actually call, ranked, with audit-log drill-down on failures
- Notifications — the operator-alert dispatcher (Slack DM / Teams / Email fallback chain)
- Access Model — roles, permissions, audit, and the RBAC questions answered honestly
- Context Map — the curated org-context layer; every
company_context_writeand refused write lands in the audit log on the same forensic substrate - Dynamic action discovery isn’t novel. Doing it safely is. — the risk-tagged action model that complements the policy-hooks layer
- Hooks reference — full hook configuration syntax and the built-in hook catalog
- Configuration reference — the rest of the gateway’s YAML