Skip to content

Commit b59d0ab

Browse files
committed
meta: add a root-level AGENTS.md
We're seeing a number of repeated mistakes in AI-generated contributions, including agents using `Signed-off-by`, creating what appear to be unsupervised PRs, appearing to respond to comments without human oversight, etc. Having an AGENTS.md file with specific instructions to the agent on what to avoid should help. Signed-off-by: James M Snell <jasnell@gmail.com>
1 parent 46a7dbd commit b59d0ab

4 files changed

Lines changed: 67 additions & 4 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ install_manifest.txt
163163

164164
# === Rules for AI assistants ===
165165
CLAUDE.md
166-
AGENTS.md
167166

168167
# === Global Rules ===
169168
# Keep last to avoid being excluded

AGENTS.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Agents and Automated Tools
2+
3+
This document outlines rules and requirements for AI automation agents and automated
4+
tooling that interact with the Node.js project.
5+
6+
Existing Node.js collaborators (as listed in the README.md) may use AI agents to
7+
contribute but must do so responsibly.
8+
9+
New Node.js contributors should avoid using AI agents to interact with the project.
10+
11+
## Code Contributions
12+
13+
* **No unreviewed automation**: Automated pull requests must not be created without
14+
ongoing human oversight. The pull request must be actively maintained by a human
15+
contributor who responds to feedback. The AI agent is not permitted to create pull
16+
requests, open issues, post comments, respond to reviews, or push commits without
17+
ongoing human oversight.
18+
19+
* **Commit responsibility**: Commits created with agent assistance must follow all
20+
Node.js [commit message guidelines](./doc/contributing/pull-requests.md#commit-message-guidelines).
21+
The human contributor opening the PR takes full responsibility for the changes.
22+
23+
* **Testing and verification**: All changes must pass the Node.js continuous integration.
24+
Human judgment must verify that existing tests are not removed or modified inappropriately,
25+
and that new tests correctly validate the intended behavior.
26+
27+
### Requirements
28+
29+
* All commits must be signed off by the human user using `Signed-off-by: <your name> (<your email>)`
30+
as an attestation to the [Developer Certificate of Origin](https://developercertificate.org/).
31+
* AI-assistance must be acknowledged using the `Assisted-by: <agent name>` annotation.
32+
* AI-authored code contributions must be compatible with the project's licensing and
33+
contribution guidelines.
34+
35+
## Prohibited Activities
36+
37+
AI agents **must not**:
38+
39+
* Push to any branch or tag in nodejs/node
40+
* Create unsupervised pull requests or issues without active human engagement
41+
* Make claims about code without human verification against actual source code
42+
* Remove or modify existing tests without human judgment
43+
* Interact with the repository through means other than those explicitly authorized
44+
* Use commit messages to promote for-profit AI tools or commercial brands. A single
45+
`Assisted-by: <agent-name>` annotation is required disclosure, not promotion, and is
46+
permitted.
47+
* Post AI-generated messages directly into pull requests, issues, or project communication
48+
channels without direct human review and editing to ensure clarity, accuracy, and respect
49+
for collaborator time
50+
* Sign off commits using `Signed-off-by: <agent name>` or `Co-authored-by: <agent name>`
51+
52+
## Violations
53+
54+
Automated interactions that violate these rules may result in:
55+
56+
* Immediate closure of pull requests without review
57+
* Blocking of the automation tool from further interaction with the project
58+
* Blocking of the tool's account or its owner from contributing
59+
* Reports to relevant platforms or organizations operating the automation
60+
61+
***
62+
63+
For more information on AI use in general contributions (not specific to agents),
64+
see [AI use policy and guidelines](./doc/contributing/ai-guidelines.md).

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ ifneq ($(SKIP_SHARED_DEPS), 1)
12881288
cp doc/node.1 $(TARNAME)/doc/node.1
12891289
cp -r out/doc/api/* $(TARNAME)/doc/api/
12901290
endif
1291-
sed 's/fileset = fileset.intersection (fileset.gitTracked root)/fileset =/' tools/nix/v8.nix > $(TARNAME)/tools/nix/v8.nix
1291+
sed 's/fileset = fileset.intersection (fileset.gitTracked root)/fileset =/' tools/nix/v8.nix > $(TARNAME)/tools/nix/v8.nix
12921292
$(RM) -r $(TARNAME)/.editorconfig
12931293
$(RM) -r $(TARNAME)/.git*
12941294
$(RM) -r $(TARNAME)/.mailmap
@@ -1480,7 +1480,7 @@ else
14801480
LINT_MD_NEWER = -newer tools/.mdlintstamp
14811481
endif
14821482

1483-
LINT_MD_TARGETS = doc src lib benchmark test tools/doc tools/icu $(filter-out CLAUDE.md AGENTS.md,$(wildcard *.md))
1483+
LINT_MD_TARGETS = doc src lib benchmark test tools/doc tools/icu $(filter-out CLAUDE.md,$(wildcard *.md))
14841484
LINT_MD_FILES = $(shell $(FIND) $(LINT_MD_TARGETS) -type f \
14851485
! -path '*node_modules*' ! -path 'test/fixtures/*' -name '*.md' \
14861486
$(LINT_MD_NEWER))

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ export default [
401401
// #region markdown config
402402
{
403403
files: ['**/*.md'],
404-
ignores: ['CLAUDE.md', 'AGENTS.md'],
404+
ignores: ['CLAUDE.md'],
405405
plugins: {
406406
markdown,
407407
},

0 commit comments

Comments
 (0)