Skip to content

Epic: VM demo slice — P6 + P4 on one VM, multi-user mocactl login, sandbox research turns #370

Closed

Description

@pdettori

Epic: VM demo slice — P6 + P4 on one VM, multi-user mocactl, sandbox research turns

The scenario

One KVM-capable Linux VM runs the whole stack. On it, a minimal but honest end-to-end demo shows:

  1. P6 and P4 on one VM: the P6 process manager (sh-supervisor, sh-relay, Redis, container sandboxes on moca-sandbox) and the P4 Firecracker microvm-worker attached to the same relay.
  2. mocactl: users log in (GitHub device flow), create and resume sessions, and stream turns.
  3. Research from the sandbox: the agent runs curl and git in its sandbox to research live internet content, and answers from it.
  4. Multi-user: two users on their own laptops, each seeing only their own sessions, each spending their own inference credential.

Where things stand (main @ 03d2ee8, 2026-10-01)

The whole demo ran end to end on the shared KVM rig on 2026-10-01, and every act held. The run is recorded in docs/demos/vm-multi-user-demo.md (#412); results are in this comment. One person played both users, with two GitHub accounts on one laptop. Two people on two laptops has not been tried.

Part State
P6 on a VM Works. deploy/vm/setup-vm.sh installs the supervisor, relay, Redis, container sandboxes and the control plane.
Control plane Installed by deploy/vm (#366): a systemd unit, secrets generated once, SH_REQUIRE_AUTH=true. The GitHub OAuth app settings come in through setup-vm.sh's environment (#403).
Login The real device flow is verified with two GitHub accounts (2026-10-01). Misconfiguration now names the operator's fix (#405, #413). There is still no dev identity provider (#362 item 2).
Sessions and ownership Verified live: disjoint session lists, and another user's session refused like a nonexistent one. #371 is the automated two-subject test.
Per-user inference credential Works for a gateway token and for a raw Anthropic key (#372, x-api-key). The operator-key fallback works and refuses a config that can't (#411). Each turn's credential is audited by name.
curl/git in container sandboxes Verified live. The image guarantees curl, git and a writable HOME (#372). research-smoke.sh passed 13/13 (#411), and two users' research turns matched the world. Egress is open this round.
P4 microVM Serves real, authenticated mocactl turns (#376, #409): installer, rootfs recipe, relay wiring, one VM per Exec, per-session workspaces. One tier per host. The demo switches to it live, once.
curl/git in P4 Impossible: the guest has no network device (#277). Verified live: Could not resolve host.

Children (dependency order)

Open issues the demo depends on or found

Each child is written so a planner can start it in a fresh session.

What this demo does NOT claim (say so in the runbook)

  • No sandbox isolation between users on the container tier. Every user's turns lease the same shared sandbox containers, which share /workspace, the Unix user and the process list. That's MI1 S5 (owner binding).
  • Direct credential mode. With no injector, a user's real inference secret reaches the shared worker. Grants replace this in MI1 S2.
  • Open egress. Container sandboxes reach the whole internet, including cloud instance metadata (deploy/vm: sandboxes can reach cloud instance metadata (169.254.169.254) #357). Require IMDSv2 with hop limit 1 on the demo host.
  • P4 has no internet (P4.1: implement microVM egress transport (vsock → shared proxy) #277) and no grant binding (MI1 S4). The P4 act runs on local content.
  • Plain HTTP. Clients reach the VM by SSH tunnel or a firewall allowlist. There's no TLS.

Interaction with the MI1 roadmap

The multi-user isolation design (docs/specs/2026-09-28-moca-multi-user-isolation-design.md, §10.2) is building S2–S6 in parallel. Two collisions to watch:

  • §6.6 first-subject pin: once S2 lands, MOCA_TENANCY=single refuses every subject after the first. A two-user demo then needs MOCA_TENANCY=multi, which needs S5. Pin the demo to a release, or sequence it after S5.
  • Direct mode retired under multi (S2) and item C's credential-shape fix: C's plan must say how S2's grants absorb it.

Optional follow-ups (not scheduled here)

Working conventions

  • Plans live in docs/plans/ (gitignored), one per child, written with superpowers:writing-plans.
  • Commits are signed off (git commit -s) with an Assisted-By trailer.
  • Anyone using the shared KVM rig alerts the owner first.

Activity

  1. added
    enhancement
    on Sep 30, 2026
  2. pdettori commented on Oct 1, 2026

    @pdettori
    MemberAuthor

    The demo ran end to end on the shared KVM rig, 2026-10-01, at main @ 03d2ee8. The runbook with the run recorded is docs/demos/vm-multi-user-demo.md, in #412, which is ready for review.

    Every act held, with two real GitHub accounts and a real model on each user's own Anthropic key. One person played both users, on one laptop; two people on two laptops is the one case not tried.

    Scenario point Result
    1. P6 and P4 on one VM Both tiers ran on the same host, attached to the same relay, one at a time. P4 was installed and rehearsed during prep: p4-turn-smoke.sh --auth --failure-paths passed 34/34. The live switch, removing the containers and starting the worker, attached moca_microvm_0 alone in 2 s. Nobody had to log in again, and no session was lost.
    2. mocactl Both users went through the real device flow (github:6678093, github:228572680). doctor passed all seven checks for both, and they created and resumed sessions with mocactl run.
    3. Research from the sandbox Both agents ran git clone and curl -o in a container sandbox, and answered 03d2ee8c067d, v26.10.0, 2026-09-21. All three equal git ls-remote and nodejs.org's index. research-smoke.sh passed 13/13 in prep.
    4. Multi-user Each turn spent its own user's credential: the audit shows anthropic for user 1 and anthropic-dev for user 2, with different keys. Each user's session list held only their own sessions. Another user's session id was refused exactly like a made-up one, and its owner resumed it normally.

    On the P4 tier:

    • The guest reported Linux (none) 6.18.44+, against the host's 6.18.44-99.149.amzn2023.
    • A session's workspace outlived its VMs: 3 Execs in 3 distinct VMs per user, and turn 2 saw turn 1's commit.
    • User 2's workspace held only user 2's files.
    • The guest's curl failed with Could not resolve host (P4.1: implement microVM egress transport (vsock → shared proxy) #277), as the runbook says it will.

    The "does not claim" list, seen live: both users' research clones landed in the same container's /workspace (sh-sandbox-1). That's the shared-sandbox limit, MI1 S5 and #408, and the runbook makes it an act of its own.

    New issues from the run:

    #412's fix list also records smaller findings:

    • session titles and the "0 turns" count;
    • research-smoke.sh leaving an empty subject record;
    • no headless view of tool calls.

    Status of the children:

    Still open and relevant:

    The rig afterwards: it's back to how it was found (P4-only, its earlier checkout, config files restored, tunnel accounts and the run's sessions removed). Two exceptions: the post-#372 sandbox image is kept, and the sessions from before the run are gone, lost to the prep step's Redis reset.

  3. added a commit that references this issue on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions