{
  "schemaVersion": 2,
  "preset": "nextjs",
  "workflow": {
    "planDefaults": {
      "allowedPaths": [
        "app/",
        "components/",
        "lib/",
        "src/",
        "test/",
        "tests/"
      ],
      "requiredCommands": [
        "npm test"
      ],
      "evidencePaths": [
        ".agent-guardrails/evidence/current-task.md"
      ]
    },
    "readBeforeWrite": [
      "AGENTS.md",
      "docs/PROJECT_STATE.md",
      "README.md (if it exists)",
      "app",
      "components",
      "lib"
    ],
    "constraints": [
      "Preserve existing UI and routing patterns unless the task explicitly changes them.",
      "Prefer server/client boundaries already used in the repo.",
      "Keep styling changes local and avoid broad visual churn.",
      "Run type-check (e.g. tsc --noEmit) alongside tests when the project uses TypeScript."
    ],
    "definitionOfDone": [
      "Behavioral UI changes include tests or targeted validation notes.",
      "TypeScript errors are resolved or documented as known issues.",
      "The change respects the configured file budget.",
      "The implementation uses existing patterns for data loading and component structure."
    ]
  },
  "checks": {
    "maxChangedFilesPerTask": 20,
    "requireTestsWithSourceChanges": true,
    "allowedPaths": [],
    "consistency": {
      "maxChangedFilesPerTask": 20,
      "maxTopLevelEntries": 4,
      "maxBreadthMultiplier": 2,
      "warnOnBroadChanges": true
    },
    "correctness": {
      "requireTestsWithSourceChanges": true,
      "requireCommandsReported": true,
      "requireEvidenceFiles": true
    },
    "risk": {
      "requireReviewNotesForProtectedAreas": true,
      "warnOnInterfaceChangesWithoutContract": true,
      "warnOnConfigOrMigrationChanges": true
    },
    "sourceRoots": [
      "app",
      "components",
      "lib",
      "src"
    ],
    "sourceExtensions": [
      ".js",
      ".jsx",
      ".ts",
      ".tsx"
    ],
    "testRoots": [
      "test",
      "tests"
    ],
    "testExtensions": [
      ".js",
      ".jsx",
      ".ts",
      ".tsx"
    ],
    "testFileSignals": [
      ".test.",
      ".spec."
    ],
    "mutation": {
      "enabled": false,
      "survivalThreshold": 50,
      "maxMutations": 20,
      "timeoutMs": 15000
    },
    "scope": {
      "violationSeverity": "error",
      "violationBudget": 5
    }
  },
  "protectedAreas": [
    {
      "path": "app/api/",
      "label": "route handlers",
      "minimumRiskLevel": "medium",
      "requiresReviewNotes": true
    },
    {
      "path": "middleware.ts",
      "label": "middleware",
      "minimumRiskLevel": "high",
      "requiresReviewNotes": true
    },
    {
      "path": "lib/auth/",
      "label": "auth utilities",
      "minimumRiskLevel": "high",
      "requiresReviewNotes": true
    }
  ],
  "productionProfiles": {
    "default-webapp": {
      "focus": [
        "correctness",
        "maintainability",
        "observability"
      ],
      "validationProfile": "standard"
    },
    "traffic-sensitive-web": {
      "focus": [
        "performance",
        "reliability",
        "observability"
      ],
      "validationProfile": "strict"
    }
  },
  "nfrPolicies": {
    "security": {
      "evidenceHint": "Mention auth, secrets, permissions, and sensitive-data handling explicitly."
    },
    "dependency": {
      "evidenceHint": "Mention new or upgraded packages, lockfile changes, and dependency impact explicitly."
    },
    "performance": {
      "evidenceHint": "Mention render, fetch, or route latency impact in evidence."
    },
    "understanding": {
      "evidenceHint": "Explain the main tradeoffs so future maintainers can follow the change."
    },
    "continuity": {
      "evidenceHint": "Mention reuse targets and any deliberate continuity break in evidence."
    },
    "observability": {
      "evidenceHint": "Mention logs, metrics, tracing, or monitoring impact in evidence."
    }
  },
  "languagePlugins": {
    "typescript": [
      "@agent-guardrails/plugin-ts"
    ]
  },
  "criticalPaths": [
    "app/api/",
    "middleware.ts",
    "lib/auth/"
  ],
  "runtimeSurfaces": [
    "app/",
    "components/",
    "lib/"
  ],
  "performanceSensitiveAreas": [
    "app/api/",
    "lib/cache/",
    "lib/data/"
  ],
  "review": {
    "includeEvidenceSummary": true
  }
}
