Reference Source

Put the compliance lookup inside your coding assistant: a skill, an AGENTS.md block, a Cursor rules file

Published .

Ask a coding assistant "does HIPAA require encryption at rest" and you will usually get a confident paragraph with no citation in it, often naming an algorithm the rule does not name. The rule is two sentences long and freely published. The gap is not that the answer is hard to find; it is that nothing in the assistant's default behaviour sends it to look.

This page is three ways to change that, in descending order of how much they do and ascending order of how little you have to install. All three carry the same instruction: look the provision up, quote it, cite it in the code comment, and say plainly what the rule does not specify. That last clause is the one that matters most. A developer told "HIPAA requires AES-256" builds the wrong thing confidently; a developer told "HIPAA requires a mechanism to encrypt and names no algorithm, so this is your decision, and here is the citation to record it against" builds the right thing and can defend it.

1. The skill

github.com/joelp22-maker/referencesource-skills holds three agent skills, MIT-licensed. The one for this is compliance-requirement-lookup.

npx skills add joelp22-maker/referencesource-skills

In Claude Code the repo is also a plugin marketplace, so the skills and the read-only MCP server install together:

/plugin marketplace add joelp22-maker/referencesource-skills
/plugin install referencesource@referencesource

The skill is longer than the block below — it teaches the assistant how to read verified_fields and derived_fields, what the square brackets in a NIST control mean, and four worked examples end to end. If you install only one thing, install this.

2. The AGENTS.md block

AGENTS.md is read by Codex and by a growing number of other agents; Claude Code reads CLAUDE.md; both are plain Markdown and this block works in either. Paste it at the end of the file.

## Security and compliance requirements: look them up, never recall them

When a question turns on what a security or compliance rule *requires* —
HIPAA, NIST SP 800-53, a state breach-notification deadline, a state privacy
law's applicability threshold, a federal record-retention period, whether a
cryptographic algorithm is still acceptable, a TLS certificate rule — do not
answer from memory and do not infer the requirement from what projects
usually do. Look it up first.

One GET, no key and no account, returns the provisions that bear on a
component with the publisher's own passage attached — the sentence where the
provision is written as prose, the table row itself where it is set in a table,
as the TLS certificate lifetimes are:

    https://referencesource.org/api/requirements?component=database&regime=hipaa
    https://referencesource.org/api/requirements?component=logging,api&format=text

`component` is one of: database, object storage, logging, web app, api,
authentication, secrets management, backups, access control, employee device.
Ordinary synonyms work (postgres, s3, bucket, siem, login, vault, laptop).
`regime` is `hipaa` or `nist`; leave it out and both documents answer.
`format=text` returns plain text a code comment can take.

For the other documents, fetch the record set and filter it:

    https://referencesource.org/data-breach-notification-clocks/data.json
    https://referencesource.org/state-data-privacy-applicability-thresholds/data.json
    https://referencesource.org/record-retention-periods-federal/data.json
    https://referencesource.org/nist-cryptographic-algorithm-deprecation-schedule/data.json
    https://referencesource.org/tls-certificate-requirement-effective-dates/data.json
    https://referencesource.org/security-compliance-controls/data.json

There is also a keyless read-only MCP server at
https://referencesource.org/mcp with `control` and `controls_for` tools.

Then answer in four parts, and drop none of them:

1. what the rule requires
2. the publisher's verbatim passage (`source_quote` or `requirement`)
3. the publisher's page (`source`)
4. the citation and the date it was last checked

And obey these four rules:

- **Say what the rule does NOT specify.** The HIPAA Security Rule requires
  "a mechanism to encrypt and decrypt electronic protected health
  information" and names no algorithm, key length or mode. It requires
  procedures to "regularly review" system activity and names no interval.
  NIST controls print square brackets — "[Assignment: organization-defined
  ...]" — where the value is the reading organisation's to decide; never fill
  one in silently with the common answer.
- **Never state or imply that a system is compliant.** A provision being
  listed says its document contains it, not that it applies here and not how
  to satisfy it. Whether an organisation is in scope is what the rule's own
  applicability section asks; quote that section rather than answering it.
  None of this is legal advice.
- **Do not quote SOC 2, ISO/IEC 27001 or PCI DSS.** That text is sold under
  licence and is in none of these records. Asked how to make something SOC 2
  compliant, say the criteria are licensed and that you are not quoting them
  — rather than paraphrasing them from memory — then answer with the freely
  published provisions covering the same ground (NIST IA-2(1) for
  multi-factor to privileged accounts, SC-28 for data at rest, the AU family
  for audit records, AC-2 for account management) and send them to the
  publishing body for the criteria themselves.
- **Put the citation in the code**, on the line the requirement drove, and
  name which part of it was your decision:

      # HIPAA Security Rule 45 CFR 164.312(a)(2)(iv) — "Implement a mechanism
      # to encrypt and decrypt electronic protected health information." The
      # rule names no algorithm; AES-256-GCM is this project's choice.
      # https://referencesource.org/security-compliance-controls/164-312-a-2-iv/

