Protocols

Status: Available.

msh local's policy engine supports rules scoped to multiple infrastructure protocols. A single ~/.mezite/local/policy.yaml file governs AI agent access across different systems.

Supported protocols

ProtocolClassifierScope keys
kubectlKubernetes API operationsnamespaces
gcloudGoogle Cloud CLI / googleapis.comprojects, regions, zones, orgs
flyFly.io CLI / api.fly.ioapps, orgs
awsAWS CLI operationsregions
githubGitHub CLI (gh)(inspect-only; no scope-sugar)
terraformTerraform / OpenTofu CLI classification only(inspect-only; no scope-sugar)
helmHelm CLI classification only(inspect-only; no scope-sugar)
cloudflareCloudflare CLI(inspect-only; no scope-sugar)
genericAny inspected HTTPS host, tiered by HTTP method and destructive path segmentsnone (flat rules: only)

Local SSH interception is not yet supported. Mezite providesSSH Access through its server proxy. There is nossh: policy block in the current release.

Policy format

The top level of policy.yaml is keyed by protocol name. Each block follows the same structure: inspect: (hosts to MITM), default:(fallback action), groups: (named tier/command selectors), optional scope-sugar lists, and a flat rules: fallback.

kubectl:
  inspect:
    - "*.eks.amazonaws.com"
    - "*.gke.goog"
    - "*.azmk8s.io"
  default: escalate
  groups:
    read:
      tiers: [observe]
    mutate:
      tiers: [modify]
    delete:
      tiers: [sensitive]
    admin:
      tiers: [break-glass]
  namespaces:
    - names: ["*"]
      rules:
        allow:
          groups: [read]
        escalate:
          groups: [mutate, delete, admin]
  rules:
    allow:
      groups: [read]
    escalate:
      groups: [mutate, delete, admin]

gcloud:
  inspect:
    - "*.googleapis.com"
  default: escalate
  groups:
    read:
      tiers: [observe]
    mutate:
      tiers: [modify]
    destructive:
      tiers: [sensitive]
    iam:
      tiers: [break-glass]
  projects:
    - names: ["*"]
      rules:
        allow:
          groups: [read]
        escalate:
          groups: [mutate, destructive, iam]
  rules:
    allow:
      groups: [read]
    escalate:
      groups: [mutate, destructive, iam]

fly:
  inspect:
    - "api.fly.io"
    - "api.machines.dev"
    - "*.fly.dev"
  default: escalate
  groups:
    read:
      tiers: [observe]
    mutate:
      tiers: [modify]
    destructive:
      tiers: [sensitive]
    admin:
      tiers: [break-glass]
  apps:
    - names: ["*"]
      rules:
        allow:
          groups: [read]
        escalate:
          groups: [mutate, destructive, admin]
  rules:
    allow:
      groups: [read]
    escalate:
      groups: [mutate, destructive, admin]

aws:
  inspect:
    - "*.amazonaws.com"
    - "*.amazonaws.com.cn"
    - "*.aws.amazon.com"
    - "*.api.aws"
  default: escalate
  groups:
    read:
      tiers: [observe]
    mutate:
      tiers: [modify]
    destructive:
      tiers: [sensitive]
    iam:
      tiers: [break-glass]
  regions:
    - names: ["*"]
      rules:
        # Hard-deny a handful of catastrophic, irreversible
        # operations outright — no approval prompt, just refused.
        deny:
          operations:
            - DeleteVpc
            - ScheduleKeyDeletion
            - DeleteOrganization
            - LeaveOrganization
            - CloseAccount
            - DeleteBucket
            - DeleteHostedZone
        allow:
          groups: [read]
        escalate:
          groups: [mutate, destructive, iam]
  rules:
    deny:
      operations:
        - DeleteVpc
        - ScheduleKeyDeletion
        - DeleteOrganization
        - LeaveOrganization
        - CloseAccount
        - DeleteBucket
        - DeleteHostedZone
    allow:
      groups: [read]
    escalate:
      groups: [mutate, destructive, iam]

The AWS classifier derives service/region from the endpoint hostname, applies per-operation tier rules, and floors credential-bearing services (IAM/STS/KMS/Organizations/SSO/Secrets Manager) to break-glass.

