Member Junction
    Preparing search index...

    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.

    interface HarnessSessionConfig {
        CancellationToken?: AbortSignal;
        Environment: Record<string, string>;
        Executor: SandboxExecutor;
        McpCredential?: string;
        McpServerUrl?: string;
        Model?: string;
        PermissionPolicy?: HarnessPermissionPolicy;
        ResumeSessionId?: string;
        WorkspacePath: string;
    }
    Index

    Properties

    CancellationToken?: AbortSignal

    Aborts in-flight work; honoured mid-turn only when CapabilitySettings.MidTurnCancellation.

    Environment: Record<string, string>

    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.

    Executor: SandboxExecutor

    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.

    McpCredential?: string

    Per-run, read-only, scope-limited MCP credential. Revoked at teardown on every exit path.

    McpServerUrl?: string

    MCP endpoint for the read-only intra-turn loopback; omitted when the harness has no MCP client.

    Model?: string

    Model to request, when the harness honours one (CapabilitySettings.ModelSelection).

    PermissionPolicy?: HarnessPermissionPolicy

    What 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.

    ResumeSessionId?: string

    A 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.

    WorkspacePath: string

    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.