[PATCH 4/4] agents: add legal requirements and agent attribution guidelines

Sasha Levin
2025-07-27T19:58:24Z

And below is the first test of this scheme:

Co-developed-by: Claude claude-opus-4-20250514
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/agents/index.rst | 3 ++-
Documentation/agents/legal.rst | 42 ++++++++++++++++++++++++++++++++++
Documentation/agents/main.rst | 5 ++++
3 files changed, 49 insertions(+), 1 deletion(-)
create mode 100644 Documentation/agents/legal.rst

diff --git a/Documentation/agents/index.rst b/Documentation/agents/index.rst
index 354af3f025e5..982602db3349 100644
--- a/Documentation/agents/index.rst
+++ b/Documentation/agents/index.rst
@@ -9,4 +9,5 @@ Agents

main
core
- coding-style
\ No newline at end of file
+ coding-style
+ legal
\ No newline at end of file
diff --git a/Documentation/agents/legal.rst b/Documentation/agents/legal.rst
new file mode 100644
index 000000000000..67e6b2cdff9d
--- /dev/null
+++ b/Documentation/agents/legal.rst
@@ -0,0 +1,42 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+===============================
+Legal Requirements for Agents
+===============================
+
+This document outlines critical legal requirements that coding agents must follow when working with the Linux kernel codebase.
+
+Licensing Requirements
+----------------------
+
+**GPL-2.0 License**
+ The Linux kernel is licensed under GPL-2.0 only with a syscall exception. Coding agents MUST follow this licensing rule with no exceptions. Any code contributed must be compatible with this license.
+
+**SPDX License Identifiers**
+ All files must have proper SPDX license identifiers. For most kernel source files, this should be the first line of the file in the appropriate comment format:
+
+ - For C source/header files: ``// SPDX-License-Identifier: GPL-2.0``
+ - For scripts: ``# SPDX-License-Identifier: GPL-2.0``
+ - For documentation: ``.. SPDX-License-Identifier: GPL-2.0``
+
+Signed-off-by Restriction
+-------------------------
+
+Coding assistants **MUST NOT** add a ``Signed-off-by`` tag pointing to themselves. The ``Signed-off-by`` tag represents a legal certification by a human developer that they have the right to submit the code under the open source license.
+
+Only the human user running the coding assistant should add their ``Signed-off-by`` tag to commits. The agent's contribution is acknowledged through the ``Co-developed-by`` tag as described below.
+
+Agent Attribution Requirement
+-----------------------------
+
+When creating commits, coding agents **MUST** identify themselves by including the following tag in the commit message::
+
+ Co-developed-by: $AGENT_NAME $AGENT_MODEL $AGENT_VERSION
+
+Examples:
+
+- ``Co-developed-by: Claude claude-3-opus-20240229``
+- ``Co-developed-by: GitHub-Copilot GPT-4 v1.0.0``
+- ``Co-developed-by: Cursor gpt-4-turbo-2024-04-09``
+
+This transparency helps maintainers and reviewers understand that a coding agent was involved in the development process.
diff --git a/Documentation/agents/main.rst b/Documentation/agents/main.rst
index 8e0463794b76..9ef75978a2e6 100644
--- a/Documentation/agents/main.rst
+++ b/Documentation/agents/main.rst
@@ -15,3 +15,8 @@ Coding Style
------------

For coding style guidelines and rules, see :doc:`coding-style`
+
+Legal Requirements
+------------------
+
+For licensing, attribution, and legal requirements, see :doc:`legal`
--
2.39.5