API governance in APIGit: Rule sets, pull request checks and CI
An API style guide that lives in a wiki page is read once and then forgotten. APIGit puts the rules next to the document instead: the same rule set checks a spec while you edit it, while a colleague reviews the pull request, and in CI before the merge. This post walks through what is checked, where the findings appear, and how to turn an advisory check into a required one.
What is checked
Governance runs Spectral rule sets against your API documents. Two rule sets are built in and available on every plan, Free included:
| Rule set | What it looks for |
|---|---|
| API Best Practice | Consistent design, complete descriptions, sound structure and naming. It applies the rules that fit the document's format, so it works for OpenAPI and for AsyncAPI 2.x and 3.x |
| OWASP Top 10 Security | What a spec can reveal about the OWASP API Security Top 10 (2023): missing or outdated security schemes and common misconfigurations. OpenAPI only |
A spec describes an interface, not an implementation, so the security rule set finds the flaws that are visible in the contract. It does not replace a penetration test.
GraphQL schemas have a Governance view as well. It validates the schema's syntax and structure and lists each finding with its line; rule sets do not apply to it.
While you edit
Open an OpenAPI or AsyncAPI document in edit mode and choose the Governance tab. The panel re-checks the document as you type.

- Each finding shows its severity, line and message. Click one and the editor jumps to that line.
- A filter narrows the list to errors, warnings or infos, each with its count.
$refs to other files in the repository are followed, including changes you have not committed yet.- The dropdown switches between rule sets.
The findings never stop you from committing. Outside edit mode the same results are available read-only from the viewer menu, which is useful when you only want to know how a document on main stands.
While you review
A pull request in an organization repository has a Governance tab. A reviewer picks a changed spec and sees the findings for the version in the pull request, with the same rule set dropdown as the editor.

This check is advisory too: it does not block the merge and adds no status to the pull request. It gives the reviewer facts to decide on.
Your own rules, applied by policy
The built-in rule sets are a baseline. On the Enterprise plan an organization can write its own:
- A custom rule profile is a named set of rules. You edit the rules in a form, one rule at a time, or as JSON.
- A governance policy applies a profile to repositories of the organization. Covered repositories list the profile in the rule set dropdown under Custom Profiles, in the editor and in pull requests.
- The Overview tab of the organization's governance page shows which profiles apply to which repository.

Spec templates work the same way for new files: a policy offers your organization's template when someone creates a spec, so a new API starts from your structure instead of an empty file.
Make it a required check
Advisory findings help people who look at them. To enforce a rule set, run the linter in CI:
apigit lint --org acme --report-status
--org adds the rule sets your organization's policies assign to the repository, and --report-status posts the commit status apigit/lint. A branch protection rule can then require that status before a merge. The CLI documentation shows the GitHub Actions steps; on any other CI system the same command runs with npx @apigit/cli.
What each plan includes
| Plan | |
|---|---|
| Built-in rule sets in the editor and the repository viewer | Free, Team, Enterprise |
| Governance tab in pull requests | Organization repositories: Team and Enterprise |
| Custom rule profiles, governance policies, spec templates | Enterprise |
Where to start
Open any spec, choose Governance and read the first ten findings of API Best Practice. Most teams fix missing descriptions and operation IDs first, then switch to OWASP Top 10 Security. The details are in the API Governance documentation.