Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions ai-guidelines/README.md
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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
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.
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 501(c)(3) nonprofit organization. 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

@alea12 alea12 Jun 22, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

To discuss: should we mention we started a NYPL Hugging Face org?
https://huggingface.co/NYPL


| Tool | Scope | Access |
| -------------------- | ----------------------------------------------- | ---------------------------------------------------------------------- |
| GitHub Copilot | Code generation, inline completion, code review | All engineers |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
- Clearly indicate AI assistance in pull requests using the [PR template](./templates/PR_TEMPLATE.md).
- Clearly indicate AI assistance in pull requests using the [PR template](./templates/PULL_REQUEST_TEMPLATE.MD) in your project repo.

My repos at least have PR spelled out, but not sure if this is consistent across every repo...

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we know if Copilot-generated changes to agent.md templates still require admin approval? If so, could be good to highlight what to expect, who to reach out to for review... or optionally advise against this if that's our POV

https://github.com/orgs/community/discussions/187679

- 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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.