{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openaudit.se/schema/config.json",
  "title": "openaudit config",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "description": "JSON Schema for editor completion and checks."
    },
    "only": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "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": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Auditor ids or patterns to skip."
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "security",
          "accessibility",
          "performance",
          "seo",
          "privacy",
          "best-practices",
          "reliability",
          "maintainability",
          "supply-chain",
          "compliance"
        ]
      },
      "description": "Run only auditors in these categories."
    },
    "failOn": {
      "type": "string",
      "enum": [
        "critical",
        "high",
        "medium",
        "low",
        "info",
        "none"
      ],
      "description": "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": {
      "type": "object",
      "properties": {
        "rules": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "description": "Rule id or pattern, e.g. `code.hygiene/ci-missing` or `web.seo/*`."
              },
              {
                "type": "object",
                "properties": {
                  "rule": {
                    "type": "string",
                    "description": "Rule id or pattern, e.g. `code.hygiene/ci-missing` or `web.seo/*`."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why this is suppressed. Reports show it next to the findings it removed."
                  },
                  "until": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Last day the suppression applies (YYYY-MM-DD, UTC). After it the findings are reported again and openaudit warns."
                  }
                },
                "required": [
                  "rule"
                ],
                "additionalProperties": false
              }
            ]
          },
          "description": "Suppress findings by rule. Each entry is a string, or an object with \"rule\", \"reason\" and \"until\"."
        },
        "paths": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "description": "File glob relative to the target, e.g. `test/fixtures/**`."
              },
              {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string",
                    "description": "File glob relative to the target, e.g. `test/fixtures/**`."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why this is suppressed. Reports show it next to the findings it removed."
                  },
                  "until": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Last day the suppression applies (YYYY-MM-DD, UTC). After it the findings are reported again and openaudit warns."
                  }
                },
                "required": [
                  "path"
                ],
                "additionalProperties": false
              }
            ]
          },
          "description": "Suppress findings in matching files. Each entry is a string, or an object with \"path\", \"reason\" and \"until\"."
        },
        "fingerprints": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "description": "A finding's `fingerprint` from a report."
              },
              {
                "type": "object",
                "properties": {
                  "fingerprint": {
                    "type": "string",
                    "description": "A finding's `fingerprint` from a report."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why this is suppressed. Reports show it next to the findings it removed."
                  },
                  "until": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Last day the suppression applies (YYYY-MM-DD, UTC). After it the findings are reported again and openaudit warns."
                  }
                },
                "required": [
                  "fingerprint"
                ],
                "additionalProperties": false
              }
            ]
          },
          "description": "Suppress single findings. Each entry is a string, or an object with \"fingerprint\", \"reason\" and \"until\"."
        }
      },
      "additionalProperties": true,
      "description": "Suppressions. Suppressed findings are left out of the report and the score, and every report says how many each source removed."
    },
    "options": {
      "type": "object",
      "properties": {
        "offline": {
          "type": "boolean",
          "description": "Skip auditors that need the network (`--offline`)."
        },
        "browser": {
          "type": "boolean",
          "description": "Audit URLs in a real browser (`--browser`)."
        },
        "maxPages": {
          "description": "Pages to crawl per URL (`--max-pages`).",
          "type": "number"
        },
        "agentic": {
          "type": "boolean",
          "description": "Run the agentic auditors (`--agentic`). Costs tokens."
        },
        "ai": {
          "type": "boolean",
          "description": "Attach AI insights (`--ai`)."
        },
        "model": {
          "type": "string",
          "description": "Claude model for `agentic` and `ai`."
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Extra headers sent to URL targets (`--header`)."
        },
        "concurrency": {
          "description": "Auditors run in parallel (`--concurrency`).",
          "type": "number"
        },
        "settings": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          },
          "description": "Per-auditor settings keyed by auditor id, e.g. a licence policy under `\"code.licenses\"`."
        }
      },
      "additionalProperties": true,
      "description": "Run options. A config inside the audited target may set only `maxPages` and `settings[\"code.licenses\"]`; the rest needs `--config <path>`."
    }
  },
  "additionalProperties": true
}
