sam
AGENTS.md1.2k starsChanged 13 days agoApache-2.0View on GitHub
You are an expert software engineering assistant helping to develop, maintain, and test the Agent Mesh repository.
1 other project uses a version of this.
Trending
More talk lately.about the whole repository
Most recently taken up by
- google/agentmeshword for word, first seen Oct 11, 2026
Who's talking about google/sam
- google/agentmesh“refactor: rename project and repository from SAM to Agent Mesh”GitHub · Oct 9, 2026 · 1 reactions
- google/agentmesh“node, sdk: present a refreshed credential to the routers already connected”GitHub · Oct 8, 2026 · 1 reactions
- pion/awesome-pion“Add Google”GitHub · Oct 2, 2026 · 1 reactions
- google/agentmesh“sdk/python: dial routers and DHT peers at once, stop when the record is in hand”GitHub · Sep 27, 2026 · 1 reactions
- google/agentmesh“sdk/python: bound every dial the DHT walk makes”GitHub · Sep 27, 2026 · 1 reactions
The biggest 5 of 51 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 51
Talked about on GitHub and Bluesky (51 times).
On GitHub · 50
- Oct 9, 2026refactor: rename project and repository from SAM to Agent Mesh — google/agentmesh1 reaction
- Oct 8, 2026node, sdk: present a refreshed credential to the routers already connected — google/agentmesh1 reaction
- Oct 2, 2026Add Google — pion/awesome-pion1 reaction
- Sep 27, 2026sdk/python: dial routers and DHT peers at once, stop when the record is in hand — google/agentmesh1 reaction
- Sep 27, 2026sdk/python: bound every dial the DHT walk makes — google/agentmesh1 reaction
45 more on GitHub
- Sep 26, 2026Egress pep — google/agentmesh1 reaction
- Sep 24, 2026release: npm dist-tag for prereleases and a manual SDK publish — google/agentmesh1 reaction
- Sep 24, 2026Native JavaScript and Python SDKs, and the protocol contracts they need — google/agentmesh1 reaction
- Sep 19, 2026Follow MCP tool-list pagination in discovery and remote tool lookups — google/agentmesh1 reaction · 1 comment
- Sep 18, 2026deploy: let the cold-path probe try every provider it discovers — google/agentmesh1 reaction
- Sep 14, 2026discovery: record the canonical peer ID from an announcement — google/agentmesh1 reaction · 3 comments
- Sep 10, 2026node: operator-enforced egress label floor (egress.require_labels) — google/agentmesh1 reaction · 3 comments
- Sep 3, 2026node,router: reconcile peer bans from the control plane instead of a local store — google/agentmesh1 reaction · 5 comments
- Sep 1, 2026node: fail closed when a required-labels spec names no label — google/agentmesh1 reaction · 8 comments
- Aug 30, 2026SSE-safe HTTP timeouts in SamClient, self peer_id in get_mesh_info — google/agentmesh1 reaction · 1 comment
- Aug 22, 2026fix(api): sort label keys in ValidateLabels for deterministic errors — google/agentmesh1 reaction · 2 comments
- Jul 7, 2026Mmobile — google/agentmesh1 reaction · 1 comment
- Jun 26, 2026add mcp tools for debug and troubleshooting — google/agentmesh1 reaction
- Oct 19, 2026fix(pins): dispose #1047 to #1049 — sattyamjjain/agent-audit-kit0 reactions
- Oct 9, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 9, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 8, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 8, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 8, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 8, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 7, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 7, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 7, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 7, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 7, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 7, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 7, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 7, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 6, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 4, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 3, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 3, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 2, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 1, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Oct 1, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Sep 30, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Sep 30, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Sep 29, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Sep 27, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Sep 26, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Sep 26, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Sep 26, 2026Testnet hub is unhealthy — google/agentmesh0 reactions · 1 comment
- Sep 26, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
- Sep 25, 2026Testnet hub is unhealthy — google/agentmesh0 reactions
- Sep 25, 2026Testnet bananas is unhealthy — google/agentmesh0 reactions · 1 comment
On Bluesky · 1
- Aug 20, 2026AIエージェント同士が安全に通信してツールを共有できるP2Pネットワークツールっぽい マルチエージェントの開発や連携に使えそうかも yug1224 starred google/sam https://github.com/google/sam — @yug1224.com1 likes and repost
Other versions1 project uses a version of this.
Word for word · 1
- google/agentmesh★ 1.2k100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 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 repositoryOne other file it gives its agents.
- agentmeshSkill
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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 7
API Communication: All data communication between agentmesh-control-plane, agentmesh-router and agentmesh-node must happen exclusively via …
- Distinctive: line 23
If a task can be solved using the existing dependencies or the Go standard library, you must choose that path even if it requires more …
- Distinctive: line 28
Push Coverage Down: If test coverage for a specific edge case or feature can be added at a lower level (Unit or Integration), it is …
- Distinctive: line 29
No Redundancy: Do not replicate a test in the slower E2E path if it is already sufficiently covered in the Integration path.
- Very specific: line 32
Integration Tests (
tests/integration/): Verify module interactions and API compliance in Go and those are time bounded, no more than 10 … - Distinctive: line 38
Ensure all new code is highly modular, prioritizing small, single-responsibility functions that are easy to unit test.
- Very specific: line 43
Ensure binaries build using make
- Very specific: line 44
Ensure linter passes make lint
- Very specific: line 45
Ensure test passes make test
- Very specific: line 46
Ensure e2e test passes make e2e-test
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
Agent Mesh Repository AI Agent Guidelines
You are an expert software engineering assistant helping to develop, maintain, and test the Agent Mesh repository.
1. Architecture & Component Independence
- Decoupled Architecture: The
agentmesh-control-plane,agentmesh-routerandagentmesh-nodecomponents are strictly independent. They must not share internal state or tightly couple their logic. - API Communication: All data communication between
agentmesh-control-plane,agentmesh-routerandagentmesh-nodemust happen exclusively via the common API defined inapi/agentmesh.proto. - One schema, two encodings: every request and response on any Agent Mesh-defined surface is a message in
api/agentmesh.proto. The mesh protocol — anything a mesh component speaks (node, router, the SDKs undersdk/): enrollment, refresh, keys, leases, auth streams, policy sync, token exchange (/token/exchange), and outbound border JWT minting (/sts/token) — is binary protobuf (application/x-protobuf). The operator plane — what humans, the web console and admin CLIs call (/admin/*,/users/*,POST /policies) — is protojson of the same messages, withUseProtoNamesand unknown fields rejected. Never define a wire shape on a Agent Mesh-defined surface as a Go struct withjsontags, an anonymous struct ormap[string]any, and never serialize aninternal/storage(or any other internal) type onto either surface. The sole exceptions are external standard protocols for unmodified third-party clients and cloud federation: OAuth 2.1 / RFC 8693 / RFC 7009 / RFC 9728 (POST /oauth/token,POST /oauth/revoke,/oauth/authorize,/.well-known/*,/jwks), Envoyext_authz/ext_proc, MCP JSON-RPC (/mcp), OpenAI/v1/*, and A2A/.well-known/agent-card.json. Clients incmd/,internal/consoleand cross-language SDKs (sdk/js,sdk/python) importapi/or its generated bindings only; the in-module embedded Go SDK (sdk/meshnet) wrapsinternal/node,internal/identity, andapi/so embedded Go applications andagentmesh-nodeshare one PEP implementation. The node's/debug/*endpoints are exempt: unversioned diagnostics for humans, printed as-is byagentmesh-node debugand parsed by no client, so they stay unexported Go structs. - Instants are
google.protobuf.Timestamp, named*_time(expire_time,sign_time,event_time), neverint64seconds or milliseconds.Timestamphas fixed units, an explicit unset, renders as RFC 3339 in protojson (anint64renders as a quoted decimal string), and has a first-class conversion in Go, JavaScript, Python and Dart. A receiver treats an unset instant as invalid, never as the epoch. The one exception is a proof-of-possession value: it is the number that appears in the signed text (mesh:<endpoint>:<peer_id>:<n>), so it stays anint64namedchallenge_unix_ms, the unit in the name. What a member persists between runs is also a message here (MemberCredential), so a state directory written by one implementation loads in another. - Datalog text is the policy contract: the control plane renders the mesh policy as Datalog rules (
PolicyConfigGetResponse.datalog_rules); every member, in any language, adds that text to its authorizer and none derives rules from roles and bindings itself. Datalog must stay in the form every Biscuit implementation parses: a predicate carries at least one term (presence-only facts arename(true), seeapi.MarkerFact). - Secrets never travel as flag values: binaries read credentials from a file (
--*-path) or the environment, never from a command-line argument that would sit inpsoutput and shell history. Banners and logs name the source of an operator-supplied secret instead of echoing it. - Task-Scoped Authorization & Safe Biscuit Attenuation (
tar_block): Agent Mesh acts as the Authority, Policy Decision Point (PDP), and Task-Scoped Credential Layer (site/content/docs/contributing/security-architecture.md). Never add Datalog rules or checks to non-authority Biscuit blocks (block_idx >= 1). Appended blocks must contain 0 rules, 0 checks, and exactly 1tar_block("<base64url-proto>")fact encoding a serializedapi.TaskAuthorizationRule. Verifiers enforce the intersection of Block 0 Datalog RBAC and every appendedTaskAuthorizationRulein Go, TypeScript, and Python. - Two-Token Model & Complementary Gateway/PEP Integration: Inside the mesh, credentials are Biscuits; at both borders, credentials are standard JWTs (
site/content/docs/contributing/security-architecture.md). Inbound platform credentials (OIDC, K8s SA, SPIFFE JWT-SVID) exchange into delegated Biscuits (POST /token/exchange); outbound verified Biscuits mint short-lived ES256 JWTs at the control plane (POST /sts/token) that the egress node exchanges at cloud STS endpoints (CloudTokenExchanger).agentmesh-nodeintegrates with existing gateways (agentgateway, Istio, Envoy) via Envoyext_authz/ext_procand RFC 8693/oauth/token, while native SDKs (sdk/meshnet,sdk/js,sdk/python) attenuate and seal Biscuits in memory. - Policy on Names: egress policy, secret injection and routing decisions are made on the destination name, never on an IP. Deny by default.
- Zero Trust: Enforce a Zero Trust architecture. Assume no implicit trust between nodes, control planes, routers, or external actors. All data passing through the API must be authenticated, authorized, and validated.
- Nothing interacts with the mesh unauthenticated: a router or a member serves a mesh protocol (the DHT, gossip, the relay, the data plane) only to a peer that completed the mesh handshake on that connection and whose credential has not lapsed; a stream from any other peer is reset and counted. The only protocols open to a peer that has not authenticated yet are the ones the handshake itself needs: the transport security handshake, identify, and
/mesh/auth. A libp2p library that registers its own stream handlers (kad-dht, gossipsub) is built on a host wrapper that installs this check in front of every handler, and its routing table admits only authenticated peers. A connection that has not authenticated within the deadline is closed. This holds for reads as much as for writes: a directory lookup or a gossip subscription is mesh data. - Zero config, safe defaults: the goal is zero trust with zero configuration. A component started with no flags must be secure; every default is the safe value (deny, verify, short-lived, loopback-only, bounded), and an operator opts into anything looser with an explicit flag whose help text names the risk. Before adding a flag, option or knob, ask whether a safe default removes the need for it.
- Auditable and traceable behavior: when a member is admitted, refused, disconnected, shed, skipped or retried, the process says so in a log line at the right level or in a counter, and the states a component is in (attached routers, authenticated peers, listed peer routers, leased addresses) are gauges. A silent
continue, a swallowed error or a condition that short-circuits a decision without a trace is a defect even when the behavior is correct. When a failure in a test or on a testnet cannot be explained from the logs and metrics the binaries already emit, the fix includes the missing instrumentation, so that the next occurrence can be read from the data instead of reproduced. - Simple UX: Maintain a very simple User Experience. Configuration, CLI usage, and error messages must be intuitive, minimal, and explicitly clear.
2. Dependency Management (Strict Constraint)
- You are forbidden from suggesting any code that requires a new entry in
go.modunless you explicitly ask for my permission first. - If a task can be solved using the existing dependencies or the Go standard library, you must choose that path even if it requires more lines of code.
3. Testing Best Practices
Enforce strict modularity in testing. The repository uses a defined testing pyramid (Unit, Integration, and E2E via Bats). You must adhere to the following testing philosophy:
- Optimize for Test Speed: E2E tests are slow and strictly based on existing Critical User Journeys (CUJs).
- Push Coverage Down: If test coverage for a specific edge case or feature can be added at a lower level (Unit or Integration), it is strictly preferred over E2E for speed.
- No Redundancy: Do not replicate a test in the slower E2E path if it is already sufficiently covered in the Integration path.
- Test Domains:
- Unit Tests: Focus on isolated, internal functions.
- Integration Tests (
tests/integration/): Verify module interactions and API compliance in Go and those are time bounded, no more than 10 seconds per execution. - E2E Tests (
tests/e2e/*.bats): Use Bats (Bash Automated Testing System) exclusively for high-level, black-box testing of core CUJs.
- Idiomatic Go, no test frameworks: Go tests use the standard
testingpackage and nothing else:t.Runfor cases, table-driven tests,t.Fatalf/t.Errorfwith a message that states what was got and what was wanted,t.Cleanupfor teardown,t.TempDirfor files,httptestandnet.Listen("tcp", "127.0.0.1:0")for servers. Ginkgo, Gomega, Testify and any other assertion or matcher library are not used and must not be added, directly or through a dependency. Test code is production code: the people who write and read the implementation write and read its tests, so a test is plain Go that compiles under the same linter and reads top to bottom without a DSL to learn. A helper is justified by repetition across tests, not by making one test shorter; do not build fixture hierarchies, suite objects or matcher abstractions. A failing test must say in its own output what happened, and must not swallow an error to keep going. - A flaky test is a bug report: a test that fails once in CI and passes on a rerun has found a race or an ordering the code did not account for, and that race exists in production too, where it has no rerun. Do not retry it, widen its timeout or add a
time.Sleep. Reproduce it first: compile the test binary with the race detector and run it in parallel under load,go test -c -race -o /tmp/pkg.test ./internal/pkg && stress -p 8 -timeout 2m /tmp/pkg.test -test.run 'TestName'(golang.org/x/tools/cmd/stress), and starve it of CPU withtaskset -c 0-1when the CI runner is smaller than the workstation. Read the failure from the binaries' own output; when the logs and metrics in the failure do not explain it, that is the gap to close first, in the production code: the log line, counter or gauge for the state the test could not see. Then fix the code, make the test wait on the exported condition rather than on time, and run the stress loop again until it is clean for hundreds of runs. Tests intests/integration/reserve ports from one fixed base per process, so several processes of that suite collide on ports; run it with-p 1undertasksetand reserve-p Nfor package unit tests.
4. Code Quality & Modularity
- Ensure all new code is highly modular, prioritizing small, single-responsibility functions that are easy to unit test.
- Respect the existing repository structure (
cmd/,api/,internal/,tests/).
5. Validation
- Ensure binaries build using
make - Ensure linter passes
make lint - Ensure test passes
make test - Ensure e2e test passes
make e2e-test
6. Environments
- There are two public testnets available
hub.sam-mesh.devthat is deployed from the latest released tag andbananas.sam-mesh.devthat is deployed from themainbranch. - Their configurations can be found under
.github/k8s. - Their deployments are managed under
.github/workflows/deploy.yaml.
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.

