---
title: "Configuration"
description: "openaudit.config.json: suppressions, auditor selection and per-auditor settings, with the full key reference and what a config inside the audited target may change."
url: https://openaudit.se/docs/configuration/
---

# Configuration

`bunx @openaudit/cli init` looks at the project and writes a commented `openaudit.config.jsonc`: a `$schema` for editor completion, `failOn`, suppressions for the test fixtures it finds, and the opt-in auditors that fit the stack. Suppressions (`ignore.rules`, `ignore.paths`, `ignore.fingerprints`) can carry a `reason` and an `until` date, after which they stop applying and openaudit warns. Every report discloses what each config or baseline suppressed, and why. Per-auditor settings include a dependency licence policy (`settings["code.licenses"]` with `deny` and `allow` lists of SPDX ids). Code Health reads CodeScene's `.codescene/code-health-rules.json` (rule weights and thresholds per path) and its `@codescene(disable:"...")` comments, so both tools score the same code the same way. The report says when a rules file applied.

A config found inside the audited target is written by whoever controls the target, so it can only narrow an audit or add its own licence policy. It cannot enable opt-in auditors, add credentials or switch off the `--fail-on` gate. Settings like that come only from flags or from a file passed with `--config <path>`. In CI, pass the repository's own config with `--config` only where it has been reviewed, such as on pushes to the default branch, never on pull requests. See [`apps/cli/README.md`](https://openaudit.se/docs/configuration/).

## The config file

`openaudit init` looks at the project with the same detection an audit uses and writes `openaudit.config.jsonc`: a `$schema` for editor completion and hover help, `failOn`, `ignore.paths` for the test fixture and third-party directories it finds (each with a reason), a commented licence policy, and the opt-in auditors that fit the stack. It refuses to overwrite an existing config without `--force`. The file may be named `openaudit.config.json` or `openaudit.config.jsonc` (not both), and either may hold comments and trailing commas. Flags on the command line take precedence over it. The schema is published at `https://openaudit.se/schema/config.json`; `openaudit schema config` prints it offline.

