sdk/meshnet: add embedded Go SDK for Agent Mesh #843
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 457 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.367
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #843"
general
weight: 0.35
aojea
Summary
Adds
github.com/google/agentmesh/sdk/meshnet(modeled ontailscale.com/tsnet), allowing Go applications and agent frameworks (such asa2a-cli) to join an Agent Mesh directly in-process as a single binary—without managing an externalagentmesh-nodesidecar process, loopback bearer token, or port coordination.Key Capabilities
Server.Up,Server.Refresh,Server.Close,WriteStateDir,ReadStateDir):- Persists
identity.keyandcredential.json(0700/0600) byte-for-byte compatible withagentmesh-node state export|import,sdk/js, andsdk/python.- Supports cached credential resume,
BootstrapTokenPath/BootstrapToken(POST /enroll+GET /enroll/statuspolling),JWTPath/TokenSource(POST /register),oidc_sessionrefresh-token recovery, proactive background renewal (POST /refresh), signed/keysverification, and/mesh/events/v1(StrictSign) live revocations, key rotations, and bans.Server.ListenA2A) & UnspoofableServer.WhoIs:- Returns in-memory
net.Listeners (PrivateListenerover/libp2p-httpand optionalPublicListenerover/mesh/ingress/1.0.0inINGRESS_AUTH_MODE_EDGEorINGRESS_AUTH_MODE_PASSTHROUGH) plus canonicalPrivateURLandPublicURLendpoints.- Falls back cleanly to internal-only announcement (
PublicURL = nil) when the hub's policy ceiling refusesServiceIngress.- Automatically relativizes and rewrites A2A
AgentCardsupportedInterfacesURLs per caller.- Maps
http.Request.RemoteAddrvia an in-memorynet.Pipeconnection table to cryptographically verifiedCallerInfo(PeerID,Principal,Roles,Labels,Task).http.Client, Discovery & Offline Attenuation (Server.HTTPClient,Server.Discover,Server.AttenuateToken):- Routes
http://agentmesh.local/mesh/<peer_id>/<type>/<name>[/<rest>]over authenticated libp2p streams, enforcing provider Biscuit verification,allowed_publishDatalog checks,EgressRequireLabels, andX-Mesh-Required-Labelsbefore sending request bytes.- Mints and optionally seals task-scoped Biscuits (
tar_blockfact, 0 rules, 0 checks) in memory./v1Surfaces (Server.MCPServer,Server.MCPHandler,Server.InferenceHandler):*- Exposes the 6 progressive-discovery mesh MCP tools (
list_local_services,discover_remote_services,get_mesh_info,find_remote_tools,describe_remote_tool,call_remote_tool) andsystem://mesh.catalog.- Serves
GET /v1/models,POST /v1/chat/completions, andPOST /v1/completionsrouted over meshinference://providers with streaming SSE pass-through.Security Invariants
meshPolicy()helper viaidentity.AuthorizeMeshRequest+MeshRequest.TaskRequest(), and validate paths withapi.HasDotSegment.meshnet.Serveris classified and verified insdk/meshnet/protocol_inventory_test.go(mirroringinternal/node/protocol_inventory_test.go)./mesh/ingress/1.0.0is gated exclusively to authenticated peers holdingmesh:role:routerbefore the HTTP server reads a byte, re-verifies end-caller Biscuits locally inEDGEmode, and strips spoofedX-Mesh-*headers inPASSTHROUGHmode.go.moddependencies.Validation
go test -race -count=1 ./sdk/meshnet/...go test -race -p 1 -count=1 -run TestMeshnet ./tests/integration/...make && make lint && make test