Repository navigation
Update AI Policy - #664
Update AI Policy#664Yaswant Pradhan (yaswant) wants to merge 7 commits into
Conversation
| indemnity or legal protection for generated code. Its use is *strictly | ||
| prohibited* for any contributions to our simulation systems. | ||
| * **Contributor Liability**: Under all circumstances, individual *contributors bear | ||
| full legal and professional responsibility* for the integrity of the code they |
There was a problem hiding this comment.
We have been challenged by a contributor on the wording "bear full [] legal responsibility". Is this backed up by guidance from the legal team or a wider corporate guidance on Gen AI ?
There was a problem hiding this comment.
Certainly in the ancillary space we've been advised in past (in a ever and rapidly evolving set of opinions and guidance) that it is the submitter's responsibility to ensure they're not violating someone else's IPR and that they've taken appropriate steps to avoid that. We ask the question explicitly regarding IPR in our submission templates, at which point the ANTS team is "acting in good faith" based on the information provided by the submitter who has confirmed that they've taken steps to avoid IPR violations, so the legal question would ultimately fall on the developer.
Our wider (Met Office) guidance only seems to consider the Met Office scope though. It's been somewhat grey in terms of how we interact with external bodies and international partners.
Something to take to the Science Codes Owner and Legal though.
There was a problem hiding this comment.
My question was precisely if this guidance is written down somewhere and approved by legal. If yes, maybe let's refer to it in the text.
Another point is that for me "integrity of the code" can be construed as wider than IPR issues.
There was a problem hiding this comment.
Another point is that for me "integrity of the code" can be construed as wider than IPR issues.
Indeed. On that point, if this policy addition applies to the repositories you're using this license across: https://github.com/MetOffice/simulation-systems/blob/main/LICENSE then integrity itself probably needs defining very clearly. That license is a BSD 3-clause that says:
"THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
A contributor would not be able to be made liable by anyone accepting and running codebases with that license for quite a lot of things, regardless of whether they used generative AI or otherwise.
| | 1 | Check file header | Explicitly names an approved | Reject immediately if | | ||
| | | and commit message | enterprise-tier tool | free/personal tier | | ||
| +------+--------------------+------------------------------+------------------------+ | ||
| | 2 | Check licence | Code contains no proprietary | Request rewrite/proof | |
There was a problem hiding this comment.
What exactly is the responsibility of the reviewer here ? How can they assert that a code hasn't been plagiarised ? It is not necessarily obvious.
Should we change the text to code contains no obvious proprietary or restrictively licensed snippet.
There was a problem hiding this comment.
Yes, that's a good point. Slightly rewarded the content in the table.
Jean-Christophe Rioual (mo-jcrioual)
left a comment
There was a problem hiding this comment.
All the text cleaning is fine but I have added two comments in the code changes
- one about legal responsibility
- one about reviewer responsibility
…ments based on reviewer comments
Andrew Clark (arjclark)
left a comment
There was a problem hiding this comment.
I think these look sensible adjustments to me.
|
Thanks Yaswant Pradhan (@yaswant) for tagging me on the PR and raising its awareness. I think the wording looks like a sensible and pragmatic approach. I agree with Andrew Clark (@arjclark) suggestion above and would welcome further advice from our legal team on whether the stronger wording of previous iterations helps in any potential liability. From my reading of it I don't think you are expecting any greater level of responsibility from contributors than in any other open source code contribution context, only reminding them of their existing obligations to not violate IPR and license stipulations, and adding a requirement to attribute AI usage. It would be good to ensure that agrees with legal view. |
Jean-Christophe Rioual (mo-jcrioual)
left a comment
There was a problem hiding this comment.
I am happy with the current iteration. It's important that we get this right so thank you for leading on this. I think we have to accept that it's an evolving picture and that there are still some grey zones.
Andrew Coughtrie (andrewcoughtrie)
left a comment
There was a problem hiding this comment.
I've had a look at this, some changes that I think streamline the wording and some comments that I think we still need to think about regarding how we manage such a complex topic.
| * source code | ||
| * tests | ||
| * scripts and configuration | ||
| * documentation files containing code examples |
There was a problem hiding this comment.
What about documentation in general not just those containing code examples, that is something people are quite likely to use AI for, I do.
| * **Risk of Public-Domain AI**: AI tools trained on public repositories can emit | ||
| code that violates open-source licences or copyrights. | ||
| * **No Free/Personal-Tier Tools**: Use of free or personal-tier AI coding tools | ||
| is *strictly prohibited* for project contributions. | ||
| * **Approved Enterprise-Tier Tools Only**: Contributors may only use | ||
| enterprise-tier AI tools approved by their employing organisation or the | ||
| repository maintainers. | ||
| * **AI Agents Cannot Commit**: AI tools and agents are not permitted to directly | ||
| commit code, open pull requests, or perform repository operations. All | ||
| AI-generated or AI-assisted content must be reviewed, validated, and committed | ||
| by a human contributor with explicit intent and accountability. | ||
| * **Contributor Responsibility**: The human contributor is responsible for all |
There was a problem hiding this comment.
I feel like the bold parts should be able to stand on their own grammatically and understandable. e.g. Use approved Enterprise-Tier Tools Only
| * enterprise-tier licence with auditable terms of use | ||
| * terms that allow open source contribution workflows | ||
| * explicit organisational approval by employer or project maintainers | ||
| * controls appropriate to institutional IPR and data handling requirements |
There was a problem hiding this comment.
| * enterprise-tier licence with auditable terms of use | |
| * terms that allow open source contribution workflows | |
| * explicit organisational approval by employer or project maintainers | |
| * controls appropriate to institutional IPR and data handling requirements | |
| * Enterprise-tier licence with auditable terms of use. | |
| * Terms that allow open source contribution workflows. | |
| * Explicit organisational approval by employer or project maintainers. | |
| * Controls appropriate to institutional IPR and data handling requirements. |
There was a problem hiding this comment.
I think its fine in its current format. The bullet points are are not complete sentences, so standard punctuation rules do not strictly require a capital letter or a period.
There was a problem hiding this comment.
They may not need the a full stop but they do need capitalising.
| Attribution Requirements | ||
| ------------------------ | ||
|
|
||
| If an approved Generative AI tool is used, you must provide attribution in two |
There was a problem hiding this comment.
| If an approved Generative AI tool is used, you must provide attribution in two | |
| If an approved Generative AI tool is used, you **must** provide attribution in two |
| Do not repeat attribution or the tool name in the file header if it is already | ||
| included. If you use a new tool, add it to the file header list. |
There was a problem hiding this comment.
| Do not repeat attribution or the tool name in the file header if it is already | |
| included. If you use a new tool, add it to the file header list. | |
| Do not repeat attribution or the tool name in the file header if it is already | |
| included. If you use a new tool or version, append it to the list. |
| Add a comment near the top of the file. Use the native comment style for the | ||
| language, for example: | ||
|
|
||
| .. tab-set:: |
There was a problem hiding this comment.
Do we actually need a per language example? I would say people should know how to comment in what ever language they are working in. More useful would be examples of different situations. Like when adding an new version of model or adding a new site/tool. Make it obvious what the expected end outcome would be after multiple people have used different models on a single file.
Oliver Lomax (@odlomax) made the observation that we could use a AI skills file to automatically add the header when appropriate if Agentic AI is used to edit a file. This doesn't account for use of inline suggestions where it is very easy to not realise you are even using AI at all. How we catch things like this I don't know but I suspect we are adding a lot of burden that may not catch the things we are trying to catch.
| .. tab-item:: Fortran | ||
|
|
||
| .. code-block:: f90 | ||
|
|
||
| ! Some content in this file was generated or refactored with assistance from | ||
| ! - [Tool Name] ([Model/Version]). | ||
|
|
||
| .. tab-item:: Python | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| # Some content in this file was generated or refactored with assistance from | ||
| # - [Tool Name] ([Model/Version]). | ||
|
|
||
| .. tab-item:: C++ | ||
|
|
||
| .. code-block:: cpp | ||
|
|
||
| // Some content in this file was generated or refactored with assistance from | ||
| // - [Tool Name] ([Model/Version]). |
There was a problem hiding this comment.
Perhaps an example of how a file might change over time like the following:
| .. tab-item:: Fortran | |
| .. code-block:: f90 | |
| ! Some content in this file was generated or refactored with assistance from | |
| ! - [Tool Name] ([Model/Version]). | |
| .. tab-item:: Python | |
| .. code-block:: python | |
| # Some content in this file was generated or refactored with assistance from | |
| # - [Tool Name] ([Model/Version]). | |
| .. tab-item:: C++ | |
| .. code-block:: cpp | |
| // Some content in this file was generated or refactored with assistance from | |
| // - [Tool Name] ([Model/Version]). | |
| .. code-block:: f90 | |
| ! Some content in this file was generated or refactored with assistance from | |
| ! - Met Office Github Copilot Enterprise (Claude Haiku 4.7) | |
| .. code-block:: f90 | |
| ! Some content in this file was generated or refactored with assistance from | |
| ! - Met Office Github Copilot Enterprise (Claude Haiku 4.7/4.8) | |
| .. code-block:: f90 | |
| ! Some content in this file was generated or refactored with assistance from | |
| ! - Met Office Github Copilot Enterprise (Claude Haiku 4.7/4.8) | |
| ! - Bureau of Meteorology Github Copilot Enterprise (Claude Opus 4.8) |
| **2. the commit message** | ||
|
|
||
| Your git commit message must identify the tool and what it assisted with, for | ||
| example: | ||
|
|
||
| .. code-block:: text | ||
|
|
||
| Refactor spatial interpolation routines to improve performance. | ||
|
|
||
| - Assisted-by: [Tool Name] ([Model/Version]) | ||
| for spatial interpolation optimisation. | ||
|
|
||
| Attribution must be specific enough for later audit. Include tool name, | ||
| model/version where available, and date in the source file header. |
There was a problem hiding this comment.
I can still see people genuinely forgetting to do this when developing. It is more important I believe to have this in the PR commit if it is needed. I'm not sure how enforceable it will be doing this unless we have a pre-commit hook that somehow checks (and possibly even adds the required message).
There was a problem hiding this comment.
Thank you, Andrew Coughtrie (@andrewcoughtrie), for the thought-provoking comments. They all make very good sense, and I’ve tried to address each one in ec4e1b6
This will continue to evolve.
PR Summary
Update AI policy and tidy some typographical errors.
Code Reviewer: Pierre Siddall (@Pierre-siddall)
Code Quality Checklist
Code Review