Add the sandbox link protocol, relay core and Sandbox I/O bootstrap - #338
Merged
Merged
Conversation
SaladDay
force-pushed
the
aos/link-protocol
branch
2 times, most recently
from
October 1, 2026 00:06
8be23cd to
87896c1
Compare
Define the Link protocol between the agent-host Runtime, the Sandbox I/O service and the relay in internal/sandboxlink: sandboxwire-framed control messages, typed failures, the Authority interface, serve and attach peer libraries over yamux on WebSocket, and a relay that authorizes, binds and splices service streams with leases, generations and revocation. File binds carry export grants and Network binds carry egress rules. Peers dial only wss:// or loopback ws:// relay URLs. Add sandboxwire.RequestSequence, the strictly increasing request ID rule the sandbox I/O protocols share, and use it for Link control streams. Add internal/sandboxbootstrap for the Provider-to-service startup file, the two protocol documents and their AGENTS.md and development.md rows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the Link protocol. Agent-host Runtimes (attach peers) and Sandbox I/O services (serve peers) use it to reach each other through a relay. The relay authenticates both sides, authorizes each service stream and splices it opaquely. It also adds the Provider–Sandbox I/O startup input.
internal/sandboxlink/protocol.godefines the protocol:ServeHello,AttachHello,HelloAccepted;Open/Openedfrom the attacher,Bind/Boundto the serve peer;Authorityinterface;ServiceNetworkand the egress rules;Exports, a list ofExportGrant{ID, ReadOnly}.libp2p/go-yamux/v5over a binary WebSocket over TLS. Streams keep FIN (CloseWrite) distinct from abort (Reset).wss://, orws://to a loopback host. Core serves the relay behind the installation's HTTPS ingress.internal/sandboxwiregainsRequestSequence: RequestIDs strictly increase on a stream, per sender.ServerInstanceID;relay/core, which Core embeds in M2. It handles leases, generation staleness,RevokeAttachmentandRevokeResource.sandboxlinktestis a fixture Authority plus a TLS relay, used by the M1 lanes.internal/sandboxbootstrapis the strict startup file:version,link_url,credential,resource. The File service serves the single exportworld, rooted at the sandbox's/.docs/sandbox-link-protocol.mdowns the shared## Framingsection, anddocs/sandbox-bootstrap.mdcovers the startup file. Both have AGENTS.md boundary rows and repository-map rows.Out of scope: Core's route and database authority (M2), and the
oac-sandbox-iobinary (a later lane).Checks:
go test -raceover the link, relay and bootstrap packages; the relay package also ran with-count=20FuzzDecode, 30 sgo vet, gofmtPart of the agent-outside-sandbox work, milestone M1, lane L3.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.