Security Model
Status: Available.
msh local is a selective MITM HTTPS proxy. For tools configured to use it, the proxy intercepts selected TLS traffic between CLI tools and their upstream APIs, classifies each request into a risk tier, applies a YAML policy, and audit-logs inspected requests in enforce mode. The tool uses its existing upstream credentials through the proxy.
How it works
- The AI agent's CLI tool is pointed at the msh local daemon via
HTTPS_PROXYor a per-tool config (e.g.KUBECONFIG). - The daemon terminates TLS using a locally-generated ECDSA CA, classifies the request, and evaluates the policy.
- If the policy says
allow, the request is forwarded. Ifdeny, a 403 is returned. Ifescalate, the connection blocks until a human approves or denies via the desktop app or CLI. - Every inspected request in enforce mode is audit-logged to
~/.mezite/local/audit.jsonl.
There is no system-wide packet capture (pf / nftables). Reach is entirely through HTTPS_PROXY / per-tool configuration.
Key properties
- Local-first — the daemon runs on the operator's machine. No cloud control plane is required.
- Fail-closed for inspected traffic — unknown commands, unrecognised CLIs, and classification errors default to
escalate(the policy default) when the request reaches the proxy. Traffic sent directly upstream is outside this decision. - Four risk tiers —
observe(read-only),modify(writes),sensitive(deletes, secrets),break-glass(IAM, admin). There is no fifth tier. - Blocking approvals — escalated requests block the AI agent's HTTP connection until a human responds. No polling; no retries needed.
- Best-effort audit — inspected requests in enforce mode are logged locally. The local log is not hash-chained or tamper-evident. Enrolled workstations also upload audit events to MezHub; rely on that central record.
- ECDSA CA — the daemon generates a local ECDSA P-256 CA and per-connection leaf certificates. Tools that verify TLS must trust this CA.
Transparent proxy model
AI agents present no identity to msh local. The proxy does not issue per-AI-agent kubeconfigs, client certificates, or bearer tokens to AI agents. The AI agent's existing credentials are used as-is; the daemon intercepts the connection before it reaches the upstream.
This means:
- No per-AI-agent enrolment step.
- No token management or rotation.
- Policy is applied uniformly to all traffic that passes through the daemon, regardless of which AI agent sent it.
File permissions
All sensitive files are created with restricted permissions:
| File | Permissions | Description |
|---|---|---|
~/.mezite/local/ca.key | 0600 | CA private key |
~/.mezite/local/policy.yaml | 0600 | Access policy |
~/.mezite/local/audit.jsonl | 0600 | Audit log |
~/.mezite/local/ | 0700 | Config directory |
Scope and limits
The local proxy has the following boundaries:
- Local filesystem boundary — the local audit log is append-only by convention. An operator with filesystem access can alter or delete it. There is no
prev_hashlinking or chain verification. When enrolled, rely on the audit events uploaded to MezHub. - No AI agent identity — there is no mTLS / SPIFFE identity model, no bearer-token AI agent auth, and no per-AI-agent kubeconfig or client certificates in the current release.
- No JIT credentials — credential injection (short-lived ServiceAccount tokens per request) is not implemented.
- No session recording — exec/attach sessions are not recorded.
- Managed workstations — enrol with MezHub for centrally managed policy and audit upload. See Managed Policy.
Local JIT credentials and local interactive session recording are on the roadmap. Mezite’s SSH session recording is separate. This page will be updated as features ship.
Threat model
If an AI agent is compromised: requests it routes through msh local are subject to classification, policy, and enforce-mode audit when their hosts are inspected. The proxy does not confine a hostile agent: it can remove proxy settings and contact upstream services directly with its existing credentials. Mandatory routing requires a separate network or process boundary.
Blast radius limits: policy can deny entire tiers or specific commands. Setting default: deny at the protocol level means any unmatched request is blocked.
Trust boundary: the daemon runs as the operator's OS user and holds the operator's cloud credentials. An attacker who can write~/.mezite/local/policy.yaml or kill the daemon process can bypass policy. Protect the config directory with standard OS-level access controls.