AI Agent Setup

Status: Available.

msh local is a transparent MITM proxy. AI agents present no identity to the daemon — there are no per-AI-agent kubeconfigs to generate, no client certificates to mint, and no tokens to manage. You point the AI agent's tool at the proxy and the daemon intercepts and classifies traffic automatically.

How AI agents reach the proxy

The daemon listens on a local HTTPS port. Route an AI agent's CLI tool through it by setting the appropriate environment variable or config option before starting the AI agent.

HTTPS_PROXY (generic)

Most CLI tools and HTTP clients respect HTTPS_PROXY:

export HTTPS_PROXY=http://127.0.0.1:9443
# (9443 is the default; check `msh local status` for proxy_listen)

The easiest way to set this up is msh local shell-init, which prints a shell-rc snippet exporting HTTPS_PROXY/HTTP_PROXY plus the CA bundle variables (SSL_CERT_FILE, REQUESTS_CA_BUNDLE, NODE_EXTRA_CA_CERTS,AWS_CA_BUNDLE, GIT_SSL_CAINFO) pointing at $HOME/.mezite/local/ca-bundle.pem(system roots + the msh local CA).

Tools that use HTTPS_PROXY automatically: curl, many Go and Python HTTP clients, AWS CLI, Fly CLI, and others.

kubectl — KUBECONFIG

kubectl (client-go) respects HTTPS_PROXY, so with the shell-initenvironment active your existing kubeconfig keeps pointing at the real cluster — requests are routed through the daemon transparently.

One caveat: because the proxy re-signs TLS, kubectl must trust the msh local CA. If your kubeconfig pins the cluster CA withcertificate-authority-data, replace it with the msh local bundle:

clusters:
  - name: my-cluster
    cluster:
      server: https://my-cluster.example.com # the REAL cluster URL
      certificate-authority: /Users/you/.mezite/local/ca-bundle.pem

Replace the CA bundle path with its actual absolute path. Kubeconfig does not expand ~. For a loopback cluster, also set proxy-url: http://127.0.0.1:9443 in the cluster entry; environment proxy settings skip loopback destinations.

kubectl get pods   # observe-tier read — passes through, logged

kubectl performs TLS verification. Export the daemon's CA and add it tocertificate-authority-data (base64-encoded) so kubectl trusts the proxy's certificates.

gcloud / Fly / other CLIs

For CLIs that use environment-level HTTPS proxying, set HTTPS_PROXYbefore launching the AI agent process. The daemon intercepts the TLS connection and applies policy from the matching protocol block in~/.mezite/local/policy.yaml.

Selecting which hosts to intercept

The daemon only MITMs hosts listed under inspect: in the protocol block for that tool. If a host is not listed, the daemon passes the connection through without inspection.

Example — adding a private EKS cluster endpoint:

kubectl:
  inspect:
    - "*.eks.amazonaws.com"        # managed EKS
    - "my-private-cluster.corp"    # private cluster
  ...

See Policy Configuration for the full schema.

Trusting the daemon's CA

The daemon generates a local ECDSA P-256 CA on first run and stores it at ~/.mezite/local/ca.crt (public) and ~/.mezite/local/ca.key (private, 0600).

For tools that perform TLS verification independently of HTTPS_PROXY:

# Show CA path, fingerprint, validity, and trust state
msh local ca info

# Path to the CA certificate
~/.mezite/local/ca.crt

Add ~/.mezite/local/ca.crt to the tool's trusted CA bundle, or export it ascertificate-authority-data in a kubeconfig.

Checking proxy status

# Show daemon status and listen address
msh local status

# Run diagnostic checks
msh local doctor

Policy applies to all intercepted traffic

Once an AI agent's tool is routed through the daemon, all requests matching an inspect: entry are classified and evaluated against~/.mezite/local/policy.yaml. Read-only requests in the observe tier pass immediately (per the default policy). Write, sensitive, or break-glass requests escalate for human approval unless the policy explicitly allows them.

There is no per-AI-agent identity in the current release. All traffic through the daemon is governed by the same policy file. If you need different policies for different AI agents, use separate daemon instances or wait for the per-user identity feature planned for a future release.