Developers

Host-managed Agent

This page is for an application that embeds the Agent and approves tools itself. Standalone memmy serve does not use these settings. See OpenAI-Compatible API.

The former MEMMATE_* settings, the corresponding request header, and the memmate_permission request field are no longer recognized. Upgrade the host together with the Agent, and check the protocol below before rollout.

Environment variables

VariableWhat it does
AGENT_MANAGED_EXECUTION_REQUIREDSet to 1 to run in host-managed mode. Without it, the Agent runs standalone.
AGENT_RUNTIME_TOKENAt least 32 characters. The x-agent-runtime-token request header must match it exactly, or the response is 401.
AGENT_MACOS_SANDBOXWhen set to 1, the health field macosSandbox is true.

Requests

In managed mode, POST /v1/chat/completions must be JSON. Multipart is rejected. The body includes managed_execution:

FieldRequirement
protocolMust be 2.
toolsA non-empty array. Each item needs string name and description, plus an object inputSchema.
urlOnly http://127.0.0.1:<port>/authorize. No username, password, query, or fragment.
token64 lowercase hex characters. The Agent sends it as Authorization: Bearer when it calls this URL.

A read grant does not cover descendant paths. read_file, list_dir, find_files, grep, and authorize_read_path include fileAccessProtocol: 1. Each path that will actually be read must pass authorize_read_path before the read.

When the host returns decision: "allow", result must be a string. A denial or execution failure is handled from decision, reason, or error.kind / error.code.

Health check

When AGENT_MANAGED_EXECUTION_REQUIRED=1, GET /health adds these fields beside status: "ok":

FieldValue
permissionProtocol1
managedExecutionProtocol2
managedExecutionRequiredtrue
macosSandboxtrue when AGENT_MACOS_SANDBOX is 1, otherwise false

Without host-managed mode, the health check returns only status.

On this page