OptionalCancellationAborts in-flight work; honoured mid-turn only when CapabilitySettings.MidTurnCancellation.
Environment variables injected into the harness process — the LLM key and any granted
integration tokens resolved from MJ: AI Agent Credentials.
This is the ONLY channel by which a secret reaches the sandbox, and it carries exactly what the agent was granted. Never DB credentials, never a user token, never a general MJ API key.
Runs harness processes inside the sandbox.
Adapters MUST go through this rather than calling spawn themselves. An adapter that spawns
directly always runs on the MJAPI host, which in production means an autonomous agent
executing shell commands inside the API container with its network reach and cloud
credentials — and, worse, it does so while the agent's config claims provider: 'docker'.
Routing through the executor is what makes the sandbox choice real rather than decorative.
OptionalMcpPer-run, read-only, scope-limited MCP credential. Revoked at teardown on every exit path.
OptionalMcpMCP endpoint for the read-only intra-turn loopback; omitted when the harness has no MCP client.
OptionalModelModel to request, when the harness honours one (CapabilitySettings.ModelSelection).
OptionalPermissionWhat the agent may do inside the sandbox. Adapters translate this into their own flags via BaseHarnessAdapter.ApplyPermissionPolicy, or ignore it if they cannot enforce it.
OptionalResumeA prior session this run MAY continue, when one exists for the same agent and conversation.
Offered, not imposed. Only adapters whose harness can genuinely resume should act on it, and they must report the outcome through BaseHarnessAdapter.DidResumeSession — because the caller sends a DIFFERENT turn input depending on whether the resume took. Guessing wrong in either direction is costly: assume resumed when it was not and the harness has no context; assume fresh when it did resume and it receives the conversation twice.
Workspace path AS THE HARNESS SEES IT — a host path under the local provider, a
container-internal path under Docker. Pass it to harness processes; do not open it with fs.
Everything an adapter needs to launch a harness session.
Assembled once per run by HarnessAgentBase and handed to BaseHarnessAdapter.StartSession. Nothing here is re-derived per turn — a session's identity, workspace and credentials are fixed for its lifetime.