semantic-conventions-genai / reference
AGENTS.md528 starsChanged 41 days agoApache-2.0View on GitHub
1. Decide what the library supports — run the litmus tests below to figure out which operations (spans, metrics, events) a library can legitimately emit. 2. Implement them in a reference scenario — emit only those operations, then regenerate the data and reports. For per-scenario authoring rules, see ../.github/skills/reference/SKILL.md. A scenario emits telemetry only for operations the library itself performs. If library A delegates an operation to another (also instrumentable) library B, do not instrument that call in library A…
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,774 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 repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- pr-descriptionSkill
- referenceSkill
- unslopSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Fact-check against the library's real API reference: Do not guess what a library does or doesn't support from its name or reputation.
- Distinctive: line 27
Run each litmus test to decide which operations apply.
- Very specific: line 31
Before emitting an inference (chat) or embeddings span — or an inference-operation-details event — ask:
≈ “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
Authoring reference scenarios
Two steps:
- Decide what the library supports — run the litmus tests below to figure out which operations (spans, metrics, events) a library can legitimately emit.
- Implement them in a reference scenario — emit only those operations, then regenerate the data and reports.
For per-scenario authoring rules, see ../.github/skills/reference/SKILL.md.
Step 1 — Decide what the library supports
A scenario emits telemetry only for operations the library itself performs. If library A delegates an operation to another (also instrumentable) library B, do not instrument that call in library A — it belongs to B.
Fact-check against the library's real API reference. Do not guess what a
library does or doesn't support from its name or reputation. Before deciding an
operation is in or out of scope, confirm it against the library's official API
docs — many SDKs cover more than their obvious use case (e.g. openai has
retrieval via vector stores / file search and conversation state, not just
inference). Describe each operation in terms of the concrete API that backs it.
Run each litmus test to decide which operations apply.
Model call (inference / embeddings)
Before emitting an inference (chat) or embeddings span — or an
inference-operation-details event — ask:
Does this library delegate the actual model call to another instrumentable library (e.g.
openai,litellm,google-genai)?
- Yes → do not emit inference or embeddings (span or event). It belongs
to the underlying LLM library. Emit only framework-owned operations
(
invoke_agent,invoke_workflow,plan,execute_tool,retrieval). - No (the library is itself the model-call boundary — it calls the model directly, or owns it across a process boundary no in-process instrumentable library can observe) → emit it, and correlate via standard context propagation.
Tool execution
Does the library execute the tool itself — i.e. does it provide a tool-execution helper (automatic function calling, an agent/tool runner) that invokes the tool and feeds the result back?
- Yes (e.g.
google-genai/vertexaiautomatic function calling, agent frameworks that run tools) →execute_toolis instrumentable here; emit it. - No (the client only returns tool calls and the tool runs in application
code the library never sees) →
execute_toolis not instrumentable by this library. Do not emit it from a model-client scenario; a span around the app's own function is not something generic instrumentation of the client could produce.
Client invoke / create agent
Does this library create and invoke remote AI agents (e.g. AWS Bedrock Agent or OpenAI Assistants)?
- Yes → emit client spans for create and invoke agent operations.
- No → do not emit client agent spans. If the library implements agentic or other AI scenarios, check the internal invoke agent or workflow tests instead.
Internal invoke agent
Does the library have a concept of an AI agent?
- Yes → emit an internal invoke agent span only for scenarios that use the library's agent API.
- No (no formal agent concept, or the AI scenario doesn't involve agents) → check the workflow test instead.
Workflow
Does the library have a concept of an AI workflow or graph — an operation that combines arbitrary AI-related operations such as agent invocations, chained LLM calls, and other auxiliary operations?
- Yes → emit a workflow span around the library API that invokes the workflow.
- No → don't emit a workflow span. A single agent run or a plain chain of calls is not an AI workflow.
Step 2 — Implement in a reference scenario
Emit only the operations the litmus tests identified as supported, then regenerate the data and reports:
uv run run-scenario <library> # regenerate scenarios/<library>/data.json
uv run update-reports # refresh README status tablesDoes 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.

