Skip to content

Add AGENTS.md guidance for AI coding agents - #13980

Merged
samuelkarp merged 2 commits into
containerd:mainfrom
chrishenzie:agents-md
Sep 17, 2026
Merged

samuelkarp merged 2 commits into
containerd:mainfrom
chrishenzie:agents-md

Conversation

@chrishenzie

@chrishenzie chrishenzie commented Aug 18, 2026 •

Copy link
Copy Markdown
Member

Add AGENTS.md as an entry point to containerd’s docs. Each pointer identifies when an agent should read the linked material. CLAUDE.md is a symlink to the same guidance.

For context, I started with Claude Code's /init command, then revised the draft using the /writing-for-agents skill to trim it down. The structure uses progressive disclosure: task-specific details stay in the existing docs, with explicit conditions for reading them. For example, public API changes direct the agent to the compatibility policy in RELEASES.md. This keeps the always-loaded guidance small and makes the relevant context easier to find.

Before security scans or vulnerability assessments, agents must read the published threat model, triage guide, and operator baseline. Suspected non-public vulnerabilities are raised privately.

The supporting docs adds PR expectations, explains tests that require root, and points CRI tests to their dependency setup instructions.

Assisted-by: Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an AGENTS.md guide to onboard AI coding agents to the containerd repository, including how to build/lint/test, how the project is structured, and how to handle/triage security findings against the published threat model and operator baseline.

Changes:

  • Introduces a new AGENTS.md with build, lint, and test workflow guidance.
  • Summarizes key architecture concepts (modules, plugin system, runtime/CRI integration) to help agents navigate the codebase.
  • Establishes security-reporting guidance aligned with docs/security/* (threat model, triage guide, operator guidelines) and emphasizes private disclosure of suspected vulnerabilities.
Suppressed comments (1)

AGENTS.md:22

  • -race is not enabled by default here: TESTFLAGS_RACE is empty in the Makefile unless the caller sets it. As written, this will send readers looking for a non-existent default behavior.
Run `make clean-test` only on a dedicated test host: it sends SIGKILL to every `containerd` and `runc` process, unmounts matching debris, and removes runtime state. `-race` is on by default for amd64 (`TESTFLAGS_RACE`).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread AGENTS.md Outdated
Copilot AI review requested due to automatic review settings August 18, 2026 22:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (2)

AGENTS.md:63

  • This sentence says all new files need the Apache license header, but existing Markdown docs in this repo (e.g., BUILDING.md, README.md) do not have that header. To avoid misleading guidance, please narrow this to "new source files" (or otherwise scope it) rather than implying it applies to documentation files too.
- The org-wide [containerd/project CONTRIBUTING.md](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) applies to all containerd repos: coordinate with maintainers before large or high-impact PRs, commit messages tell the story of the change, and a squashed series gets its message rewritten as one change. New files need the "Copyright The containerd Authors" Apache license header; CI validates it (`containerd/project-checks` in ci.yml).

AGENTS.md:64

  • This bullet attributes trailer guidance ("AI tools never appear in Signed-off-by/Co-authored-by" and "Assisted-by is encouraged") to CONTRIBUTING.md, but CONTRIBUTING.md's "Automated and AI-generated contributions" section does not mention trailers. Consider removing the trailer guidance here or citing the document that actually defines that policy.
- CONTRIBUTING.md AI policy: PRs must be opened by a human (automated PR creation requires prior maintainer approval), and all AI-generated or AI-assisted content must be reviewed by its human author, who is responsible for its correctness. AI tools never appear in `Signed-off-by:` or `Co-authored-by:` trailers; an `Assisted-by:` trailer naming the tool is encouraged.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Copilot AI review requested due to automatic review settings August 21, 2026 00:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (1)

CONTRIBUTING.md:75

  • The wording here diverges from the repo’s established description of ctr. SCOPE.md describes ctr as a barebones CLI intended for development/debugging with no stability guarantees, but not as “unsupported”, and it doesn’t state that “new features target the Go client API”. Consider aligning this bullet with the existing wording to avoid overclaiming support policy.
- `cmd` - All Go main packages and the packages used only for that main package; `ctr` is an unsupported debug CLI, and new features target the Go client API

Comment thread AGENTS.md Outdated
Copilot AI review requested due to automatic review settings August 21, 2026 17:42
@chrishenzie
chrishenzie force-pushed the agents-md branch 2 times, most recently from 513995d to 0416059 Compare August 21, 2026 17:42
@kubernetes-prow kubernetes-prow Bot added size/L and removed size/M labels Aug 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread AGENTS.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 21, 2026 20:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@chrishenzie

Copy link
Copy Markdown
Member Author

Quick update -- I tested these instructions by having an agent fix an open issue and had it report back the instructions where it stumbled and needed clarifying.

  • The SCOPE.md is now specified as an allow list of features and components, not bug fixes. The agent read "not listed so out of scope" and got stuck
  • Commit trailers are stated inline, because harnesses like Claude add "Co-Authored-By" by default, so this rule can get skipped before the link is followed. Noted that "Assisted-by" is the trailer for AI. If you prefer I don't duplicate info here please let me know
  • The guidance for make check points at the instructions to install the required dependencies so agents don't try to circumvent them if deps are missing
  • Humans own not just PRs but also comments on PRs and issues
  • BUILDING.md specifies the behavior around make test silently skipping tests that require root so an agent doesn't falsely claim that all tests pass when some root tests might fail
  • Added guidance for agents to check for open PRs for issues prior to opening their own. Every issue the agent sampled already had an open PR

@samuelkarp samuelkarp moved this from Needs Triage to Needs Reviewers in Pull Request Review Sep 1, 2026
make test can succeed while skipping tests that require root. Explain
how to enable those tests and where to find CRI test prerequisites.
Add pull request expectations for documentation, testing, and CI
follow-up.

Assisted-by: Claude Code
Signed-off-by: Chris Henzie <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Only minor documentation nits were identified; no blocking issue was reported.

Review details

Suppressed comments (2)

BUILDING.md:267

  • This is broader than the repository's actual convention: several root-dependent tests use direct UID checks instead of testutil.RequiresRoot (for example plugins/content/local/store_test.go:119 and internal/cri/server/podsandbox/helpers_linux_test.go:70). Those packages are not selected by make root-test, so an agent following this wording could believe the root suite covered tests that still remain skipped. Limit the statement to tests using the helper and call out the direct-check exceptions.
A test that needs `root` calls `testutil.RequiresRoot`, which skips it unless
`-test.root` is passed. `make test` skips those tests and still succeeds, so check
whether the tests covering your change are among them. `make root-test` selects
the packages that call the helper and runs them with `-test.root`.

BUILDING.md:264

  • This description omits the companion testutil.RequiresRootM helper, which is used by integration/client/TestMain to gate an entire package on root. Please mention both helpers so agents do not assume every root-gated test calls RequiresRoot directly.
A test that needs `root` calls `testutil.RequiresRoot`, which skips it unless
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Give coding agents an entry point to the contribution, build, and
subsystem documentation. Require security findings to meet the
documented scope and evidence requirements before calling them
vulnerabilities.

Link CLAUDE.md to AGENTS.md so both filenames provide the same guidance.

Assisted-by: Claude Code
Signed-off-by: Chris Henzie <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review issues were identified.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@estesp estesp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for working on this!

@github-project-automation github-project-automation Bot moved this from Needs Reviewers to Review In Progress in Pull Request Review Sep 17, 2026
@samuelkarp
samuelkarp added this pull request to the merge queue Sep 17, 2026
Merged via the queue into containerd:main with commit 00a8ed4 Sep 17, 2026
55 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants