Skip to content
Draft
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0fea8ef
feat: add VM personal-agent runtime adapter
lee3Q Nov 29, 2026
55ca946
chore: update runtime adapter task status
lee3Q Nov 29, 2026
060966d
chore: finalize runtime adapter task status
lee3Q Nov 29, 2026
0b8542e
test(integrations): add adversarial concurrency and fault-injection t…
lee3Q Nov 29, 2026
7252c48
fix(integrations): harden VM runtime audit boundaries
lee3Q Nov 29, 2026
c468091
test(task1-grok-vm-runtime): complete verification & hardening round …
lee3Q Nov 29, 2026
b1901be
fix(integrations): release idle runtime lock entries
lee3Q Nov 29, 2026
a3cd70f
chore: update round-2 task status
lee3Q Nov 29, 2026
830774c
test(task1-grok-vm-runtime): complete verification & hardening round …
lee3Q Nov 29, 2026
9754412
test(task1-grok-vm-runtime): complete architecture audit round 4
lee3Q Nov 29, 2026
dc6fb1e
docs(task1-grok-vm-runtime): close round 4 state
lee3Q Nov 29, 2026
d69e742
fix(integrations): persist host lifecycle receipts
lee3Q Nov 29, 2026
eee8650
test(task1-grok-vm-runtime): complete verification & hardening round …
lee3Q Nov 30, 2026
b648436
test(task1-grok-vm-runtime): complete verification & hardening round …
lee3Q Nov 30, 2026
8d2de81
test(task1-grok-vm-runtime): complete verification & hardening round …
lee3Q Nov 30, 2026
8ff212e
test(task1-grok-vm-runtime): complete verification & hardening round …
lee3Q Nov 30, 2026
90d6a32
test(task1-grok-vm-runtime): complete verification & hardening round …
lee3Q Nov 30, 2026
5c05726
test(task1-grok-vm-runtime): complete verification & hardening round …
lee3Q Nov 30, 2026
49ec7a6
test(task1-grok-vm-runtime): complete verification & hardening round …
lee3Q Nov 30, 2026
5e8bc27
test(task1-grok-vm-runtime): complete verification & hardening round …
lee3Q Nov 30, 2026
41d4b13
test(task1-grok-vm-runtime): complete verification & hardening round …
lee3Q Nov 30, 2026
0b3fef8
test(task1-grok-vm-runtime): complete verification & hardening round …
lee3Q Nov 30, 2026
64b26c3
test(task1-grok-vm-runtime): complete round 28 architecture audit
lee3Q Nov 30, 2026
6905352
Merge remote-tracking branch 'origin/main' into feat/personal-agent-v…
lee3Q Nov 30, 2026
a98194c
Merge remote-tracking branch 'origin/main' into feat/personal-agent-v…
lee3Q Nov 30, 2026
d09d0b5
Merge remote-tracking branch 'origin/main' into feat/personal-agent-v…
lee3Q Nov 30, 2026
95f2456
test(vm): add live loopback e2e proof, remove root STATE.md, and sync…
lee3Q Nov 30, 2026
02aa4dc
style(vm): apply ruff format for CI lint gate
lee3Q Nov 30, 2026
e7b69e4
fix(host): preserve dispatch acknowledgements across stale snapshots
lee3Q Nov 30, 2026
3459809
fix(vm): harden workspace and receipt boundaries
lee3Q Nov 30, 2026
067db61
fix(vm): close round eight runtime audit gaps
lee3Q Nov 30, 2026
4fbd057
fix(vm): verify case-folded workspace roots by identity
lee3Q Nov 30, 2026
10d1ca9
fix(vm): close round eleven runtime audit gaps
lee3Q Nov 30, 2026
48ba709
fix(vm): close runtime audit resource gaps
lee3Q Nov 30, 2026
207a82a
fix(vm): close round thirteen evidence boundaries
lee3Q Nov 30, 2026
e6e7086
fix(host): bound receipt file reads
lee3Q Nov 30, 2026
193188a
fix(vm): harden crash recovery and receipt replay
lee3Q Nov 30, 2026
1ee1577
fix(vm): serialize receipt recovery writes
lee3Q Nov 30, 2026
35354a8
test(hv1-ouroboros-vm-3130-security-and-integration): complete verifi…
lee3Q Dec 1, 2026
9a18ef3
fix(vm): harden workspace and receipt boundaries
lee3Q Dec 1, 2026
c3ce281
test(vm): add round nineteen trust boundary regressions
lee3Q Dec 1, 2026
c35aab4
fix(vm): bound raw receipt evidence on reload
lee3Q Dec 1, 2026
7ce877c
fix(vm): harden retry and start receipt recovery
lee3Q Dec 1, 2026
f245f38
chore(fix_pr3130_start_reservation_abort): checkpoint verified stage
Dec 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ agent host. The full command list is in
[GJC](./docs/runtime-guides/gjc.md) ·
[Antigravity CLI](./docs/runtime-guides/antigravity.md) ·
[Grok Build CLI](./docs/runtime-guides/grok.md) ·
[Grok Bot host](./docs/runtime-guides/grok-bot.md) ·
[DeepSeek Harness](./docs/guides/deepseek-harness.md)

