agentops-open-course
AGENTS.md2 starsChanged 4 months agoMITView on GitHub
Guidance for coding agents working in the AgentOps Open Course. Humans should start with README.md. This repository dogfoods the AGENTS.md convention taught in Chapter 1. The course teaches the complete lifecycle of one AgentOps Agent with Google ADK, agentgateway, kagent, MLflow, and OpenTelemetry. The completed executable reference accompanies cumulative learner-owned Python exercises; it must not drift into a collection of illustrative snippets. Chapter 8.7 turns that reference into a capstone contract for a learner-owned domain.
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repository8 other files it gives its agents.
- agent-evaluationSkill
- agent-guardrailsSkill
- agent-incident-responseSkill
- agent-least-privilegeSkill
- agentops-courseSkill
- agentops-telemetrySkill
- agent-resilienceSkill
- agent-token-budgetSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
13 rules. About 1 is common, 8 are distinctive, and 4 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 31
Audit is append-only, not immutable: Every row carries its audit schema version.
- Distinctive: line 53
Use the repository files and locks as version authority — never a number copied into prose.
- Very specific: line 71
Add repository Python: add the tracked path to scripts/repository-python-files.txt.
- Very specific: line 72
Add a network port: update this file's inventory, PORT_CONTRACT in scripts/check_conventions.py, the executable owner, and the table in …
- Distinctive: line 73
Add a course page: start from the required FAQ frame, add it to the chapter index and navigation, preserve the closing proof contract, then …
- Distinctive: line 74
Bump a coordinated pin: update the authority named above, regenerate its lock or digest evidence, search for checked compatibility copies, …
- Distinctive: line 135
Do not start host Compose observability while the in-cluster stack is forwarded on the same ports.
- Very specific: line 141
Every course page follows this frame, enforced by mise run check:docs:
- Distinctive: line 178
Keep prose practical and question-led.
- Very specific: line 179
Use only 1. for ordered Markdown list items.
- Common: line 181
Never add machine-specific paths, credentials, floating image tags, stale registry names, or commands that depend on private dotfiles.
- Distinctive: line 183
Do not claim alerts, feedback endpoints, online scorers, public auth/TLS, HA, backups, or cost metrics unless the repository implements and …
- Distinctive: line 185
Update README.md, public component READMEs, course prose, and this file together when a public contract changes.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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
AGENTS.md
Guidance for coding agents working in the AgentOps Open Course. Humans should start with README.md. This repository dogfoods the AGENTS.md convention taught in Chapter 1.
Repository purpose
The course teaches the complete lifecycle of one AgentOps Agent with Google ADK, agentgateway, kagent, MLflow, and OpenTelemetry. The completed executable reference accompanies cumulative learner-owned Python exercises; it must not drift into a collection of illustrative snippets. Chapter 8.7 turns that reference into a capstone contract for a learner-owned domain.
docs/contains FAQ-based course pages published by Zensical.agents/python/is the locked Python reference agent, offline tests, and model-backed evaluations.agents/data/is immutable seed input: SQLite, logs, runbooks, and the agent's runtime Agent Skills.skills/holds portable Agent Skills (npx skills add …), validated bymise run check:skills; runtime skills live separately underagents/data/skills.clients/web/is a minimal, offline, dependency-free A2A web client for the AgentOps Agent.load/holds k6 load tests and the documented latency budgets for the platform.infra/agentgateway/{host,k3d,gke}/contains the three data-plane profiles.infra/k8s/baseplusinfra/k8s/overlays/{local,local-gemini,gke}contains the shared Kubernetes deployment.infra/kagent/declares the BYO Agent, gateway ModelConfig, and governed RemoteMCPServer.infra/mlflow/builds the locked non-root MLflow server.infra/observability/contains host Compose and in-cluster OTel/Prometheus/Grafana resources.infra/gcp/is a plan-first OpenTofu module for the optional GKE lab.
Course invariants
- Docs mirror source. Critical Python excerpts use checked
pymdownx.snippetsregions fromagents/python; commands/manifests matchinfra. Prefer a short exact excerpt plus a source link over a second pseudo-implementation. - Every course page is an FAQ. It starts with YAML
descriptionfront matter, contains at least one H2, and every H2 ends in?.scripts/check_conventions.pyenforces this and the page frame below. - Seed and state stay separate.
agents/data/incidents.dbis never mutated. Host writes go toagents/python/.state; Kubernetes agent/MCP processes shareagentops-agent-stateso reads remain coherent with approved writes. Only the A2A startup and direct write boundary may prepare or migrate runtime state; probes and read tools stay read-only. - Restore is crash-recoverable, not an instantaneous multi-file rename. Stop every writer first.
agent.stateserializes backup/restore with a process lock and fsyncs a three-phase journal; A2A startup recovers an interrupted transaction before schema preflight or publication. Never bypass that boundary with direct file copies or delete unexplained.restore-*evidence. - Reads and writes have different authority. The conversational entrypoint alone switches its six read/runbook tools from direct local calls to MCP through
AGENT_MCP_URL; workflow and coordinator specialists always bind local tools. The MCP toolset passestool_filter=MCP_READ_TOOL_NAMES(mcp_client.py), so a server cannot widen the surface by advertising more tools.restart_serviceandresolve_incidentremain in-process, require ADK confirmation, validate targets, and append audit evidence in the same transaction. Replays with the same invocation, action, and target return the original audit row without mutating state again. - Policy is attached once, at the app boundary.
AgentOpsPolicyPluginingovernance.pyis registered on theAppexported bycomposition.pyandsrc/agent/__init__.py. ADK discovery prefersappoverroot_agent. Hooks cover every agent and workflow node; never add per-agent callback lists. Before-model order is budget → compaction → redaction; the first non-Nonereturn short-circuits. ADK's stock evaluator appends its plugins after theApppolicy (a bare agent before ADK 2.10): useevals/governed_adk_eval.pyfor ADK evals, which keeps evaluator evidence first and the policy exactly once, andInMemoryRunner(app=build_app(...))for MLflow. - Skills and retrieved data have different trust. The carve-out is keyed on the ADK
LoadSkillTooltype, which only the locally builtskill_toolset()constructs — not on the tool's name, which any MCP server could claim. That result is reviewed repository instruction, so it bypasses injection neutralization and spotlighting while retaining recursive PII/credential redaction. Every other tool result stays data-hardened by default. - Audit is append-only, not immutable. Every row carries its audit schema version. SQLite triggers block row update/delete through the schema; administrators can still alter the file/schema. Do not overclaim.
- Telemetry content stays private by default. Both ADK/GenAI content-capture variables default to literal
false. PII callbacks cover outbound model requests, inbound model responses, and tool output, but raw session ingestion occurs earlier. - No LiteLLM or garak contract. Runtime/evaluation uses ADK's OpenAI-compatible client for Ollama/agentgateway or native Gemini by default.
mise run redteamis deterministic offline adversarial regression, not live-model penetration testing. - Planning is bounded.
root_agentplans only multi-step investigations and verifies approved actions afterward.triage_workflowis the runnable, read-only plan → investigate → evidence review → recommend path; do not replace it with an unbounded reflection loop. - Cost-efficient by default. Prefer deterministic offline tests and fakes, the smallest model that can validate the behavior, and single-replica resource-bounded local services. Measure before increasing model size, context, RAM, CPU, storage, replicas, or load-test concurrency. Do not start a cluster, observability stack, model server, paid API, or cloud resource unless it materially validates the current boundary; stop temporary processes and tear down disposable resources when the check is complete.
Open-source boundary
The course is free and openly licensed: CC BY 4.0 text and MIT repository software. Its application/platform stack is OSS. The default Gemini API is a proprietary hosted service requiring an account, API key, and available quota. Free-tier access is conditional; never promise universal zero-cost inference. Ollama with Apache-2.0 open-weight Qwen3 is the optional local alternative. Offline exercise checks and recorded-answer calibration need neither model access nor provider credentials.
Part I (Chapters 1–4) assumes working Python knowledge, including venv and pip; link to preparation resources instead of teaching Python fundamentals. Part II (Chapters 5–7) assumes containers and Kubernetes and must be advertised as more demanding. ADK is the main framework; the LangGraph/A2A comparison is optional. agentgateway and kagent are central to Part II.
AGENT_MODEL_PROVIDER=gemini and AGENT_MODEL=gemini-3.5-flash are the laptop defaults. .env.example owns the onboarding configuration. install:learner installs only uv and the locked runtime. The cumulative lab command preserves work under root learning/; it must never overwrite existing steps or let runtime-state reset delete learner work. The complete reference remains the platform handoff.
The main host task selects infra/agentgateway/host/config-gemini.yaml. platform:dev selects local-gemini, with the real provider key mounted only into agentgateway from gemini-provider. The original config.yaml and local overlay remain the explicit Ollama/fake profiles, including offline platform CI. Use gateway:host:ollama and platform:dev:ollama for that alternative. Native Gemini → gateway is a transport change requiring new model evidence, not merely a URL substitution.
The optional GKE path compatibility-pins gemini-3.5-flash. Do not move that pin because a newer model exists: the pinned agentgateway release's Vertex conversion adds a blank text part beside a function response, which Gemini 3.6 rejects. A replacement model and stable gateway pair is supported only after mise run gke:smoke completes both its synthetic tool-result turn and its stable-seed, read-only A2A retrieval.
Pinned contracts
SUPPORT.md defines which surfaces are stable, plus compatibility, deprecation, supported platforms, upgrade, rollback, and explicit non-goals. Course prose is deliberately not frozen; the software contracts are.
Use the repository files and locks as version authority — never a number copied into prose. The authoritative pin for each component lives in:
- Google ADK, MLflow, and every Python dependency:
agents/python/pyproject.tomlfor the range,uv.lockfor the exact resolution. The MLflow server image has its owninfra/mlflow/pyproject.toml. - Zensical and the documentation toolchain: root
pyproject.tomlanduv.lock. - CLI tools (agentgateway, k3d, kubectl, helm, helmfile, skaffold, k6, gcloud, …):
mise.toml[tools], with checksums and provenance inmise.lock. - Workflow-only Docker Buildx: the explicit
versioninputs in.github/workflows/release.yml. - kagent Helm charts:
infra/helmfile.yaml. API resources arev1alpha2. - Container images (agentgateway, OpenTelemetry Collector, Loki, Prometheus, …): digest-pinned at their use site under
infra/k8s/andinfra/observability/. - Python interpreter:
.python-version.
GitHub Actions artifacts are transient handoffs. The organization caps artifact and log retention at 7 days, so every upload-artifact step stays at or below that limit; durable release evidence belongs on the immutable GitHub release and in OCI attestations.
This file owns the stable network inventory, while scripts/check_conventions.py maps every entry to its executable owner: MCP :3000, A2A :3001, OpenAI-compatible model :4000, gateway metrics :15020, host gateway readiness :15021, raw MCP :8000, raw A2A :8080, web client :8001, ADK web UI :8002, documentation preview :8003, Ollama :11434, MLflow :5000, OTLP :4317/:4318, collector metrics :8889, pod-local collector health :13133, Prometheus :9090, Alertmanager :9093, host Grafana :3002, Loki :3100, and the local registry :5050.
Maintainer recipes
Release evidence is commit-scoped. Freeze main, dispatch Eval and Platform at the candidate SHA, then dispatch Release with that same SHA and the fresh handoffs. An eval_evidence=waiver:<reason> dispatch is a recorded one-release exception published on the release, never a default. Any push creates a new candidate and restarts the evidence sequence; never combine evidence from different commits.
- Add repository Python: add the tracked path to
scripts/repository-python-files.txt;mise run check:pythonrejects both unlisted and stale entries. - Add a network port: update this file's inventory,
PORT_CONTRACTinscripts/check_conventions.py, the executable owner, and the table indocs/0. Overview/0.3. Ecosystem.md. - Add a course page: start from the required FAQ frame, add it to the chapter index and navigation, preserve the closing proof contract, then run the docs and accessibility gates.
- Bump a coordinated pin: update the authority named above, regenerate its lock or digest evidence, search for checked compatibility copies, and run every affected offline profile before changing prose.
Development commands
Common root tasks (discover the complete list with mise tasks):
mise run install
mise run install:platform
mise run install:gcp
mise run install:maintainer
mise run doctor
mise run format
mise run check:core
mise run check
mise run test
mise run scan
mise run build
mise run build:docs
mise run serve
mise run gateway:host
mise run smoke:host
mise run platform:dev
mise run promote
mise run gke:smokemise run install:learner bootstraps the learner runtime; mise run install installs contributor tools and environments. The platform and maintainer tiers are explicit so a first learner checkout does not install Kubernetes, cloud, and maintainer tooling it does not yet need.
Aggregate tasks run their children: install, format, check, and build each fan out, so mise run build builds the site and both container images and therefore needs Docker. Use mise run build:docs for the container-free documentation build. install:core, doctor:base, watch, and scan are aliases of install, doctor, serve, and secure; install:tools:* are hidden implementation details.
Agent tasks from agents/python/:
mise run check
mise run test
mise run redteam
mise run mcp
mise run mcp:http
mise run a2a
mise run data:reset
mise run workflow
mise run coordinatorAGENT_ENTRYPOINT=agent|workflow|coordinator selects the composition behind the single lazy src/agent package boundary. Use the task aliases above rather than raw adk run commands so model configuration and the repository .env are loaded consistently.
The eval:* tasks (eval, eval:workflow, eval:report, eval:mlflow, eval:cost, eval:ground, eval:ab, eval:retrieval) call a configured model and stay outside the offline test gate — they are scheduled evidence in eval.yml, not CI gates. eval:validate is the only offline eval and runs in CI. The MLflow judge is optional and must use the configured agentgateway URL.
Local and cloud safety
The main host gateway is infra/agentgateway/host/config-gemini.yaml; config.yaml is the optional Ollama/fake profile. Host quickstarts use the digest-pinned container wrapper exposed by the gateway:host* tasks; every published listener binds to 127.0.0.1. On native Linux, the wrapper owns a bridge-address-only relay so its container can reach MCP, A2A, and Ollama while those upstream processes remain bound to host loopback. The raw agentgateway binary currently listens on all interfaces and is an advanced/manual path, not a learner quickstart.
Kubernetes begins in Chapter 6. Local Kubernetes is created only from infra/k3d.yaml, uses registry.localhost:5050, and is deployed from the repository root with:
mise run platform:devThat task derives AGENT_SOURCE_COMMIT from HEAD; raw Skaffold commands must provide the same exact-source value because infra/skaffold.yaml refuses an untraceable image build.
Do not start host Compose observability while the in-cluster stack is forwarded on the same ports. No profile creates an Ingress, LoadBalancer, or public application endpoint; clients use temporary port-forwards through agentgateway.
The GKE path stops at tofu plan unless the user explicitly approves deployment. The required project_id variable selects the project; the rendered GKE bundle derives its Workload Identity accounts, GCS bucket, DNS service IP, and Vertex project from OpenTofu outputs. The single zonal Spot-node design is production-shaped but interruptible and non-HA. It bills real money: docs/7. Observability/7.3. Costs.md owns the estimate and the date it was checked. Do not copy that figure anywhere else, and refresh variable prices before apply. skaffold delete, PVC deletion, k3d cluster delete, tofu apply, and tofu destroy require careful context/review; cloud apply/destroy requires explicit approval.
Documentation workflow
Every course page follows this frame, enforced by mise run check:docs:
---
description: <one sentence>
---
# N.M. Title
!!! abstract "In one glance"
- **You will:** <outcome, verb first, second person, plain words>
- **You need:** <a checkable precondition, or "Nothing beyond a terminal">
- **Time:** about <N> minutes, <concept | hands-on | reference | orientation>.
## <question ending in ?>
…
## What proves this page worked?
<the verification commands>
**You are done when:**
- <observable state>
Continue to [<next page>](link) when <the condition that matters>.- The closing H2 is exactly
What proves this page worked?, orWhat proves this chapter worked?on adocs/*/index.md, orHow should you use this page later?on a pure lookup page (0.5, 0.6, 0.7). Nothing links to those anchors, so the wording stays uniform on purpose. - Depth that is valuable but not needed on a first pass goes in a
??? note "Deeper: …"collapsible, relocated word for word. Every summary starts withDeeper:. Zero to three per page. - Never collapse the subject's definition, the reason it matters, the command to run, the expected output, or anything that costs money, destroys data, or bounds a security claim. The arithmetic behind a cost may be collapsed; the sentence saying "this can be billed" or "this is not production" stays visible above the triangle.
- On a hands-on page the learner must reach a runnable command within the first two H2 sections.
docs/2. Agents/2.1. First Agent.mdis the reference for that shape. - Admonition vocabulary is fixed:
abstractfor the page frame,successfor end-of-page takeaways,warningfor common mistakes,dangerfor destructive/costly/security actions,tipfor an optional shortcut,infofor skippable background,notefor a neutral aside. The same message must use the same type everywhere it appears. - Prose rules: open each H2 with a concrete sentence of 25 words or fewer; keep sentences under ~35 words and at most one em-dash pair per paragraph; cap inline cross-links at two per paragraph and push the rest to a closing "Owned by …" line; define an unfamiliar term at first use in 15 words or fewer; use full page names as link labels, never a bare
[5.2]. - Accessibility is content, not decoration: adjacent
**Diagram in words:**prose must communicate every new or changed Mermaid diagram's actors, relationships, and sequence; never rely on color alone; link dense unfamiliar terms to glossary anchors.ACCESSIBILITY.mdis the public contract;docs/diagram-legacy.txtis an exact-hash ratchet for previously reviewed diagrams, not permission for new exemptions. - Keep prose practical and question-led; finish technical pages with verification and, where relevant, teardown.
- Use only
1.for ordered Markdown list items. - A
--8<--snippet include must sit inside a fenced code block. A bare include is rendered as Markdown, so a leading#comment in the region becomes an<h1>. - Never add machine-specific paths, credentials, floating image tags, stale registry names, or commands that depend on private dotfiles.
- Distinguish offline tests, local model calls, hosted model calls, Kubernetes changes, and cloud changes before asking a learner to run anything.
- Do not claim alerts, feedback endpoints, online scorers, public auth/TLS, HA, backups, or cost metrics unless the repository implements and validates them.
- The public course is hosted at
https://agentops-open-course.fmind.dev/. When changing repository, Pages, DNS, or source-link contracts, re-run the anonymous publication gate before claiming the surface still works. - Update
README.md, public component READMEs, course prose, and this file together when a public contract changes.
Definition of done
Re-read the original request, inspect the final diff, and run:
mise run install:maintainer
mise run format
mise run check
mise run test
mise run scanThe Python suite enforces at least 95% combined line-and-branch coverage. The complete gate renders all three overlays and scans the repository; no model, cluster, or cloud call is part of it. Never suppress a real failure to force green. Do not call a live model, deploy Kubernetes/cloud resources, or commit unless the user explicitly asks.
On constrained machines, set MISE_JOBS=1, use disk-backed TMPDIR, and run gates sequentially. Dependency audits and scanner databases need network access; infrastructure rendering starts no services.
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.

