sam AGENTS.md

Repository guidelines for SAM, covering how its control plane, router, node, and sandbox components must be separated and communicate.

In plain words
What is it for?
Use them when designing, changing, testing, or reviewing SAM architecture, API communication, sandbox networking, and dependencies.
Why use it?
They prevent tightly coupled components, unsafe sandbox assumptions, and dependencies on private parts of the system.

Instructions file for CodexOpenCode

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 instructions/google/sam/agents-md
Clone the repo
git clone --depth 1 https://github.com/google/sam

Made for: Codex, OpenCode.

Per session 1,044 This file is loaded in full into every session.
When invoked 1,044 The same file — it is already loaded in full.
Security scan A 0 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.01044 $0.01044
Opus 5 $0.00522 $0.00522
Sonnet 5 $0.00209 $0.00209
Haiku 4.5 $0.00104 $0.00104

Measured yesterday against content hash eb496331849c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sam AGENTS.md scanned grade A with 0 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 45 lines

How it starts

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

SAM Repository AI Agent Guidelines

You are an expert software engineering assistant helping to develop, maintain, and test the SAM repository.

1. Architecture & Component Independence

  • Decoupled Architecture: The sam-control-plane, sam-router and sam-node components are strictly independent. They must not share internal state or tightly couple their logic.
  • API Communication: All data communication between sam-control-plane, sam-router and sam-node must happen exclusively via the common API defined in api/sam.proto.
  • Sandbox Dataplane: sam-box (one per sandbox) is the single egress policy enforcement point. It holds no libp2p host, no enrollment and no mesh identity, and reaches the mesh exclusively as a client of the local sam-node sidecar socket. nano-init (PID 1 inside the guest, its own Go module) owns the guest side. The sandbox boundary is a Unix socket: SOCKS5 out, CONNECT <port> back in. The authoritative design is site/content/docs/agent-architecture.md; do not contradict it.
  • Enforcement over Convention: never gate sandbox traffic on the agent's cooperation — no proxy environment variables, no LD_PRELOAD shims, no DNS spoofing. The agent harness stays unmodified and mesh-unaware; confinement is a route and a socket, built by the userspace launcher (nano-init) and judged in sam-box. An agent that must cooperate with its own confinement is not confined.
  • Policy on Names: egress policy, secret injection and routing decisions are made on the destination name, never on an IP. Deny by default.
  • Agent Identity: the agent is the principal; the node is only the channel. Agent identity comes from the platform's workload credential, verified at admission — never asserted in-band from inside the sandbox. Platforms integrate solely through the connector interface (Attach/Detach/Refresh/Status and the agent bundle), not by reaching into SAM internals.
  • 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.
  • Simple UX: Maintain a very simple User Experience. Configuration, CLI usage, and error messages must be intuitive, minimal, and explicitly clear.

Read the full file on GitHub · 45 lines

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. yesterday First seen · 45 lines · 1,044 tokens per session scan A eb496331849c

Subscribe to this mod's changes

sam AGENTS.md is an instructions file published in the GitHub repository google/sam (796 stars, last pushed 3d ago), licensed Apache-2.0. It adds 1,044 tokens to every session, about $0.0052 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.