Neu: Freigabe von Agenten, Red Teaming und Modell-Scans. Mehr erfahren
MITRITY
Docs / Gateway, Sidecar & Mesh / Configuration Reference

Configuration Reference

Both binaries are configured via YAML config files. Pass the config file path with the --config flag:

mitrity-gateway --config /etc/mitrity/mitrity-gateway.yaml
mitrity-mcp-sidecar --config /path/to/mitrity-mcp-sidecar.yaml

This reference covers all configuration fields for both binaries.

Mitrity Gateway Fields

Mitrity Gateway is configured via mitrity-gateway.yaml.

Core

FieldTypeRequiredDefaultDescription
gateway_idstringYes--Unique identifier for this gateway instance. Shown in audit logs and the dashboard
api_keystringYes--API key from the MITRITY dashboard (Settings > API Keys)
control_plane.base_urlstringYes--URL of the MITRITY control plane (https://api.mitrity.com)

Upstreams

Define the MCP servers that the gateway aggregates tools from.

FieldTypeRequiredDefaultDescription
upstreams[]listYes--List of upstream MCP server definitions
upstreams[].namestringYes--Human-readable name for this upstream (e.g., filesystem, database)
upstreams[].commandstringYes--Path to the upstream MCP server binary
upstreams[].argslist of stringsNo[]Arguments to pass to the upstream MCP server command
upstreams[].envmapNo{}Environment variables to set for the upstream process
upstreams:
  - name: "filesystem"
    command: "/usr/local/bin/mcp-filesystem"
    args: ["--root", "/data"]
  - name: "database"
    command: "/usr/local/bin/mcp-postgres"
    args: ["--connection-string", "postgres://..."]

Native Tools

Define HTTP API endpoints as tools alongside MCP upstreams.

FieldTypeRequiredDefaultDescription
native_tools[]listNo[]List of native HTTP API tool definitions
native_tools[].namestringYes--Tool name exposed to agents
native_tools[].descriptionstringNo--Human-readable description of the tool
native_tools[].methodstringYes--HTTP method (GET, POST, PUT, DELETE)
native_tools[].urlstringYes--Target URL for the HTTP request
native_tools[].headersmapNo{}Static headers to include with every request
native_tools:
  - name: "get_weather"
    description: "Get current weather for a location"
    method: "GET"
    url: "https://api.weather.example.com/current"
    headers:
      Authorization: "Bearer ${WEATHER_API_KEY}"

Credentials

Credential definitions for upstream authentication. Credentials are held by the gateway and never shared with agents.

FieldTypeRequiredDefaultDescription
credentialsmapNo{}Named credential definitions referenced by upstreams and native tools
credentials:
  weather_api:
    type: "api_key"
    value: "${WEATHER_API_KEY}"
  database:
    type: "connection_string"
    value: "${DATABASE_URL}"

Governed shell (exec)

The exec block enables the gateway's first-party sandboxed shell — the shell__execute tool (action type shell:execute). The design, the policy knobs, the sandbox modes and the egress allowlist are on the Governed Shell page; this is the key reference. The block is validated at boot exactly as upstreams are: an invalid block refuses to start and mitrity-gateway doctor names the field.

FieldTypeRequiredDefaultDescription
exec.enabledbooleanNofalseServe shell__execute (evaluated as shell:execute). When false the tool is absent from tools/list. Refused on Windows and on a host with no shell (the distroless image)
exec.shellstringWhen enabled--Absolute path; the basename must be bash or sh; must exist and be executable. No shell metacharacters
exec.default_cwdstringWhen enabled--Absolute, existing directory. The working directory when a call names none, and the single writable root when the policy's workspace_roots is empty
exec.sandbox.backendstringNoautoauto, bubblewrap (Linux), seatbelt (macOS) or none. none is honoured only when the policy says sandbox_required: false
exec.sandbox.bwrap_pathstringNobwrap on PATHLinux: the bubblewrap binary, version 0.5.0 or newer
exec.sandbox.seccompstringNorequiredLinux: required (no filter means no sandbox), preferred (run as bubblewrap_no_seccomp, notified) or off
exec.sandbox.tmpfs_size_bytesintegerNo268435456Cap on the private tmpfs (bubblewrap 0.7.0 or newer); 16 MiB to 4 GiB
exec.sandbox.settings_filestringNo--A sandbox-runtime settings document, applied as narrowing only. Keys that would widen the sandbox are boot errors
exec.sandbox.deny_readstring[]No[]Extra deny-read paths on top of the mandatory set
exec.sandbox.allow_unix_socketsstring[]No[]macOS only; each path is recorded on the event as a relaxation
exec.limits.max_timeout_secondsintegerNo3600Ceiling over the policy's exec_timeout_seconds; 1 to 3600
exec.limits.stdout_max_bytes / stderr_max_bytesintegerNo1048576Retained bytes per stream; 4 KiB to 16 MiB. The rest is read and discarded, and the total produced is still recorded
exec.limits.stdin_max_bytesintegerNo10485760 (stdin refused) to 16 MiB
exec.limits.max_pidsintegerNo256Process cap: cgroup pids.max when delegated, else RLIMIT_NPROC
exec.limits.max_file_bytesintegerNo268435456RLIMIT_FSIZE, per file; at least 1 MiB
exec.limits.memory_max_bytesintegerNo00 = unbounded; a positive value needs a delegated cgroup v2
exec.limits.max_concurrentintegerNo4Concurrent executions per gateway; an excess call fails to start with concurrency_limit
exec.egress.allowed_portsinteger[]No[443, 80]Ports an allowlist entry without a :port suffix may reach
exec.egress.denied_addressesstring[]No[]Extra CIDRs an allowed name must not resolve to
exec.env.inheritstring[]No[PATH, HOME, LANG, "LC_*", TZ, TERM]Names copied from the gateway's environment
exec.env.setmapNoPATH (system default), TERM=dumbFixed values; PATH here is the sandbox PATH
exec.env.agent_settablestring[]No[]Keys the tool's env argument may set. Never PATH, HOME, TMPDIR or any name on the refused list (LD_*, DYLD_*, BASH_ENV, *_PROXY, MITRITY_*, …)
exec.credentials.envmapNo--NAME: "${credential:<id>}" — injected into every execution by an agent holding the grant
exec.credentials.files[]listNo--{id, path, format, mode} — materialised under $MITRITY_CRED_DIR for every execution; path relative with no .., format one of raw, json, dotenv, kv, mode at most 0600

Logging

FieldTypeRequiredDefaultDescription
logging.levelstringNoinfoLog verbosity: debug, info, warn, error
logging.formatstringNojsonLog output format: json or text

Cache

FieldTypeRequiredDefaultDescription
cache.profile_ttldurationNo5mHow long to cache mission profiles locally before re-fetching from the control plane
cache.max_entriesintegerNo1000Maximum number of cached mission profiles

Full Mitrity Gateway config example

gateway_id: "gateway-001"
api_key: "sk-..."
control_plane:
  base_url: "https://api.mitrity.com"

upstreams:
  - name: "filesystem"
    command: "/usr/local/bin/mcp-filesystem"
    args: ["--root", "/data"]
  - name: "database"
    command: "/usr/local/bin/mcp-postgres"
    args: ["--connection-string", "${DATABASE_URL}"]

native_tools:
  - name: "get_weather"
    description: "Get current weather for a location"
    method: "GET"
    url: "https://api.weather.example.com/current"
    headers:
      Authorization: "Bearer ${WEATHER_API_KEY}"

credentials:
  weather_api:
    type: "api_key"
    value: "${WEATHER_API_KEY}"

logging:
  level: "info"
  format: "json"

cache:
  profile_ttl: "5m"
  max_entries: 1000

Mitrity MCP Sidecar Fields

Mitrity MCP Sidecar is configured via mitrity-mcp-sidecar.yaml.

FieldTypeRequiredDefaultDescription
api_keystringYes--API key from the MITRITY dashboard (Settings > API Keys)
control_plane.base_urlstringYes--URL of the MITRITY control plane (https://api.mitrity.com)
upstream_commandstringYes--Path to the upstream MCP server binary that the sidecar will wrap
upstream_argslist of stringsNo[]Arguments to pass to the upstream MCP server command
agent_idstringYes--Identifier for the agent using this sidecar. Appears in audit logs and enables per-agent governance
logging.levelstringNoinfoLog verbosity: debug, info, warn, error
logging.formatstringNojsonLog output format: json or text
cache.profile_ttldurationNo5mHow long to cache mission profiles locally before re-fetching from the control plane
cache.max_entriesintegerNo1000Maximum number of cached mission profiles

The sidecar launches the upstream MCP server as a child process, communicating via stdio. It intercepts tools/call JSON-RPC 2.0 requests from the MCP client, evaluates them against governance policies, and either forwards allowed calls to the upstream server or returns a JSON-RPC error for denied calls.

Full Mitrity MCP Sidecar config example

api_key: "sk-..."
control_plane:
  base_url: "https://api.mitrity.com"

upstream_command: "/usr/local/bin/some-mcp-server"
upstream_args: ["--mode", "stdio"]
agent_id: "my-agent"

logging:
  level: "info"
  format: "json"

cache:
  profile_ttl: "5m"
  max_entries: 1000

Environment Variable Overrides

Core configuration fields can be overridden via environment variables. Environment variables take precedence over values in the YAML config file.

Mitrity Gateway

Environment VariableConfig FieldDescription
MITRITY_GATEWAY_IDgateway_idGateway instance identifier
MITRITY_GATEWAY_API_KEYapi_keyAPI key for control plane authentication
MITRITY_GATEWAY_CONTROL_PLANE_URLcontrol_plane.base_urlControl plane URL
MITRITY_GATEWAY_LOG_LEVELlogging.levelLog verbosity
MITRITY_GATEWAY_LOG_FORMATlogging.formatLog output format

Mitrity MCP Sidecar

Environment VariableConfig FieldDescription
MITRITY_MCP_AGENT_IDagent_idAgent identifier for this sidecar
MITRITY_MCP_API_KEYapi_keyAPI key for control plane authentication
MITRITY_MCP_CONTROL_PLANE_URLcontrol_plane.base_urlControl plane URL
MITRITY_MCP_LOG_LEVELlogging.levelLog verbosity
MITRITY_MCP_LOG_FORMATlogging.formatLog output format

Environment variable overrides are useful for injecting secrets in containerized deployments without writing them to the config file. Both binaries are stdio MCP servers launched by the agent's MCP client, so the variables belong on the process that spawns them — the agent's container:

docker run -it \
  -e MITRITY_GATEWAY_API_KEY=sk-your-key \
  -v /path/to/mitrity-gateway.yaml:/etc/mitrity/config.yaml \
  your-agent-image

The agent then launches mitrity-mcp-gateway --config /etc/mitrity/config.yaml from inside that container and inherits the environment. See the deployment guide for why a detached gateway container is not a supported topology.