Scope-sugar blocks

Scope-sugar lists filter rules to a specific project, namespace, app, or other label extracted from the request. Blocks are first-match-winsdown the list.

kubectl — namespaces

kubectl:
  ...
  namespaces:
    - names: [prod-*, production]
      rules:
        escalate:
          groups: [mutate, delete, admin]
        allow:
          groups: [read]
        deny:
          groups: [exec]
    - names: ["*"]
      rules:
        allow:
          groups: [read]
        escalate:
          groups: [mutate, delete, admin]

gcloud — projects, regions, zones, orgs

gcloud:
  ...
  projects:
    - names: [my-prod-project]
      rules:
        escalate:
          groups: [mutate, destructive, iam]
        allow:
          groups: [read]
    - names: ["*"]
      rules:
        allow:
          groups: [read]
        escalate:
          groups: [mutate, destructive, iam]

fly — apps, orgs

fly:
  ...
  apps:
    - names: [my-prod-app]
      rules:
        escalate:
          groups: [mutate, destructive, admin]
        allow:
          groups: [read]
    - names: ["*"]
      rules:
        allow:
          groups: [read]
        escalate:
          groups: [mutate, destructive, admin]

aws — regions

aws:
  ...
  regions:
    - names: [us-east-1, eu-west-*]
      rules:
        escalate:
          groups: [mutate, destructive, iam]
        allow:
          groups: [read]
    - names: ["*"]
      rules:
        allow:
          groups: [read]
        escalate:
          groups: [mutate, destructive, iam]

The operations: selector — pinning a specific API call

For protocols whose on-the-wire command is just an HTTP method (aws, gcloud), the real API verb lives in the classifier's operation label, not in commands:. Use the operations: selector to match it — a glob over the operation string (<service>.<collection>.<verb> for gcloud, the API action name for aws). The shipped default policy uses it to hard-deny a handful of catastrophic, effectively irreversible operations outright, with no approval prompt:

aws:
  regions:
    - names: ["*"]
      rules:
        deny:
          operations:
            - DeleteVpc # tears down an entire VPC
            - ScheduleKeyDeletion # irreversibly destroys a KMS key
            - DeleteOrganization # nukes the whole AWS Organization
            - DeleteBucket # removes an S3 bucket
            - DeleteHostedZone # tears down a Route 53 DNS zone

gcloud:
  projects:
    - names: ["*"]
      rules:
        deny:
          operations:
            - cloudresourcemanager.projects.delete # deletes a whole GCP project
            - cloudresourcemanager.folders.delete # deletes a resource folder
            - compute.networks.delete # tears down a VPC network
            - cloudkms.cryptoKeyVersions.destroy # destroys a KMS key version

Precedence is deny > escalate > allow, so an operations: deny wins even though those calls also sit in the destructive/iam groups.

generic: — arbitrary HTTPS hosts

The generic: block tiers requests from the HTTP method, raising destructive-looking path segments to at least sensitive, and applies to any host listed under inspect:. The wildcard * is legal under generic.inspect: only.

generic:
  inspect: [] # add hosts here; ships empty so nothing is MITMd by default
  default: escalate
  groups:
    read:
      tiers: [observe]
    mutate:
      tiers: [modify]
    destructive:
      tiers: [sensitive]
    admin:
      tiers: [break-glass]
  rules:
    allow:
      groups: [read]
    escalate:
      groups: [mutate, destructive, admin]

Glob patterns

All names: and inspect: values support glob patterns:

PatternMatches
"payments"Exact match
"staging-*"Any name starting with staging-
"*"Everything (catch-all)

Local SSH interception — coming soon

Coming soon. SSH interception is on the roadmap and not yet available in the shipping release. There is no ssh: policy block; adding one has no effect. This page will be updated when SSH support ships.

Planned local SSH gateway support would intercept SSH connections and apply tier-based policy to shell sessions and SCP transfers. No configuration is available yet.

Validation

The policy engine rejects documents that reference unknown groups, contain empty rules: branches, or use * under a non-genericinspect: list. Glob patterns are compiled at load time; malformed patterns are a load error.

If a protocol block fails validation the entire policy reload is rejected. The daemon logs the error and keeps the previous working policy — no requests are dropped.