Skip to content

Reference

Connect your agent

Lodestar OSS wraps your agent in your environment and records what it does. Pick the path that matches how your agent runs, then ship the session. Machinaut never runs the agent.

Before you start

install Lodestarbash
bun add -g @qmilab/lodestar-cli     # the lodestar CLI, from npm

Integration paths

PathWhenWhat it is
MCP proxyAn off-the-shelf coding agent that speaks MCPPoint the agent at Lodestar's governed proxy and turn off its native tools, so every action goes through Lodestar.
guard.wrap()Your own agent loop in TypeScriptWrap the loop so every ctx.callTool goes through Lodestar's kernel.
Runtime gatePython frameworks: LangGraph, CrewAI, AutoGenA native hook launches Lodestar's gate, and every tool call goes through it.
Sample projectNo agent yetLoad a labelled sample into your own org, so the console has a chain to show.

MCP proxy: the Claude Code recipe

1 · proxy.config.jsonjson
{
  "project_id": "my-agent",
  "actor_id": "agent:claude-code",
  "session_id": "auto",
  "log_root": ".lodestar/events",
  "default_scope": { "level": "project", "identifier": "my-agent" },
  "default_sensitivity": "internal",
  "auto_approve_ceiling": 3,
  "downstream_servers": [
    {
      "name": "fs",
      "command": "bunx",
      "args": ["@modelcontextprotocol/server-filesystem", "/abs/path/to/workspace"]
    }
  ]
}
Lists your downstream MCP servers. Change the workspace path and add the servers your agent uses. auto_approve_ceiling is the trust level up to which actions run without a hold. Lodestar's default trust level for a tool is 3, so at this ceiling every tool auto-approves. A hold reaches the inbox only for an action above the ceiling: lower the ceiling, or raise a tool's required_trust_level under tool_defaults. To send holds to the console, add the fields in Send holds to your team's inbox.
2 · .mcp.jsonjson
{
  "mcpServers": {
    "lodestar": {
      "command": "lodestar",
      "args": ["guard", "mcp-proxy", "--config", "proxy.config.json"]
    }
  }
}
The proxy serves its tools under the name lodestar, so Claude Code sees them as mcp__lodestar__*.
3 · settings.jsonjson
{
  "permissions": {
    "deny": [
      "Edit", "Write", "MultiEdit", "NotebookEdit", "Bash",
      "Read", "Glob", "Grep", "LS", "WebFetch", "WebSearch"
    ],
    "allow": ["mcp__lodestar__*"]
  }
}
Deny every native tool that touches the workspace, the shell or the web, and allow only the proxy's tools. The governed path is then the agent's only path.
4 · launchbash
claude \
  --mcp-config .mcp.json --strict-mcp-config \
  --settings settings.json
--strict-mcp-config ignores any other MCP servers you have configured, so none of them becomes an ungoverned bypass. The proxy prints its session id to stderr at startup.

Governance holds only if native tools are off

Lodestar's proxy sees only the calls that go through it. If the agent keeps its own edit, read, shell or web tools, it can act without the proxy, and the chain misses those steps. Reads bypass the proxy too, so denying only writes still leaves gaps.

Checked against Lodestar v0.6.x, with Claude Code as the client.

Which agents fit the proxy

AgentGovernanceHow
Claude CodeEnforceable, verifiedDeny native tools and allow only mcp__lodestar__* (see above).
Gemini CLIEnforceableRestrict built-ins with the tools.core allowlist.
GooseEnforceableTurn off the built-in developer extension.
Qwen CodeEnforceableSame coreTools allowlist as Gemini CLI.
ZedEnforceableA custom Agent Profile without native edit and terminal tools.
ContinueEnforceableAgent mode with native edit and terminal excluded.
AmpEnforceableamp.tools.disable: ["builtin:*"].
Codex CLIGated, not removedapply_patch can't be removed. Run the sandbox read-only.
Google AntigravityGated, not removedNo MCP-only mode. Native edits can bypass the proxy.
Amazon Q CLIGated, not removedTurning off native tools is unconfirmed.
Cursor, Windsurf, Cline, Roo Code, Kilo CodeBypassableNative tools can't be turned off.
OpenHandsDifferent pathPython framework. Use the runtime gate.
AiderNo pathNot an MCP client.
OpenClaw, Hermes AgentNo pathAssistant gateways whose native tools cannot be restricted.

Compiled by Machinaut from Lodestar's adapters and each agent's settings, last checked 2026-06-29. Only Claude Code has been run end to end into the console. For Lodestar itself, see Lodestar's docs.

guard.wrap(): your own TypeScript loop

instrument your loopts
import { wrap, autoApprovePolicy, alwaysHoldsChecker } from "@qmilab/lodestar-guard"

const run = await wrap(myAgentLoop)({
  project_id: "my-agent",
  actor_id: "agent:dev",
  default_scope: { level: "project", identifier: "my-agent" },
  default_sensitivity: "internal",
  policy_gate: autoApprovePolicy({ auto_approve_up_to: 2, approver_id: "policy" }),
  precondition_checker: alwaysHoldsChecker,
})

console.log(run.session_id) // ship this id
Every ctx.callTool goes through Lodestar's kernel and lands in the same event log the other paths write. Ship the returned session_id.

Runtime gate: Python frameworks

start the gatebash
lodestar runtime gate --config gate.config.json
Lodestar's Python hooks (for example lodestar-langgraph) launch the gate and talk to it over stdin and stdout. The gate prints its session id to stderr at startup.

Sample project: no agent yet

WhereWhat it does
Console: Explore a sample projectSeeds a labelled sample into your org: a chain, a hold and an audit trail. It calls POST /v1/demo/seed (see the API reference). The sample is a Lodestar chain. Machinaut hosts it.