sam-mesh

A way to connect an agent to services and tools on a Sovereign Agent Mesh, a network of cooperating agent systems.

In plain words
What is it for?
Use it to inspect the mesh, discover reachable services, call remote tools, connect to a node, or request model inference from another machine.
Why use it?
It provides access to a needed remote capability when local tools cannot provide it.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/google/sam/sam-mesh
Any agent
npx skills add google/sam --skill sam-mesh
Clone the repo
git clone --depth 1 https://github.com/google/sam

Made for: Claude Code, Codex.

Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,735 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00078 $0.02735
Opus 5 $0.00039 $0.01367
Sonnet 5 $0.00016 $0.00547
Haiku 4.5 $0.00008 $0.00274

Measured 2d ago against content hash 1117380fd454, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade D, and why

sam-mesh scanned grade D with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

`curl -sL https://sam-mesh.dev/install.sh | bash` or

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

`~/.gemini/config/mcp_config.json`.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

`curl -sL https://sam-mesh.dev/install.sh | bash` or
agents/skills/sam-mesh/SKILL.md · 241 lines

How it starts

The opening of the file, as written. The whole thing — 241 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SAM Agent Skill

Use this skill when local tools cannot satisfy the task and the SAM mesh can. Prefer local tools first. Reach into the SAM mesh only for the capability needed to complete the task.

Pick the path that matches the need:

Bootstrap A Node

The mesh is reached through a local sam-node. When its MCP tools are missing, guide the user through these steps. Propose each shell command and let the user approve it before running anything.

  1. Check the CLI: sam-node --help. If it is missing, install it with curl -sL https://sam-mesh.dev/install.sh | bash or go install github.com/google/sam/cmd/sam-node@latest.
  2. Start the node in the background: sam-node run --daemonize. It returns as soon as the node answers, and prints the endpoint, the API token file, the log file, and how to stop it. It is idempotent, so run it again whenever you need to confirm a node is up.
  3. If step 2 reports that the node is not enrolled, run the command it prints, sam-node join --headless <control-plane-url>. In headless mode SAM now prefers OAuth device flow automatically when the OIDC provider supports it, so no pasted callback code is required: it prints a verification URL/code and polls until login completes. If the provider does not expose a device endpoint, SAM falls back to OOB code-paste flow; show the URL/code to the user, wait for completion, then repeat step 2. For deterministic automation, force the flow with --auth-mode device (also oob, browser, or the default auto); --auth-mode device fails fast if the provider has no device endpoint. Enrollment is a one-time step per machine.
  4. Read the node API token from the file named in step 2, then register the MCP endpoint http://127.0.0.1:8080/mcp with the header X-Sam-Authentication: Bearer <token>. Claude Code: claude mcp add --transport http sam-mesh http://127.0.0.1:8080/mcp --header "X-Sam-Authentication: Bearer <token>". Antigravity: add the same URL as serverUrl with the same header to ~/.gemini/config/mcp_config.json.
  5. Tell the user to restart the agent session, since MCP tools load at startup.

Read the full file on GitHub · 241 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 241 lines · 78 tokens per session scan D 1117380fd454

Subscribe to this mod's changes

sam-mesh is a skill published in the GitHub repository google/sam (796 stars, last pushed 3d ago), licensed Apache-2.0. It adds 78 tokens to every session and 2,735 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it D with 3 findings (downloads and executes remote code, reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.