-
Notifications
You must be signed in to change notification settings - Fork 4
Draft / barebone of AI Guidelines #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,79 @@ | ||||||
| # NYPL Engineering AI Guidelines | ||||||
|
|
||||||
| Welcome to the NYPL Engineering AI Guidelines! | ||||||
|
|
||||||
| Here at NYPL Digital, we are excited about the potential of AI to enhance our engineering work, but we also recognize the need for clear guidelines to ensure responsible and secure use as a quasi-public institution. This document outlines our principles, approved tools, and policies for using AI in our engineering projects. | ||||||
|
|
||||||
| ## North Stars | ||||||
|
|
||||||
| These principles are non-negotiable and apply to all AI-assisted engineering work at NYPL. | ||||||
|
|
||||||
| 1. **Use only approved tools.** Engineers must use AI tools exclusively from the [approved list](#approved-tools). Using unapproved tools for Library work is prohibited. | ||||||
| 2. **Developers are fully accountable.** Every commit, every agent action, every generated output is the responsibility of the engineer who initiated it. | ||||||
| 3. **Never expose secrets.** API keys, credentials, and secrets must never be entered into any AI chat or agent context. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Approved Tools | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To discuss: should we mention we started a NYPL Hugging Face org? |
||||||
|
|
||||||
| | Tool | Scope | Access | | ||||||
| | -------------------- | ----------------------------------------------- | ---------------------------------------------------------------------- | | ||||||
| | GitHub Copilot | Code generation, inline completion, code review | All engineers | | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you feel we need to specify anything about the models or do you think it is clear that people can use any of the ones available? |
||||||
| | Gemini | Chat, code assistance | All engineers — use your NYPL account | | ||||||
| | Claude / Claude Code | Chat, agentic coding | **AI Working Group members only** — reach out to WG members for access | | ||||||
|
|
||||||
| > New tools not on this list require IT/Digital review before use. Submit a request via ServiceNow. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Policies | ||||||
|
|
||||||
| ### 1. Security | ||||||
|
|
||||||
| - **Hard rule:** Secrets must never appear in agent context. If your codebase stores API keys in files an agent can read, refactor before using AI agents on that project. | ||||||
| - Prefer technical controls (`.gitignore`, secret scanning, environment injection) over relying on `AGENTS.md` instructions alone to exclude sensitive files. | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re: meeting on Jun 22, we could be more explicit about this cc: @bantucaravan |
||||||
| - AI agents must not be granted access to production systems or authorized to run SSH commands without explicit, reviewed approval. | ||||||
|
|
||||||
| ### 2. Code Review & Accountability | ||||||
|
|
||||||
| - All AI-generated code must be reviewed before merging, as you would review any human-authored PR. | ||||||
| - Engineers must be able to explain every line of code they commit, regardless of how it was produced. If you cannot explain it, do not commit it. | ||||||
| - Clearly indicate AI assistance in pull requests using the [PR template](./templates/PR_TEMPLATE.md). | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
My repos at least have PR spelled out, but not sure if this is consistent across every repo... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this could be clarified. What if you just used AI to ask a question or make a plan? What if you just used Copilot code complete? What does "AI assistance" mean and how specific should you be about what AI assistance you used? |
||||||
| - An agent's actions are treated as your own: if an agent breaks something, you own the fix. | ||||||
|
|
||||||
| ### 3. Cost & Usage | ||||||
|
|
||||||
| - Some models are significantly more expensive than others — use the most capable model appropriate for the task, not the most powerful one available. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will teams get guidance about what models are best for what tasks? |
||||||
| - Monitor your own usage. The working group will establish team-level cost baselines as part of the Claude rollout. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do we want folks to do after monitoring their usage? There's currently some ambiguity about what is "too much," I wonder if there is any more guidance we can give ahead of the Claude rollout of team baselines. |
||||||
| - Do not share access credentials or seat licenses with others. | ||||||
|
|
||||||
| ### 4. Configuration & Agent Files | ||||||
|
|
||||||
| - Place `AGENTS.md` (or equivalent, e.g., `.github/copilot-instructions.md`) in your project root to establish project-specific AI behavior. | ||||||
| - Use the [AGENTS.md template](./templates/AGENTS.md) as a starting point. Customize per project; a one-size-fits-all ruleset is explicitly discouraged. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we know if Copilot-generated changes to |
||||||
| - AI configuration files should be committed to the repo and treated as part of the project's engineering standards. | ||||||
|
|
||||||
| ### 5. Labeling AI-Generated Work | ||||||
|
|
||||||
| - Work outputs that are largely AI-generated must be clearly labeled per NYPL policy. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is "largely" up to the engineer's discretion? |
||||||
| - In code contexts, a PR description note (e.g., "Generated with Copilot, reviewed by [engineer]") satisfies this requirement. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Supporting Documents | ||||||
|
|
||||||
| > All documents below are currently in progress. | ||||||
|
|
||||||
| | Document | Description | | ||||||
| | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | | ||||||
| | [AGENTS.md Template](./templates/AGENTS.md) | Starter configuration file for AI agents in a project repo | | ||||||
| | [Prompt Engineering Best Practices](./guides/prompt-engineering.md) | How to write effective prompts, use TDD with AI, and review generated output | | ||||||
| | [File Exclusion & Secret Scanning Guide](./guides/file-exclusion.md) | How to prevent AI tools from reading sensitive files; recommended `.gitignore` patterns and secret scanning setup | | ||||||
| | [Meta-Governance Policy](./META_GOVERNANCE.md) | How the working group reviews tools, updates guidelines, and maintains accountability over time | | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Questions & Governance | ||||||
|
|
||||||
| - **Slack:** [#eng-ai-working-group](https://nypl.slack.com/archives/C0AT774CGQP) | ||||||
| - Guidelines are reviewed on a recurring cadence by the working group. Check the changelog for updates. | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.