A config found in the audited target is written by whoever controls the target, so it is only partly trusted. From there, openaudit honours `only` (which can only narrow the default set: it never enables opt-in or agentic auditors), `exclude`, `categories`, `failOn` (except `"none"`), `ignore`, `options.maxPages` and the licence policy in `options.settings["code.licenses"]` (it only adds findings), and prints a notice when the config narrows which auditors run. Settings that send data, cost money or add credentials (`options.agentic`, `ai`, `model`, `headers`, other auditors' `settings`, `browser`, ...) are ignored with a warning. Those settings are accepted only from flags or from a file passed explicitly with `--config <path>`. Every report states how many findings each config or baseline suppressed. Use `--no-config` to ignore the target's config entirely. **When CI audits untrusted changes (pull requests from forks), pass `--fail-on` and `--no-config` explicitly**, because the change itself can edit the config. See [CI](https://openaudit.se/docs/ci/) for when to trust the repository's own config.

```jsonc
{
  "$schema": "https://openaudit.se/schema/config.json",
  "exclude": ["code.semgrep"],
  "failOn": "high",
  "ignore": {
    "rules": [
      { "rule": "code.hygiene/ci-missing", "reason": "CI lives in another repository" }
    ],
    "paths": [
      "dist/**", // a plain string still works
      { "path": "test/fixtures/**", "reason": "Deliberately vulnerable inputs" }
    ],
    "fingerprints": [
      { "fingerprint": "0123456789abcdef", "reason": "Accepted until the API is retired", "until": "2026-12-31" }
    ]
  },
  "options": { "maxPages": 10 }
}
```

#### Suppressions

Each `ignore` entry is a string or an object with the pattern (`rule`, `path` or `fingerprint`) and optional `reason` and `until`:

- `rule`: a rule id or pattern (`code.hygiene/ci-missing`, `web.seo/*`). `path`: a file glob relative to the target. `fingerprint`: a finding's `fingerprint` from a report.
- `reason`: why it is suppressed. Reports list each entry that has a reason or expiry with the number of findings it removed.
- `until`: the last day the entry applies (`YYYY-MM-DD`, UTC). After it the entry stops applying, its findings come back (and count towards `--fail-on`), openaudit warns on stderr, and the report lists it as expired. Use it for accepted risks that should be looked at again.

Suppressed findings are never silently dropped: the terminal, Markdown and HTML reports and the JSON report's `suppressed` field show what each config, `--baseline` or `--diff` removed. Misspelt keys in an entry are rejected, so an `until` cannot be ignored by accident.

#### Licence policy

`code.licenses` checks dependency licences against a policy and is skipped until one is configured:

```json
{
  "options": {
    "settings": {
      "code.licenses": {
        "deny": ["AGPL-*", "GPL-*", "SSPL-1.0"],
        "allow": ["MIT", "Apache-2.0", "BSD-*", "ISC"],
        "unknown": "low",
        "ignorePackages": ["@acme/*"]
      }
    }
  }
}
```

- `deny`: licence ids or globs that fail the policy (`denied-license`, high).
- `allow`: when present, every licence not listed fails the policy (`license-not-allowed`, medium). Use `"*"` to allow anything that is not denied.
- `unknown`: severity for packages that declare no licence or one the policy cannot read (`UNLICENSED`, `SEE LICENSE IN ...`, free text), or `"off"`. Default `"low"`. Name a `LicenseRef-*` id or the exact value in `allow` to accept it.
- `ignorePackages`: package names or globs exempt from the policy. Every locked dependency is checked, development ones included, so list build-only tools here if their licence does not matter to you.

Entries are SPDX ids, case-insensitive, with `*` globs. Common spellings (`Apache 2.0`, `GPLv3`, deprecated `GPL-2.0`) are normalised on both sides. A deny entry wins over an allow entry, except that an entry naming an exception (`GPL-2.0-only WITH Classpath-exception-2.0`) wins over one for the bare licence. Expressions are evaluated as SPDX defines them: `MIT OR GPL-3.0-only` passes if any alternative passes, `AND` needs every term to pass, and an `-or-later` or `+` licence also matches entries for its base version.

Licences are read offline, without running project code: from `package-lock.json` (lockfile v2/v3) and `composer.lock`, from installed `node_modules/**/package.json` (hoisted, nested, and the pnpm and bun stores) for any npm lockfile, and from `.venv`/`venv` `*.dist-info/METADATA` for pinned Python requirements and `poetry.lock`. Dependencies with no licence data (Go, Cargo, Bundler, or packages that are not installed) are listed in one info finding, `no-license-data`. The opt-in `code.syft-licenses` auditor covers more ecosystems by building an SBOM with syft.

Every finding has a stable `fingerprint`. To accept a known issue, add its fingerprint to `ignore.fingerprints`, or pass a whole earlier report with `--baseline`.

## Reference

Generated from `openaudit schema config`. Keys marked *trusted only* are ignored with a warning when the config is found inside the audited target; pass the file with `--config <path>` to use them.

| Key | Type | Default | Notes |
| --- | --- | --- | --- |
| `only` | `string[]` | `[]` | Auditor ids or patterns to run exclusively (`code.secrets`, `web.*`). In a config inside the audited target this only narrows the default set: it never enables opt-in or agentic auditors. |
| `exclude` | `string[]` | `[]` | Auditor ids or patterns to skip. |
| `categories` | `"security" \| "accessibility" \| "performance" \| "seo" \| "privacy" \| "best-practices" \| "reliability" \| "maintainability" \| "supply-chain" \| "compliance"[]` | `[]` | Run only auditors in these categories. |
| `failOn` | `"critical" \| "high" \| "medium" \| "low" \| "info" \| "none"` | `"high"` | Exit with code 1 when a finding is at least this severe. `--fail-on` overrides it. A config inside the audited target cannot set "none". |
| `ignore.rules` | `(string \| { rule, reason?, until? })[]` | `[]` | Suppress findings by rule. Each entry is a string, or an object with "rule", "reason" and "until". |
| `ignore.paths` | `(string \| { path, reason?, until? })[]` | `[]` | Suppress findings in matching files. Each entry is a string, or an object with "path", "reason" and "until". |
| `ignore.fingerprints` | `(string \| { fingerprint, reason?, until? })[]` | `[]` | Suppress single findings. Each entry is a string, or an object with "fingerprint", "reason" and "until". |
| `options.offline` | `boolean` | none | **Trusted only.** Skip auditors that need the network (`--offline`). |
| `options.browser` | `boolean` | none | **Trusted only.** Audit URLs in a real browser (`--browser`). |
| `options.maxPages` | `number` | `10` | Pages to crawl per URL (`--max-pages`). |
| `options.agentic` | `boolean` | none | **Trusted only.** Run the agentic auditors (`--agentic`). Costs tokens. |
| `options.ai` | `boolean` | none | **Trusted only.** Attach AI insights (`--ai`). |
| `options.model` | `string` | none | **Trusted only.** Claude model for `agentic` and `ai`. |
| `options.headers` | `object` | none | **Trusted only.** Extra headers sent to URL targets (`--header`). |
| `options.concurrency` | `number` | none | **Trusted only.** Auditors run in parallel (`--concurrency`). |
| `options.settings` | `object` | none | **Trusted only.** Per-auditor settings keyed by auditor id, e.g. a licence policy under `"code.licenses"`. |

## Per-auditor settings

Settings for the agentic auditors go in `options.settings`, under `"agent"` for all of them or under one auditor's id.

```jsonc
{
  "settings": {
    "agent": { "maxTurns": 60, "maxBudgetUsd": 5 },
    "agent.webapp-security": {
      "instructions": "Test accounts: alice@test.example / bob@test.example (passwords in the staging vault). Do not touch /billing.",
      "storageState": "./auth.json"
    }
  }
}
```

The available keys are `maxTurns`, `maxBudgetUsd`, `effort` (`low` to `max`, default `high`), `maxFindings` (default 40), `instructions` and `storageState` (a Playwright storage-state file for a logged-in test account; it must live inside the project, or the working directory for URL targets). Arbitrary Playwright flags are not accepted, because several of them execute code.

## JSON Schema

Published at `https://openaudit.se/schema/config.json` ([this site's copy](https://openaudit.se/schema/config.json)). `openaudit init` sets it as `$schema`, so editors complete keys, show these notes on hover and flag mistakes. Offline, `openaudit schema config` prints the same schema.