The installer connects the ones you have; the console's **Connect** page
Expand Down
3 changes: 2 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ For backend-specific configuration:
- [Pi CLI runtime guide](runtime-guides/pi.md)
- [OMP CLI runtime guide](runtime-guides/omp.md)
- [Pi JSON mode documentation](https://pi.dev/docs/latest/json)
- [Personal-agent host adapter](runtime-guides/personal-agent-host.md) · [Grok Bot host](runtime-guides/grok-bot.md)

### Every supported host

Expand All @@ -653,7 +654,7 @@ DeepSeek works in both directions: as the LLM backend for the interview, Seed
and QA pipeline, and as a host through the installable `dsh-ouroboros` plugin.
See the [DeepSeek Harness guide](guides/deepseek-harness.md).

The other runtime guides: [Hermes](runtime-guides/hermes.md) · [Gemini CLI](runtime-guides/gemini.md) · [Zcode](runtime-guides/zcode.md) · [Goose](runtime-guides/goose.md) · [GJC](runtime-guides/gjc.md) · [Antigravity CLI](runtime-guides/antigravity.md) · [Grok Build CLI](runtime-guides/grok.md) · [GitHub Copilot ACP](runtime-guides/copilot-acp.md) · [Megacode harness](runtime-guides/megacode.md) · [Host-driven execution](runtime-guides/host.md)
The other runtime guides: [Hermes](runtime-guides/hermes.md) · [Gemini CLI](runtime-guides/gemini.md) · [Zcode](runtime-guides/zcode.md) · [Goose](runtime-guides/goose.md) · [GJC](runtime-guides/gjc.md) · [Antigravity CLI](runtime-guides/antigravity.md) · [Grok Build CLI](runtime-guides/grok.md) · [Grok Bot host](runtime-guides/grok-bot.md) · [Personal-agent host adapter](runtime-guides/personal-agent-host.md) · [GitHub Copilot ACP](runtime-guides/copilot-acp.md) · [Megacode harness](runtime-guides/megacode.md) · [Host-driven execution](runtime-guides/host.md)

---

Expand Down
78 changes: 78 additions & 0 deletions docs/runtime-guides/grok-bot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Grok Bot host (public MCP contract)

This is separate from the [Grok Build CLI runtime](grok.md). The CLI runtime
starts a local `grok -p` subprocess and is selected with `--runtime grok`.
Grok Bot is a personal-agent host: it may call a public MCP connector and may
run work on its own cloud computer. For the latter, Ouroboros uses
`--runtime host` and the reusable
[personal-agent host adapter](personal-agent-host.md).

## Confirmed public surface

As checked on 2026-11-28, the official documentation says:

- Bots use a persistent cloud computer with a browser, command line, and
filesystem; files, sign-ins, and command-line credentials are shared by Bots
on the account. See [Use the computer and apps](https://docs.x.ai/grok-bot/computer-and-apps).
- A custom MCP server can be added by URL or by a command that runs on the Bot
computer. The desktop connector UI supports Remote HTTPS and Command types.
See the same [computer and apps guide](https://docs.x.ai/grok-bot/computer-and-apps).
- A custom MCP connector can be entered at `grok.com/connectors`; the official
connector guide says the server URL must be reachable over the public
internet and may require tunneling and authentication. See
[Connectors](https://docs.x.ai/grok/connectors).
- Business/Enterprise teams may require an administrator to provision the
connector. See [Connector Management](https://docs.x.ai/grok/connector-management).
- Desktop command execution is user-controlled and normally asks for approval;
Grok Bot's own work runs on its cloud computer. See [the FAQ](https://docs.x.ai/grok-bot/faq).

These facts are enough to define a public-MCP integration boundary. They do
not define a stable external API that lets this repository submit a message to
a particular user's Bot or receive a Bot callback. No such private API is
implemented or implied here.

## Candidate deployment shapes

### Remote HTTPS custom connector

Run `ouroboros mcp serve --runtime host --transport streamable-http` behind an
authenticated HTTPS endpoint and register that endpoint as a custom MCP
connector. The endpoint and its workspace must be designed so the worker path
returned by Ouroboros is accessible to the host. A local-only URL is not
enough for the cloud Bot; follow the official tunneling and authentication
requirements.

### Command custom connector

The official UI documents a command connector that runs on the Bot computer.
That could co-locate the MCP server and its workspace, but the exact command
environment, Python/`uv` availability, long-running process behavior, auth
headers, and lifecycle semantics were not available for an unauthenticated
end-to-end test. Treat this as an operator experiment, not a repository
guarantee. The adapter does not install or wrap a `grok` executable.

## Explicit user flow

Configure the host-side skill or instruction to call the adapter only for a
message beginning with `/ouroboros` (or the documented `ooo auto` alias). The
adapter then calls `ouroboros_start_auto`; it does not inspect or intercept
ordinary Bot messages. The host must pump `ouroboros_job_wait`, execute each
announced worker using its native capability, submit the result, and return the
receipt's Seed/execution/evaluation/verification evidence to the user.

The fake-host integration test proves this complete contract without claiming
that it is a live Grok Bot connection:

```bash
uv run pytest -q tests/unit/integrations/test_personal_agent_host.py \
tests/integration/host/test_personal_agent_host.py
```

## Not verified

No authenticated Grok Bot account, connector, or public callback endpoint was
available in the development session. The computer/browser inventory exposed
only the Codex MCP Apps and in-app browser surfaces, so no live Bot message or
connector mutation was attempted. The repository therefore reports this
adapter as a tested public-contract/fake-host path, not as a completed
platform E2E connection.
4 changes: 4 additions & 0 deletions docs/runtime-guides/grok.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Grok Build CLI Runtime

This guide is for the local Grok Build CLI subprocess runtime. It is **not**
the Grok Bot personal-agent host. For the latter, see the [Grok Bot host
guide](grok-bot.md) and the reusable [personal-agent host contract](personal-agent-host.md).

Run Ouroboros workflows on top of the locally installed xAI **Grok Build** CLI
(the `grok` binary).

Expand Down
5 changes: 5 additions & 0 deletions docs/runtime-guides/host.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Host-driven execution runtime

For a personal-agent host (including the currently unverified Grok Bot public
MCP surface), see the reusable [personal-agent host adapter](personal-agent-host.md)
and its [Grok Bot evidence](grok-bot.md). This guide remains the lower-level
generic `host` runtime contract.

The `host` agent runtime delegates execution to the calling MCP host instead
of spawning an external CLI. It is intended for hosts such as DeepSeek Harness
that can spawn their own subagents but do not expose an installable execution
Expand Down
169 changes: 169 additions & 0 deletions docs/runtime-guides/personal-agent-host.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# Personal-agent host adapter

This guide describes the optional host contract for a personal agent such as
Grok Bot. It is a host-facing access layer over Ouroboros's existing MCP
tools; it is not another agent runtime and it does not replace the local Grok
Build CLI runtime.

The implementation is in
[`ouroboros.integrations.personal_agent_host`](../../src/ouroboros/integrations/personal_agent_host.py).
It is deliberately platform-neutral so another personal agent or a cloud host
can implement the same contract without importing a private platform SDK.

## Boundary and explicit invocation

The adapter claims only messages that begin with an exact explicit prefix:

```text
/ouroboros <complex goal>
ooo auto <complex goal>
```

To resume a persisted Auto session:

```text
/ouroboros resume <auto_session_id>
ooo auto --resume <auto_session_id>
```

Every other message returns `None` from `start()` and causes no MCP call.
Consequently ordinary conversation, memory, search, mail, calendar, booking,
and scheduled work do not enter Ouroboros automatically. The host must also
keep the adapter behind its own explicit user-command or skill boundary.

## What is reused

An explicit request follows the existing job-tracked path:

```text
personal-agent message
-> ouroboros_start_auto
-> interview / intent refinement / Seed generation
-> existing execution and server-side evaluation/verification
-> ouroboros_job_wait
-> pending_host_dispatches (when runtime=host)
-> host runs the supplied worker prompt in the supplied workspace
-> ouroboros_submit_fanout_results
-> ouroboros_job_wait / ouroboros_job_result
```

The minimum negotiated tool set is:

| Tool | Responsibility |
| --- | --- |
| `ouroboros_start_auto` | Create or resume the durable Auto session and job |
| `ouroboros_job_wait` | Poll state and receive one-shot host dispatch announcements |
| `ouroboros_submit_fanout_results` | Return the worker result through the existing correlation and validation guards |
| `ouroboros_job_result` | Fetch the terminal result and verification evidence |

`PersonalAgentHostAdapter.negotiate()` checks this set before a host claims
support. `MCPToolTransport` accepts either an Ouroboros MCP adapter, an MCP SDK
client wrapper, or an async callable, so the optional integration does not add
an MCP SDK dependency to the base package.

## Host-side lifecycle

The smallest host implementation is equivalent to:

```python
from ouroboros.integrations import (
GrokBotHostAdapter,
JsonHostReceiptStore,
MCPToolTransport,
)

adapter = GrokBotHostAdapter(
MCPToolTransport(mcp_client),
receipt_store=JsonHostReceiptStore(".ouroboros/host-receipts"),
)
receipt = await adapter.start(
message,
host_session_id=host_conversation_id,
cwd=host_workspace,
)
if receipt is not None:
while not receipt.is_terminal:
receipt = await adapter.wait(receipt)
for dispatch in receipt.pending_host_dispatches:
# The host's native worker/subagent executes this exact prompt in
# dispatch.working_directory, then returns its final output.
worker_output = await run_native_worker(
dispatch.prompt,
cwd=dispatch.working_directory,
)
receipt = await adapter.submit_dispatch(receipt, dispatch, worker_output)
receipt = await adapter.result(receipt)
show_to_user(receipt.to_dict())
```

The example is an adapter contract, not a new local CLI or a claim about a
Grok Bot extension API. A host that cannot spawn a worker must submit
`undispatched=True`; it must not invent output. A stale, malformed, or
correlation-mismatched dispatch is rejected and must not be replayed.

The receipt records the host name, request ID, host session ID, Auto session ID,
job ID, cursor, current state, pending dispatch identity, Seed, execution,
evaluation, verification, failure, recovery, and a resume call. Unknown server
fields remain in `state` for forward compatibility. `JsonHostReceiptStore`
atomically stores the receipt after every lifecycle response, so a restarted
adapter reloads the latest cursor and pending dispatches instead of starting a
second Auto session for the same explicit request. Use a stable
`host_session_id` for each conversation; without one, identical requests share
the deterministic fallback key.

## Runtime and execution location

For this adapter the MCP server must select the existing host-driven runtime:

```bash
export OUROBOROS_MCP_AUTH_TOKEN='set-this-outside-the-repository'
ouroboros mcp serve --runtime host \
--transport streamable-http \
--host 0.0.0.0 \
--port 8080 \
--allowed-host ouroboros.example.com \
--allow-remote \
--workspace-root /path/to/allowed/workspace
```

Use a secret manager or environment injection for the token; never put a real
token in a seed, source file, shell transcript, or Git commit. Restrict
`--workspace-root` to the smallest allowed project tree. The network MCP
server's authenticated process owns the live host-dispatch waiter. The worker
must be able to access the exact `working_directory` returned in
`pending_host_dispatches`; an HTTP connection alone does not synchronize two
unrelated filesystems.

The existing host runtime intentionally rejects direct terminal
`ouroboros run`, direct `ouroboros_execute_seed`, and Evolve/Ralph jobs that do
not carry a session scope. Use the job-tracked MCP path above. A host that needs
Ralph/evolution must select an executable runtime for that stage until the
existing session-scope limitation is removed.

## Recovery and failure handling

- Configure `JsonHostReceiptStore` and let the adapter persist
`auto_session_id`, `job_id`, the latest monotonic `cursor`, and pending
dispatches after every response.
- Resume with `ouroboros_start_auto` and `{"resume": "<auto_session_id>"}`;
do not start a new goal when recovering an existing session.
- Poll `ouroboros_job_wait` after a transport or host restart. Persisted Auto
and fan-out records survive, but the in-process live waiter belongs to the
serving MCP process.
- A lost or expired dispatch results in a fresh dispatch ID on retry. Never
replay a prior `dispatch_id` after it is reported stale.
- Preserve terminal `failure` and `recovery` fields and show verification
evidence from the receipt. A worker failure is not a successful empty result.

## Grok Bot deployment status

The official Grok Bot documentation currently describes a persistent cloud
computer with command line/filesystem access and a custom MCP connector that
discovers tools from a reachable server. It also documents a command-based
custom connector. Those public surfaces make the MCP contract a plausible
integration boundary, but this repository does not assume an undocumented Bot
callback, private message API, or hidden filesystem mount.

See [the Grok Bot-specific evidence and setup notes](grok-bot.md) and the
[public-surface verification record](../verification/grok-bot-public-surface.md)
for the exact confirmed and unconfirmed conditions.
62 changes: 62 additions & 0 deletions docs/runtime-guides/vm-personal-agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# VM personal-agent runtime

`VMPersonalAgentRuntime` is the reusable worker bridge for a personal agent
that owns a Linux VM, container, or command sandbox. It is independent of the
agent's model provider and supports two public transport shapes:

- `CommandVMTransport` for an async shell or command runner;
- `MCPVMTransport` for a public MCP command/turn tool.

The runtime maps an approved host workspace to the VM workspace, persists a
structured receipt for each `session_id` and `dispatch_id`, and records output,
exit status, execution IDs, and artifact hashes. `JsonVMReceiptStore` can be
placed under the project’s `.ouroboros` state directory so a host restart can
find the previous receipt. Input boundaries reject a single string passed as an
artifact iterable and reject boolean timeout values, which otherwise look
numeric in Python but do not represent a deliberate runtime setting.

Host dispatches may identify their working directory in either approved host
path notation or approved VM path notation. Both forms are canonicalized and
remain subject to the same workspace and symlink-escape checks.

```python
from ouroboros.integrations import (
CommandVMTransport,
JsonVMReceiptStore,
VMPersonalAgentRuntime,
VMWorkspaceMapper,
)

runtime = VMPersonalAgentRuntime(
CommandVMTransport(vm_command_client),
workspace=VMWorkspaceMapper("/srv/project", "/cloud/workspace"),
receipt_store=JsonVMReceiptStore("/srv/project/.ouroboros/vm-receipts"),
)
receipt = await runtime.execute_command(
"pytest -q",
dispatch_id=dispatch.dispatch_id,
session_id=dispatch.session_id,
host_workspace=dispatch.working_directory,
)
```

## Safety and recovery rules

Only paths below the configured host root or VM root are accepted. Artifact
collection rejects path traversal and records metadata rather than copying
unknown files into the host process.

The first request writes a `running` receipt before the transport is called.
If the transport returns an execution ID and the connection drops, a later
`resume_dispatch()` calls the transport’s resume operation. A completed
receipt is returned directly, and a receipt without a resumable execution ID
becomes `recovery_required`; the original command is never silently replayed.
Timeouts and transport disconnects remain visible in the receipt for the host
to report or recover.

## Grok Bot profile

`GROK_BOT_VM_PROFILE` describes the documented Grok Bot cloud-computer shell
and custom MCP connector surfaces. It is a profile, not a private xAI API
client, and `live_account_verified` remains `False` until a real account and
connector are tested by an operator. See the [Grok Bot guide](grok-bot.md).
Loading
Loading