arcbox / rpc
AGENTS.md4.3k starsChanged 4 months agoApache-2.0View on GitHub
Basics live in the crate READMEs — don't duplicate them: - Message layout & the additive-only / buf breaking / handshake policy: rpc/arcbox-protocol/README.md. - Transport usage, VsockStream/VsockShutdown and the port-1024 note: rpc/arcbox-transport/README.md. The CID (host=2, guest=3+) table is in the src/vsock/mod.rs module docs; the CID_HOST = 2 constant is src/vsock/addr.rs, and AGENT_PORT = 1024 is common/arcbox-constants/src/ports.rs. - gRPC service/client exports: rpc/arcbox-grpc/README.md. - Backend-specific transport selection (is_blocking()): app/AGENTS.md. This file is only the non-obvious operational knowledge. - Daemon control plane =…
Trending
Quiet since September.thin dataabout the whole repository
Who's talking about arcboxlabs/arcbox
- A Hacker News story“ArcBox: From-Scratch Container Runtime for macOS in Rust (Docker, K8s, MicroVMs)”Hacker News · Jul 20, 2026 · 3 points
- @github-trending-rs.bsky.social“🚀 Skyrocketing! 🚀 (200+ new stars) 📦 arcboxlabs / arcbox ⭐ 3,352 (+360) 🗒 Rust Run AI agents on real …”Bluesky · Sep 6, 2026
- @githubprojects.bsky.social“arcboxlabs/arcbox Agents need powerful system access. Giving them your actual machine is the uncomfortable …”Bluesky · Sep 6, 2026
- @github-trending-rs.bsky.social“🎉 Celebrating! 🎉 (500+ new stars) 📦 arcboxlabs / arcbox ⭐ 2,448 (+506) 🗒 Rust Run AI agents on real and …”Bluesky · Sep 2, 2026
- 1Password/for-open-source“Application for ArcBox”GitHub · Apr 18, 2026
The biggest 5 of 6 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 6
Talked about on Bluesky, GitHub and Hacker News (6 times).
On Bluesky · 3
- Sep 6, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 arcboxlabs / arcbox ⭐ 3,352 (+360) 🗒 Rust Run AI agents on real and isolated machines — own… — @github-trending-rs.bsky.social0 likes and reposts · 1 reply
- Sep 6, 2026arcboxlabs/arcbox Agents need powerful system access. Giving them your actual machine is the uncomfortable part. ArcBox gives agents… — @githubprojects.bsky.social0 likes and reposts · 1 reply
- Sep 2, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 arcboxlabs / arcbox ⭐ 2,448 (+506) 🗒 Rust Run AI agents on real and isolated machines — own kernel,… — @github-trending-rs.bsky.social0 likes and reposts · 1 reply
On GitHub · 2
- Apr 18, 2026Application for ArcBox — 1Password/for-open-source0 reactions · 2 comments
- Mar 23, 2026feat: remove daemon plist log paths (companion to arcbox#99) — arcboxlabs/arcbox-desktop0 reactions
On Hacker News · 1
- Jul 20, 2026ArcBox: From-Scratch Container Runtime for macOS in Rust (Docker, K8s, MicroVMs)3 points
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- app/AGENTS.mdAGENTS.md
- common/AGENTS.mdAGENTS.md
- computer/AGENTS.mdAGENTS.md
- engine/AGENTS.mdAGENTS.md
- guest/AGENTS.mdAGENTS.md
- runtime/AGENTS.mdAGENTS.md
- virt/AGENTS.mdAGENTS.md
- xtask/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 0 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 117
If it's a *new* .proto file, add it to all three proto lists: arcbox-protocol/build.rs (prost, messages), arcbox-grpc/build.rs (tonic, …
- Very specific: line 132
Add a hand-written re-export in arcbox-protocol/src/lib.rs (the flat pub use v1::{...} block and the per-module pub mod) — nothing …
- Very specific: line 135
If it's a new service the daemon must serve, register it on arcbox_api::connect::router with .add_service(...) — the daemon serves only …
- Very specific: line 157
No codec step remains: the guest agent, AgentClient, and the vsock frames use the same arcbox-connect buffa types, so a new message is …
- Very specific: line 166
Add a MessageType enum variant and its from_u32 arm in common/arcbox-constants/src/wire.rs (and a roundtrip test case).
- Very specific: line 173
Add a method on AgentClient (engine/arcbox-engine/src/agent_client.rs) that buffa-encodes and frames the message via rpc_call.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
rpc/ — Protocol & Transport Agent Guidance
Basics live in the crate READMEs — don't duplicate them:
- Message layout & the additive-only /
buf breaking/ handshake policy:rpc/arcbox-protocol/README.md. - Transport usage,
VsockStream/VsockShutdownand the port-1024 note:rpc/arcbox-transport/README.md. The CID (host=2, guest=3+) table is in thesrc/vsock/mod.rsmodule docs; theCID_HOST = 2constant issrc/vsock/addr.rs, andAGENT_PORT = 1024iscommon/arcbox-constants/src/ports.rs. - gRPC service/client exports:
rpc/arcbox-grpc/README.md. - Backend-specific transport selection (
is_blocking()):app/AGENTS.md.
This file is only the non-obvious operational knowledge.
Three surfaces in one directory (read this first)
- Daemon control plane = Connect (
arcbox-connect+connectrpc), served over the Unix socket. Every daemon service — Machine, Kubernetes, Migration, System, Stats, Icon, the five sandbox services (Sandbox, Template, Process, Filesystem, Snapshot), plus Macos on macOS — registers onarcbox_api::connect::router, andapp/arcbox-daemon/src/control_plane.rsserves that router directly through hyper's protocol-detecting builder (HTTP/1.1 and HTTP/2). WHY: one set of handlers answers Connect (HTTP POST, JSON or binary), gRPC, and gRPC-Web, so a caller with no proto toolchain cancurl --unix-socketthe API while native clients keep gRPC. tonic is no longer in the serving path;arcbox-grpc's generated tonic clients are deliberately kept and used by e2e and the daemon's own tests as the standing proof that the gRPC format still answers at the same endpoint. (The CLI has none:abctlspeaks Connect only, andtonicis absent from its dependency tree.)connectrpcis bound tobuffa::Message, and since CORE-73 the buffa types inarcbox-connectare the ONE runtime representation: daemon handlers,abctl, the fleet agent's daemon client, reflection's descriptor set, and both ends of the vsock wire. The prost twins inarcbox-protocolare still generated, but ONLY test support consumes them: the tonic test clients (daemon/e2e wire-format proofs) and the fleet agent's tonic mock daemon. The two codegens emit identical bytes, which is what lets a prost test peer prove the buffa server's wire format.- Reflection is served by
connectrpc-reflectionfrom the whole daemon's descriptor set. It answers501over HTTP/1.1 Connect becauseServerReflectionInfois bidi-streaming and Connect carries bidi only over HTTP/2 — that is the RPC's shape, not a wiring bug.
- Host↔guest agent channel is NOT gRPC.
service AgentService(arcbox-protocol/proto/agent.proto) is schema-only and never served —AgentServiceClient/Serverare re-exported (arcbox-grpc/src/lib.rs) with zero consumers. The real channel is a custom length-prefixed frame keyed byarcbox_constants::wire::MessageType, dispatched inguest/arcbox-agent/src/rpc.rsand driven byAgentClient(engine/arcbox-engine/src/agent_client.rs). Editing the tonicAgentServicedoes nothing at runtime. - The Docker API vsock channel (port 2375) is framed too, but differently.
It carries HTTP bytes inside
arcbox_transport::vsock::HalfCloseStreamframes —[u32 BE len][payload], a zero length being that side's EOF — because neither macOS backend delivers a host half-close to the guest anddocker run -ineeds stdin EOF to reach the container (#268). Both ends must speak it: the host proxy'sGuestConnectorand the guest agent'sproxy_docker_api_connection; the mock guest inapp/arcbox-docker/tests/supportdoes as well. Since v6 the Kubernetes (16443) and NFS (2049) relays wrap the same framing around their raw TCP bytes (kubernetes_proxy.rs/nfs_mount.rshost-side,proxy.rs/nfs.rsin the agent). Changing this framing is aAGENT_PROTOCOL_VERSIONbump (v4 introduced the half-close, v5 the flow-control window: a header with the top bit set is a grant, not a length; v6 extended it to the two relays). - The
arcbox-protocol/src/lib.rstop-of-file doc says "ttrpc" — stale. There is no ttrpc dependency; trust this file over that comment.
Invariants (each with a one-clause why)
- Generated prost code is committed (
arcbox-protocol/src/generated/*.rs) and rustfmt'd bybuild.rs(writes intosrc/, notOUT_DIR) — a.protoedit without a rebuild+commit ships a stale/unformatted file that failscargo fmt --checkonly in CI. - Generated types carry NO serde impls — persisted/user-facing JSON must
come from hand-written DTOs, never from codegen shapes. WHY: it keeps the
message-layer codec swappable without silently rewriting on-disk or
scripted formats (
buf breakingchecks protobuf wire only and would never catch such a rewrite). The one existing DTO is thevirtio-debug.jsonmirror (tests/e2e/src/virtio_debug.rs, shape pinned by test);abctl --jsonoutput is likewise hand-mapped (serde_json::json!payloads inapp/arcbox-cli/src/commands/). Do not reintroduce blankettype_attributeserde derives inarcbox-protocol/build.rs. protocol_version(enforced) ≠version(debug-only).AgentPingResponse.protocol_versionis gated againstMIN_AGENT_PROTOCOL_VERSION;.versionis informational log text only (agent_client.rs::check_agent_protocol). Don't conflate them.- Bump
AGENT_PROTOCOL_VERSIONonly when a change alters the meaning of existing messages — purely additive fields don't need a bump; unknownMessageTypes already fail cleanly (common/arcbox-constants/src/wire.rs). MAX_FRAME_SIZE(16 MiB) must stay identical in botharcbox-transport/src/vsock/blocking.rs(HV, no tokio,polldeadlines) and.../transport.rs(async VZ/Linux) — the only thing keeping them equal is a comment; diverge and cross-backend frames silently mismatch.AgentClient::connect()is a no-op on the blocking path — the HV transport is connected at creation (from_fd); only the async path dials.- Every proto in the dir is additive-only under the CI
buf breakinggate — there are NO exemptions. The historical sandbox carve-out (pre-release CORE-52 redesign) was removed when the template catalog, the surface's last piece, shipped in the public SDKs (CORE-107):arcbox.sandbox.v1now breaks the gate like everything else. The fleet protos'fleet/arcbox-fleet-proto/buf.yamlis a separate, unrelated gate. - Well-known types map to
pbjson-types, notprost-types(extern_path(".google.protobuf", "::pbjson_types")in BOTHarcbox-protocol/build.rsandarcbox-grpc/build.rs— keep them in lockstep). Historically forced by the blanket serde derives; kept after their removal so public field types (pbjson_types::Timestampetc.) stay stable for every consumer — reverting toprost-typeswould churn all of them for zero benefit.
Extending checklists (change every path together)
Add/change a daemon gRPC message or service:
- Edit the
.proto. - If it's a new
.protofile, add it to all three proto lists:arcbox-protocol/build.rs(prost, messages),arcbox-grpc/build.rs(tonic, services), andarcbox-connect/descriptor/protos.txt(buffa messages plus the Connect service traits the daemon actually implements — a plain list, read by both that crate's build script and its refresh script, so there is only ever one of it). Miss one → missing message types or service stubs with a confusing compile error; miss the last and step 6 has no trait to register. - For any edit under
arcbox-protocol/proto/that arcbox-connect compiles, runmake refresh-connect-descriptor. That crate generates from a committed descriptor set, because its sources live in another package and cargo cannot package another package's directory; its build script hashes the sources and fails until the descriptor matches. protoc is needed for this step and no other. - Rebuild (regenerates + rustfmts
src/generated/*.rs) and commit the result. - Add a hand-written re-export in
arcbox-protocol/src/lib.rs(the flatpub use v1::{...}block and the per-modulepub mod) — nothing generates or checks these; a new message is invisible downstream until listed. - If it's a new service the daemon must serve, register it on
arcbox_api::connect::routerwith.add_service(...)— the daemon serves only that router (see the sandbox checklist below). What died with tonic is the daemon'sServer::builder().add_service()chain inapp/arcbox-daemon/src/services.rs, not the connectrpc router builder method of the same name.
Add/change something under arcbox.sandbox.v1 (the Connect surface):
- Edit the
.proto; a new file goes into all three proto lists named in step 2 above (arcbox-connect,arcbox-protocol,arcbox-grpc) — connectrpc codegen is the one that emits the service traits the daemon implements. Any edit here also needs step 3'smake refresh-connect-descriptor. - Implement the method in
app/arcbox-api/src/connect/against the connectrpc trait, not a tonic one, working in the buffa types directly (request.to_owned_message()in, owned messages out — the blanketEncodableimpl covers them). There is no bridge to cross. - A new service goes on
arcbox_api::connect::router(orrouter_with_system). The daemon serves only that router, so a service missing there is a 404 on every format — themigrated_daemon_services_are_registered_on_the_connect_routertest incontrol_plane.rsis where that surfaces. - No codec step remains: the guest agent,
AgentClient, and the vsock frames use the samearcbox-connectbuffa types, so a new message is available to them the moment it is generated. Available is not wired: a message that must actually cross the vsock channel still needs the host↔guest checklist below (MessageType, guest dispatcher arm,AgentClientmethod).
Add a host↔guest agent RPC (NOT a tonic method):
- Define the proto message in
agent.proto. - Add a
MessageTypeenum variant and itsfrom_u32arm incommon/arcbox-constants/src/wire.rs(and a roundtrip test case). - Wire the guest side in BOTH files: the frame codec arms in
guest/arcbox-agent/src/rpc.rs(parse_request,message_type,encode_payload) and thehandle_requestdispatch inguest/arcbox-agent/src/agent/linux/rpc.rs—guest/AGENTS.md's extending checklist is authoritative for this half. - Add a method on
AgentClient(engine/arcbox-engine/src/agent_client.rs) that buffa-encodes and frames the message viarpc_call.
EXCEPTION — the sandbox family (every MessageType for which
is_sandbox_request() is true: the Sandbox* types incl. the
SandboxTemplate* catalog types, plus WatchSandboxCleanupRequest)
skips step 3's codec half: MessageType::is_sandbox_request() routes the
whole family to handle_sandbox_message
(guest/arcbox-agent/src/agent/linux/sandbox.rs) before the rpc.rs
codec, which therefore has no arms for it. Step 1's proto file splits by
audience: messages of the public sandbox API live in the
arcbox/sandbox/v1 protos (all three build-script arrays), while
host↔guest-internal control frames (SandboxPortForwardRequest,
SandboxCleanupTicket, SandboxResumeCommand, …) stay in agent.proto —
never expose an internal frame through the public schema. A new
sandbox-family message needs: the proto (in the right file per that
split), the MessageType variant + is_sandbox_request() arm, a
handle_sandbox_message dispatch arm, and the AgentClient method.
MachineExecRequest, DebugExecRequest (a MachineExecRequest payload
naming the target container; its output comes back as DebugExecResponse)
and MachineTcpConnectRequest are the other codec bypasses: they are
dispatched by name before parse_request
(guest/arcbox-agent/src/agent/linux/rpc.rs), so they have no rpc.rs
arms either, and each owns the rest of its connection. Streaming alone does
not waive the
codec — WatchReadiness/WatchStats/WatchMemoryPressure stream too and
keep their rpc.rs arms.
Change the wire contract / add a meaning-bearing field:
- Bump
AGENT_PROTOCOL_VERSION(andMIN_AGENT_PROTOCOL_VERSIONif dropping old-agent support) inwire.rs. - The handshake gate (
check_agent_protocol) is called from three sites — update/verify all:engine/arcbox-engine/src/machine.rs(ready probe) and both boot arms inengine/arcbox-engine/src/vm_lifecycle/boot.rs(blocking HV + async VZ/Linux). Miss one and a stale staged agent yields an opaque readiness timeout instead of the actionable "staged agent is stale" error (the ABX-410 / commit b90d2368 class this was built to prevent).
Failure signatures (symptom → first commands → likely cause)
- New agent RPC "does nothing" / method never runs.
rg -n "add_service" app/arcbox-daemon/src/services.rs(Agent absent) →rg -n "MessageType::" guest/arcbox-agent/src/rpc.rs. Cause: you implemented the tonicAgentServiceinstead of adding aMessageType+ guest dispatcher arm. - Old staged agent → opaque readiness timeout, not "stale agent" error.
rg -n "check_agent_protocol" app— confirm all three call sites present. Cause: a handshake gate arm was missed. (Stale-agent selection itself: newest mtime across dev tree / musl target /~/.arcbox/bin— seetests/e2e.) - An RPC returns 404 on every format while its neighbours work.
rg -n "add_service" app/arcbox-api/src/connect/mod.rs— the service was never added toarcbox_api::connect::router, and the daemon serves only that router. The registration test incontrol_plane.rspins the full service list; extend it with the new service. - A sandbox field is silently empty on one surface only. Both codegens
read the same
.proto, so this is a stale build, not drift: rebuildarcbox-connect(itsbuild.rsreruns on the proto files) and re-check.bridgenever copies fields, so there is no mapping to have missed. cargo fmt --checkfails only in CI.git status rpc/arcbox-protocol/src/generated/→ cause: you edited a.protowithout rebuilding (or rebuilt without rustfmt), shipping stale/unformatted generated code.- A forensic/
--jsonfield is missing though the proto has it. The hand-written DTO mirror was not extended with the proto change (e.g. a newVirtioQueueDebugfield never added totests/e2e/src/virtio_debug.rs). Codegen no longer feeds these surfaces, so proto edits reach them only by hand — update the mirror and its shape-pinning test together.
Validation ladder (cheapest first)
cargo test -p arcbox-protocol -p arcbox-grpc -p arcbox-transport(frame roundtrip,MessageTyperoundtrip, handshake unit tests). For the Connect surface add-p arcbox-api(the buffa/prost wire-identity test) andcargo test -p arcbox-daemon control_plane(one endpoint answering Connect, gRPC, and gRPC-Web, plus reflection) — both are VM-free.- Reproduce the CI proto gate locally (compares PR against its base, not a
hardcoded master):
buf breaking rpc/arcbox-protocol/proto --against '.git#branch=origin/master,subdir=rpc/arcbox-protocol/proto'. - For agent-protocol changes, continue up the HV validation ladder in
virt/AGENTS.md(bare probe → daemon-level →cargo xtask e2e); VZ is the oracle backend, so HV-only red points at the HV transport/boot arm.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