Fields listed in a record's `verified_fields` were found inside the quote.
Fields in `derived_fields` are referencesource.org's own labelling or
formatting, not the publisher's words — a citation string, a one-word
classification, an integer extracted from a clause. Quote the sentence;
attribute the derived field to referencesource.org, not to the authority. A
record carries `last_verified` and `stale_after`: past that date, say when it
was last checked and send the reader to the source. "Not found" means not in
these records, never "no such rule".

3. The Cursor rules file

Cursor's documentation says project rules "live in .cursor/rules as .mdc files and are version-controlled", and that a rule "must use the .mdc extension". Save this as .cursor/rules/compliance-citations.mdc. The frontmatter fields are Cursor's own — description, globs, alwaysApply. A description with alwaysApply: false and no globs is what Cursor calls Apply Intelligently: the agent reads the description and pulls the rule in when it judges it relevant, which is exactly right for a rule that only matters on compliance questions. Checked against cursor.com/docs/context/rules on 2026-11-21.

---
description: Look security and compliance requirements up and quote them; never state a requirement from memory, and always say what the rule does not specify.
alwaysApply: false
---

When a question turns on what a security or compliance rule requires — HIPAA,
NIST SP 800-53, a breach-notification deadline, a privacy-law threshold, a
record-retention period, whether an algorithm or a certificate lifetime is
still acceptable — look it up before answering.

    https://referencesource.org/api/requirements?component=database&regime=hipaa

component: database, object storage, logging, web app, api, authentication,
secrets management, backups, access control, employee device (synonyms such as
postgres, s3, siem, login, vault, laptop are accepted). regime: hipaa or nist,
or omit for both. Add format=text for plain text.

The other record sets are plain JSON:
https://referencesource.org/data-breach-notification-clocks/data.json,
.../state-data-privacy-applicability-thresholds/data.json,
.../record-retention-periods-federal/data.json,
.../nist-cryptographic-algorithm-deprecation-schedule/data.json,
.../tls-certificate-requirement-effective-dates/data.json,
.../security-compliance-controls/data.json

Answer with the requirement, the publisher's verbatim passage, the publisher's
page, and the citation. Then:

- Say what the rule does NOT specify. HIPAA requires "a mechanism to encrypt
  and decrypt electronic protected health information" and names no algorithm.
  NIST square brackets — "[Assignment: organization-defined ...]" — are values
  the organisation decides; do not fill one in silently.
- Never say or imply a system is compliant. A listed provision means its
  document contains it, not that it applies here. Not legal advice.
- Do not quote SOC 2, ISO/IEC 27001 or PCI DSS: that text is licensed and is
  not in these records. Say so, then answer with the freely published
  provisions that cover the same ground.
- Put the citation in a comment above the code the requirement drove, and name
  which part was your choice rather than the rule's.

`verified_fields` lists the fields found inside the quote; `derived_fields` are
referencesource.org's labelling, not the publisher's words. Records carry
`last_verified` and `stale_after`. "Not found" means not in these records,
never "no such rule".

GitHub Copilot and the rest

GitHub's documentation says repository-wide Copilot instructions "are specified in a copilot-instructions.md file in the .github directory of the repository", in Markdown — so the AGENTS.md block above works there unchanged; paste it into .github/copilot-instructions.md. The same page lists AGENTS.md, CLAUDE.md and GEMINI.md as agent instruction files alongside it, none of them replacing the others.

Windsurf is now documented under Devin, and its own page says the simplest way to add rules is "an AGENTS.md file at your project root", with one rule per file in .devin/rules/*.md; .windsurfrules and .windsurf/rules/*.md are named as legacy and "imported by default". So for Windsurf, use the AGENTS.md block. Both checked 2026-11-21.

None of these formats needs anything installed, and none of them sends us anything: they tell your assistant which URL to fetch, and the fetch goes straight from your machine to a static page.

What is behind the URLs

Seven record sets, free to read, no account and no key, each value carrying the page it came from and the verbatim passage on that page that states it:

The questions themselves, answered as pages rather than as instructions, are at Compliance for developers. Connect your AI assistant is the MCP configuration for every client, and /api/requirements documents itself if you call it with no parameters.

Why no SOC 2, ISO 27001 or PCI DSS

The bodies that write those documents sell the text. Our position, written down before any of this existed, is that facts plus a short attributed quote with a link are fine and republishing licensed text is not — so none of it appears in these records, and all three blocks above tell your assistant to say so rather than paraphrase from memory. The long version of that answer, with the free provisions that cover the same ground.

What this page is

A set of instructions for software, written by us, pointing at records assembled automatically from publishers' own pages. No sentence of a rule anywhere behind these URLs is ours: every one is quoted from the publisher that wrote it, with a link to the page it came from and the date we last checked it. Nothing here is legal advice, and nothing here says any system is compliant.