sam

module
v0.1.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2026 License: Apache-2.0

README

SAM

SAM

SAM is a private network for AI agents. A node runs next to an agent and gives it three things: a way to publish tools and models to the network, a way to find and call what other nodes publish, and an identity every other node can verify. Nodes connect directly when they can and through relays when they cannot, so the network works across laptops, containers, clusters and phones behind NAT.

Two properties hold everywhere:

  • Nothing is reachable by default. A node exposes no services until its configuration says so, and no node may call a service the mesh policy has not granted. Grants are evaluated on service names, never on addresses.
  • Identity comes from your identity provider. A node enrolls with an OpenID Connect token or a one-time bootstrap token, and the control plane turns that into a short-lived, offline-verifiable credential bound to the node's own key.
Installing sam-node, adding the skill, and an agent discovering and calling tools across the mesh

Try it

curl -sL https://sam-mesh.dev/install.sh | bash   # sam-node, mcp-client and friends
sam-node join https://bananas.sam-mesh.dev        # one-time login
sam-node run --daemonize                          # local MCP server on 127.0.0.1:8080
sam-node skill install                            # teach your agent to use it

Your agent now has tools that discover and call services across the mesh, and an OpenAI-compatible endpoint that routes model requests to whoever serves the model. bananas.sam-mesh.dev is a shared developer testnet with no uptime promise; the quick start walks through it, and your own mesh runs a control plane on your laptop in one command.

What is in a mesh

Program Role
sam-control-plane Verifies who is joining, issues each node a signed credential, and holds the policy that says who may call what.
sam-router A well-known peer that nodes connect to first. Relays traffic between nodes that cannot reach each other and hosts the discovery table.
sam-node Runs next to your agent or service. Enrolls, connects, serves your local backends to the mesh, and exposes the mesh to your agent as a local MCP server and OpenAI-compatible API.
sam-one The control plane, a router and a web console in one binary, for laptops and small deployments.

Documentation

sam-mesh.dev/docs is built from site/.

  • Getting started: one node on the testnet, then a mesh of your own.
  • Concepts: architecture, identity and enrollment, authorization, networking.
  • Guides: exposing services, connecting agent clients, headless enrollment, Kubernetes, Cloud Run.
  • Reference: every flag, configuration key, HTTP route and policy field.
  • Preview: sandboxed agents and the mobile app, which work but are still settling.
  • Contributing: building, testing and the local kind environment.

Status

SAM is pre-1.0. The node, routers, control plane, identity and policy model are stable in shape and exercised by the test suite and two public testnets; see ROADMAP.md for the release plan. Sandboxed agents (sam-box, nano-init) and the mobile app are in preview.

License and disclaimer

Apache-2.0; see LICENSE. This is not an officially supported Google product, and it is not eligible for the Google Open Source Software Vulnerability Rewards Program.

Directories

Path Synopsis
agents
skills/sam-mesh
Package samskill embeds the SAM agent skill document so it ships inside the binaries that install it.
Package samskill embeds the SAM agent skill document so it ships inside the binaries that install it.
cmd
mcp-client command
sam-bench command
Command sam-bench measures what an agent experiences when it reaches the mesh through a sandbox boundary.
Command sam-bench measures what an agent experiences when it reaches the mesh through a sandbox boundary.
sam-box command
Command sam-box is the sandbox dataplane: one per agent sandbox, serving the boundary an agent's traffic leaves through.
Command sam-box is the sandbox dataplane: one per agent sandbox, serving the boundary an agent's traffic leaves through.
sam-console command
sam-node command
sam-one command
sam-one is the all-in-one SAM distribution: control plane, libp2p router and storage in a single binary serving a single public port.
sam-one is the all-in-one SAM distribution: control plane, libp2p router and storage in a single binary serving a single public port.
sam-router command
development
examples/code-reviewer-pool/samples
Sample file with intentional issues for the reviewer pool to find.
Sample file with intentional issues for the reviewer pool to find.
internal
bench
Package bench drives a reproducible agent workload against the mesh.
Package bench drives a reproducible agent workload against the mesh.
controlplane/client
Package client is how a mesh component reads from its control plane.
Package client is how a mesh component reads from its control plane.
node/discovery
Package discovery provides interest-scoped service announcements over GossipSub.
Package discovery provides interest-scoped service announcements over GossipSub.
ratelimit
Package ratelimit bounds how often an individual peer may make a node or router do pre-authentication work.
Package ratelimit bounds how often an individual peer may make a node or router do pre-authentication work.
secrets
Package secrets resolves secret configuration for SAM binaries.
Package secrets resolves secret configuration for SAM binaries.
skill
Package skill installs the SAM agent skill into the directories local AI agents scan, so an agent can bootstrap a node and drive the mesh without the user pasting instructions by hand.
Package skill installs the SAM agent skill into the directories local AI agents scan, so an agent can bootstrap a node and drive the mesh without the user pasting instructions by hand.
standalone
Package standalone wires the control plane, the libp2p router and the shared SQL store into one process serving a single public port: the router's WebSocket listener carries libp2p upgrades while every other HTTP request falls through to the control-plane mux.
Package standalone wires the control plane, the libp2p router and the shared SQL store into one process serving a single public port: the router's WebSocket listener carries libp2p upgrades while every other HTTP request falls through to the control-plane mux.
tunnel
Package tunnel publishes a local HTTP listener on a public https URL through a third-party connector, so devices that cannot route to the host (a phone on cellular, a laptop on another network) can still enroll and join the mesh.
Package tunnel publishes a local HTTP listener on a public https URL through a third-party connector, so devices that cannot route to the host (a phone on cellular, a laptop on another network) can still enroll and join the mesh.
mobile
sam-node-ffi command
tests
e2e command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL