🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
🔒 feat(alint): add calibrated security rules for injection and trust boundaries (#20190)
Arvin Xu1c919737b94a
diff --git a/alint.config.toml b/alint.config.tomlindex 7a4fcbe7a8f..536a2517cf7 100644--- a/alint.config.toml+++ b/alint.config.toml@@ -305,3 +305,195 @@ files = [ "packages/alint/fixtures/ui-content-width/**" ]lobehub = "./packages/alint/rules"[config.group.rules]"lobehub/ui-content-width" = "warn"++# Security: no-unsafe-user-url-fetch.+[[config.group]]+files = [ "apps/server/src/**/*.ts" ]+ignores = [ "**/*.test.ts", "**/__tests__/**", "**/__mocks__/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-unsafe-user-url-fetch" = "warn"++[[config.group]]+files = [ "packages/alint/fixtures/no-unsafe-user-url-fetch/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-unsafe-user-url-fetch" = "warn"++# Security: no-unscoped-resource-mutation.+[[config.group]]+files = [ "packages/database/src/models/**/*.ts", "packages/database/src/repositories/**/*.ts" ]+ignores = [ "**/*.test.ts", "**/__tests__/**", "**/__mocks__/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-unscoped-resource-mutation" = "warn"++[[config.group]]+files = [ "packages/alint/fixtures/no-unscoped-resource-mutation/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-unscoped-resource-mutation" = "warn"++# Security: no-untrusted-path-io.+[[config.group]]+files = [ "apps/server/src/**/*.ts", "apps/desktop/src/main/**/*.ts" ]+ignores = [ "**/*.test.ts", "**/__tests__/**", "**/__mocks__/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-untrusted-path-io" = "warn"++[[config.group]]+files = [ "packages/alint/fixtures/no-untrusted-path-io/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-untrusted-path-io" = "warn"++# Security: no-shell-command-injection.+[[config.group]]+files = [ "apps/server/src/**/*.ts", "apps/desktop/src/main/**/*.ts", "apps/cli/src/**/*.ts", "packages/agent-runtime/src/**/*.ts", "packages/local-file-shell/src/**/*.ts", "packages/heterogeneous-agents/src/**/*.ts" ]+ignores = [ "**/*.test.ts", "**/*.test.tsx", "**/__tests__/**", "**/__mocks__/**", "**/migrations/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-shell-command-injection" = "warn"++[[config.group]]+files = [ "packages/alint/fixtures/no-shell-command-injection/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-shell-command-injection" = "warn"++# Security: no-untrusted-code-execution.+[[config.group]]+files = [ "apps/server/src/**/*.ts", "apps/desktop/src/main/**/*.ts", "packages/agent-runtime/src/**/*.ts", "packages/local-file-shell/src/**/*.ts", "packages/heterogeneous-agents/src/**/*.ts" ]+ignores = [ "**/*.test.ts", "**/*.test.tsx", "**/__tests__/**", "**/__mocks__/**", "**/migrations/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-untrusted-code-execution" = "warn"++[[config.group]]+files = [ "packages/alint/fixtures/no-untrusted-code-execution/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-untrusted-code-execution" = "warn"++# Security: no-unsafe-html-execution.+[[config.group]]+files = [ "src/**/*.ts", "src/**/*.tsx", "apps/server/src/**/*.ts", "packages/utils/src/**/*.ts" ]+ignores = [ "**/*.test.ts", "**/*.test.tsx", "**/__tests__/**", "**/__mocks__/**", "**/migrations/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-unsafe-html-execution" = "warn"++[[config.group]]+files = [ "packages/alint/fixtures/no-unsafe-html-execution/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-unsafe-html-execution" = "warn"++# Security: no-unsafe-raw-sql.+[[config.group]]+files = [ "apps/server/src/**/*.ts", "packages/database/src/**/*.ts" ]+ignores = [ "**/*.test.ts", "**/*.test.tsx", "**/__tests__/**", "**/__mocks__/**", "**/migrations/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-unsafe-raw-sql" = "warn"++[[config.group]]+files = [ "packages/alint/fixtures/no-unsafe-raw-sql/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-unsafe-raw-sql" = "warn"++# Security: no-secret-exposure.+[[config.group]]+files = [ "apps/server/src/**/*.ts", "apps/desktop/src/main/**/*.ts", "apps/cli/src/**/*.ts", "src/**/*.ts", "src/**/*.tsx", "packages/env/src/**/*.ts" ]+ignores = [ "**/*.test.ts", "**/*.test.tsx", "**/__tests__/**", "**/__mocks__/**", "**/migrations/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-secret-exposure" = "warn"++[[config.group]]+files = [ "packages/alint/fixtures/no-secret-exposure/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-secret-exposure" = "warn"++# Security: no-auth-verification-bypass.+[[config.group]]+files = [ "apps/server/src/**/*.ts", "src/app/**/*.ts", "src/libs/**/*.ts" ]+ignores = [ "**/*.test.ts", "**/*.test.tsx", "**/__tests__/**", "**/__mocks__/**", "**/migrations/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-auth-verification-bypass" = "warn"++[[config.group]]+files = [ "packages/alint/fixtures/no-auth-verification-bypass/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-auth-verification-bypass" = "warn"++# Security: no-unvalidated-redirect.+[[config.group]]+files = [ "apps/server/src/**/*.ts", "src/**/*.ts", "src/**/*.tsx" ]+ignores = [ "**/*.test.ts", "**/*.test.tsx", "**/__tests__/**", "**/__mocks__/**", "**/migrations/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-unvalidated-redirect" = "warn"++[[config.group]]+files = [ "packages/alint/fixtures/no-unvalidated-redirect/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-unvalidated-redirect" = "warn"++# Security: no-prototype-pollution.+[[config.group]]+files = [ "apps/server/src/**/*.ts", "packages/utils/src/**/*.ts", "apps/desktop/src/main/**/*.ts" ]+ignores = [ "**/*.test.ts", "**/*.test.tsx", "**/__tests__/**", "**/__mocks__/**", "**/migrations/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-prototype-pollution" = "warn"++[[config.group]]+files = [ "packages/alint/fixtures/no-prototype-pollution/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-prototype-pollution" = "warn"++# Security: no-privileged-untrusted-electron.+[[config.group]]+files = [ "apps/desktop/src/main/**/*.ts", "apps/desktop/src/preload/**/*.ts" ]+ignores = [ "**/*.test.ts", "**/*.test.tsx", "**/__tests__/**", "**/__mocks__/**", "**/migrations/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-privileged-untrusted-electron" = "warn"++[[config.group]]+files = [ "packages/alint/fixtures/no-privileged-untrusted-electron/**" ]+[config.group.plugins]+lobehub = "./packages/alint/rules"+[config.group.rules]+"lobehub/no-privileged-untrusted-electron" = "warn"diff --git a/packages/alint/README.md b/packages/alint/README.mdindex 85317943942..955b72dd04f 100644--- a/packages/alint/README.md+++ b/packages/alint/README.md@@ -6,14 +6,26 @@ This is Phase 0: the rule set is a private workspace package (`@lobechat/alint`)## Rules-| Rule | Severity | Scope | Source of the rule |-| ----------------------------- | -------- | ------------------------------------------------------------- | -------------------------------------------------------------- |-| `pmap-over-promise-all` | error | `apps/server/src`, `packages/database` | fan-out over a runtime-sized list needs `pMap` |-| `no-transactions-in-models` | error | `packages/database/src/models` | cross-aggregate write transactions use repositories |-| `no-effect-fetching` | error | `src/**/*.tsx` | `data-fetching-architecture` skill |-| `no-dynamic-import-in-server` | warn | `apps/server/src`, `packages/database` | backend code uses static top-level imports |-| `no-mode-flags` | warn | `src/**/*.tsx` | `compose-atoms` skill |-| `no-node-in-browser` | error | browser code in `src/` (not `app/`, `libs/`), package `*.tsx` | no Node-only npm package where the SPA runs it (paths: ESLint) |+| Rule | Severity | Scope | Source of the rule |+| ---------------------------------- | -------- | ------------------------------------------------------------- | ----------------------------------------------------------------------- |+| `pmap-over-promise-all` | error | `apps/server/src`, `packages/database` | fan-out over a runtime-sized list needs `pMap` |+| `no-transactions-in-models` | error | `packages/database/src/models` | cross-aggregate write transactions use repositories |+| `no-effect-fetching` | error | `src/**/*.tsx` | `data-fetching-architecture` skill |+| `no-dynamic-import-in-server` | warn | `apps/server/src`, `packages/database` | backend code uses static top-level imports |+| `no-mode-flags` | warn | `src/**/*.tsx` | `compose-atoms` skill |+| `no-node-in-browser` | error | browser code in `src/` (not `app/`, `libs/`), package `*.tsx` | no Node-only npm package where the SPA runs it (paths: ESLint) |+| `no-unsafe-user-url-fetch` | warn | `apps/server/src` | user-controlled URLs must use SSRF-safe transport (#16601) |+| `no-unscoped-resource-mutation` | warn | database models/repositories | ownership checks for resource and junction mutations (#13683, #16586) |+| `no-untrusted-path-io` | warn | server and Electron main process | confine uploaded/remote filenames before filesystem IO (#13684, #13937) |+| `no-shell-command-injection` | warn | server, desktop main, CLI, agent/file-shell adapters | shell interpolation and interpreter command strings (RCE) |+| `no-untrusted-code-execution` | warn | server, desktop main, agent/file-shell adapters | untrusted eval/Function/vm/interpreter execution (RCE) |+| `no-unsafe-html-execution` | warn | web, server, shared utilities | HTML/SVG and artifact iframe XSS-to-RCE (#13529) |+| `no-unsafe-raw-sql` | warn | server and database | raw values/identifiers entering SQL |+| `no-secret-exposure` | warn | server, desktop main, CLI, web, env | credentials in logs, responses, public config (#19452) |+| `no-auth-verification-bypass` | warn | server, web auth shells/helpers | unverified JWT identity and fail-open signed webhooks |+| `no-unvalidated-redirect` | warn | server and web | unvalidated return/callback targets |+| `no-prototype-pollution` | warn | server, desktop main, shared utilities | untrusted keys/paths reaching prototype setters |+| `no-privileged-untrusted-electron` | warn | Electron main/preload | remote content with Node privileges or unrestricted IPC bridges |Package-level rules, kept next to the package they describe:@@ -41,6 +53,65 @@ A per-file rule cannot see an import graph. When a package's boundary matters, pTo add a package-level rule: register the directory as a plugin in the rule's `[[config.group]]`, add a fixture group for it, and add its fixtures directory with the plugin prefix to `FIXTURE_ROOTS` in `fixtures.test.ts`. CI already keys the cache on `packages/*/alint/rules/**` and runs calibration when `packages/*/alint/**` changes.+## Security rules++The twelve security rules combine regressions from actual fixes with other common+injection and trust-boundary mistakes. They use concrete source-to-sink checks.+Historical anchors:++- **SSRF:** [#16601](https://github.com/lobehub/lobehub/pull/16601)+ (GHSA-53h9-fmjf-frwr) replaced raw fetch for imported skill/image URLs with+ `@lobechat/ssrf-safe-fetch`. URL parsing or HTTPS-only validation is insufficient.+ Fixed destinations, administrator configuration, and unknown URL provenance are+ excluded to avoid treating every backend fetch as vulnerable.++- **IDOR:** [#13683](https://github.com/lobehub/lobehub/pull/13683) added target+ knowledge-base ownership checks; [#16586](https://github.com/lobehub/lobehub/pull/16586)+ scoped group-membership deletion. Relation creation must account for both endpoints;+ deleting ownership-scoped junction rows does not require redundant endpoint checks.+ Workspace ownership, fail-closed parent guards, and documented privileged primitives+ are recognized. Cross-file caller authorization still needs human verification.++- **Path traversal:** [#13684](https://github.com/lobehub/lobehub/pull/13684)+ (GHSA-2g9j-v25c-4j97, temporary-file overwrite) and [#13937](https://github.com/lobehub/lobehub/pull/13937) sanitized+ untrusted filenames. `join`/`resolve` alone and bare string-prefix containment are+ unsafe. Flat private temp stores, properly confined nested paths, generated names,+ and filesystem tools with explicit approved-path guards are accepted.++- **HTML artifact XSS-to-RCE:** [#13529](https://github.com/lobehub/lobehub/pull/13529)+ (GHSA-xq4x-622m-q8fq) introduced HTML sanitization and iframe sandboxing.+ The HTML rule covers the injection entry point; the Electron rule covers the+ privilege boundary that can turn renderer script execution into host execution.++- **Credential disclosure:** [#19452](https://github.com/lobehub/lobehub/pull/19452)+ removed credentials from bot inventories and masked detail reads. The secret rule+ distinguishes accidental logging/list disclosure from intentional issuance to+ an authenticated credential owner.++Additional coverage targets shell command construction, dynamic host code execution,+raw SQL, JWT/webhook verification, callback redirects and object prototype mutation.+RCE is an impact, so it is covered at several entry points: command injection,+untrusted code execution, writable paths, HTML artifacts, and Electron privileges.+A Node `vm` context is not treated as an isolation boundary. An argument array still+needs scrutiny when its target is `bash -c`, `node -e`, or another interpreter.++Safe patterns have explicit carve-outs: approved agent terminals, isolated code+sandboxes, parameterized SQL, sanitized HTML, opaque-origin sandboxed previews,+verified claims, fixed/validated redirects, redacted credentials, null-prototype+records, and narrow Electron bridges. Dynamic execution features are not blanket+violations. A rule needs visible evidence that its trust boundary is missing.++The security fixtures include unsafe examples and legitimate exceptions. They use+illustrative imports, like the existing fixtures, and are analyzed as source text,+not executed as application code. New rules start at `warn`; model-backed per-file+lint cannot establish exploitability across callers or replace security review.+Only tooling changes are involved, so product acceptance is not required.++Calibration details and known limitations are recorded in+[security-calibration.md](security-calibration.md). Rules remain `warn`: per-file+analysis can miss caller authorization, vary between runs, or misread large files.+No zero-false-positive or complete-vulnerability-coverage claim is made.+## Setup and run```bashdiff --git a/packages/alint/fixtures/no-auth-verification-bypass/bad-decoded-identity.ts b/packages/alint/fixtures/no-auth-verification-bypass/bad-decoded-identity.tsnew file mode 100644index 00000000000..e0bcb0c6d2c--- /dev/null+++ b/packages/alint/fixtures/no-auth-verification-bypass/bad-decoded-identity.ts@@ -0,0 +1,9 @@+import { decodeJwt } from 'jose';++import { deleteAccount } from './accounts';++export const removeAccount = async (input: { token: string }) => {+ const claims = decodeJwt(input.token);+ // alint-expect+ return deleteAccount(claims.sub!);+};diff --git a/packages/alint/fixtures/no-auth-verification-bypass/bad-swallowed-verification.ts b/packages/alint/fixtures/no-auth-verification-bypass/bad-swallowed-verification.tsnew file mode 100644index 00000000000..9d362441e67--- /dev/null+++ b/packages/alint/fixtures/no-auth-verification-bypass/bad-swallowed-verification.ts@@ -0,0 +1,16 @@+import { applyPayment, verifySignature } from './payments';++export const paymentWebhook = async (request: Request) => {+ const body = await request.text();+ try {+ await verifySignature(+ body,+ request.headers.get('signature'),+ process.env.PAYMENT_WEBHOOK_SECRET,+ );+ } catch (error) {+ console.error('Webhook signature rejected', error);+ }+ // alint-expect+ return applyPayment(JSON.parse(body));+};diff --git a/packages/alint/fixtures/no-auth-verification-bypass/bad-webhook-missing-secret.ts b/packages/alint/fixtures/no-auth-verification-bypass/bad-webhook-missing-secret.tsnew file mode 100644index 00000000000..5bc43f3e5ef--- /dev/null+++ b/packages/alint/fixtures/no-auth-verification-bypass/bad-webhook-missing-secret.ts@@ -0,0 +1,9 @@+import { applyPayment, verifySignature } from './payments';++export const paymentWebhook = async (request: Request) => {+ const body = await request.text();+ const secret = process.env.PAYMENT_WEBHOOK_SECRET;+ if (secret) await verifySignature(body, request.headers.get('signature'), secret);+ // alint-expect+ return applyPayment(JSON.parse(body));+};diff --git a/packages/alint/fixtures/no-auth-verification-bypass/good-fail-closed-webhook.ts b/packages/alint/fixtures/no-auth-verification-bypass/good-fail-closed-webhook.tsnew file mode 100644index 00000000000..e5b32273a3e--- /dev/null+++ b/packages/alint/fixtures/no-auth-verification-bypass/good-fail-closed-webhook.ts@@ -0,0 +1,9 @@+import { applyPayment, verifySignature } from './payments';++export const paymentWebhook = async (request: Request) => {+ const body = await request.text();+ const secret = process.env.PAYMENT_WEBHOOK_SECRET;+ if (!secret) throw new Error('Webhook not configured');+ await verifySignature(body, request.headers.get('signature'), secret);+ return applyPayment(JSON.parse(body));+};diff --git a/packages/alint/fixtures/no-auth-verification-bypass/good-hmac-result.ts b/packages/alint/fixtures/no-auth-verification-bypass/good-hmac-result.tsnew file mode 100644index 00000000000..8489826335e--- /dev/null+++ b/packages/alint/fixtures/no-auth-verification-bypass/good-hmac-result.ts@@ -0,0 +1,15 @@+import { createHmac } from 'node:crypto';++// Returns a validation result; the caller must reject undefined before processing events.+export const validateWebhook = async (request: Request, signingKey: string) => {+ const body = await request.text();+ const supplied = request.headers.get('signature')!;+ try {+ const signature = createHmac('sha256', signingKey).update(body).digest('hex');+ if (signature === supplied) return JSON.parse(body);+ return;+ } catch (error) {+ console.error('Verification failed', error);+ return;+ }+};diff --git a/packages/alint/fixtures/no-auth-verification-bypass/good-optional-header-policy.ts b/packages/alint/fixtures/no-auth-verification-bypass/good-optional-header-policy.tsnew file mode 100644index 00000000000..d8d9fe33d2b--- /dev/null+++ b/packages/alint/fixtures/no-auth-verification-bypass/good-optional-header-policy.ts@@ -0,0 +1,13 @@+// Operator-configurable additional headers; by contract this guard is a no-op when unset.+export const optionalHeaderGuard = async (+ request: Request,+ configuredHeaders: Record<string, string> | undefined,+ next: () => Promise<void>,+) => {+ if (configuredHeaders) {+ for (const [key, value] of Object.entries(configuredHeaders)) {+ if (request.headers.get(key) !== value) throw new Error('Unauthorized');+ }+ }+ await next();+};diff --git a/packages/alint/fixtures/no-auth-verification-bypass/good-public-health.ts b/packages/alint/fixtures/no-auth-verification-bypass/good-public-health.tsnew file mode 100644index 00000000000..97383873bad--- /dev/null+++ b/packages/alint/fixtures/no-auth-verification-bypass/good-public-health.ts@@ -0,0 +1 @@+export const health = () => Response.json({ status: 'ok' });diff --git a/packages/alint/fixtures/no-auth-verification-bypass/good-verified-identity.ts b/packages/alint/fixtures/no-auth-verification-bypass/good-verified-identity.tsnew file mode 100644index 00000000000..749598b9c74--- /dev/null+++ b/packages/alint/fixtures/no-auth-verification-bypass/good-verified-identity.ts@@ -0,0 +1,12 @@+import { jwtVerify } from 'jose';++import { deleteAccount, signingKey } from './accounts';++export const removeAccount = async (input: { token: string }) => {+ const { payload } = await jwtVerify(input.token, signingKey, {+ audience: 'lobehub',+ issuer: 'auth',+ });+ if (!payload.sub) throw new Error('Missing subject');+ return deleteAccount(payload.sub);+};diff --git a/packages/alint/fixtures/no-auth-verification-bypass/good-verifier-result.ts b/packages/alint/fixtures/no-auth-verification-bypass/good-verifier-result.tsnew file mode 100644index 00000000000..45d995b1aab--- /dev/null+++ b/packages/alint/fixtures/no-auth-verification-bypass/good-verifier-result.ts@@ -0,0 +1,7 @@+import { verifySignature } from './signatures';++export const validateWebhook = async (request: Request, secret: string) => {+ const body = await request.text();+ if (!(await verifySignature(body, request.headers.get('signature'), secret))) return;+ return JSON.parse(body);+};diff --git a/packages/alint/fixtures/no-privileged-untrusted-electron/bad-remote-node.ts b/packages/alint/fixtures/no-privileged-untrusted-electron/bad-remote-node.tsnew file mode 100644index 00000000000..df32bc35e6b--- /dev/null+++ b/packages/alint/fixtures/no-privileged-untrusted-electron/bad-remote-node.ts@@ -0,0 +1,7 @@+import { BrowserWindow } from 'electron';++export const preview = (input: { remoteUrl: string }) => {+ // alint-expect+ const window = new BrowserWindow({ webPreferences: { nodeIntegration: true } });+ return window.loadURL(input.remoteUrl);+};diff --git a/packages/alint/fixtures/no-privileged-untrusted-electron/bad-unrestricted-bridge.ts b/packages/alint/fixtures/no-privileged-untrusted-electron/bad-unrestricted-bridge.tsnew file mode 100644index 00000000000..c5c4f6ce0e2--- /dev/null+++ b/packages/alint/fixtures/no-privileged-untrusted-electron/bad-unrestricted-bridge.ts@@ -0,0 +1,7 @@+import { contextBridge, ipcRenderer } from 'electron';++// Preload attached to remote preview frames.+// alint-expect+contextBridge.exposeInMainWorld('host', {+ invoke: (channel: string, payload: unknown) => ipcRenderer.invoke(channel, payload),+});diff --git a/packages/alint/fixtures/no-privileged-untrusted-electron/good-isolated-preview.ts b/packages/alint/fixtures/no-privileged-untrusted-electron/good-isolated-preview.tsnew file mode 100644index 00000000000..df56181183e--- /dev/null+++ b/packages/alint/fixtures/no-privileged-untrusted-electron/good-isolated-preview.ts@@ -0,0 +1,8 @@+import { BrowserWindow } from 'electron';++export const preview = (input: { remoteUrl: string }) => {+ const window = new BrowserWindow({+ webPreferences: { contextIsolation: true, nodeIntegration: false, sandbox: true },+ });+ return window.loadURL(input.remoteUrl);+};diff --git a/packages/alint/fixtures/no-privileged-untrusted-electron/good-narrow-bridge.ts b/packages/alint/fixtures/no-privileged-untrusted-electron/good-narrow-bridge.tsnew file mode 100644index 00000000000..b9e9b331ee0--- /dev/null+++ b/packages/alint/fixtures/no-privileged-untrusted-electron/good-narrow-bridge.ts@@ -0,0 +1,4 @@+import { contextBridge, ipcRenderer } from 'electron';++// Trusted app preload. Main handler validates sender and the current user's permissions.+contextBridge.exposeInMainWorld('app', { getVersion: () => ipcRenderer.invoke('app:getVersion') });diff --git a/packages/alint/fixtures/no-prototype-pollution/bad-deep-path.ts b/packages/alint/fixtures/no-prototype-pollution/bad-deep-path.tsnew file mode 100644index 00000000000..bdaf40e33e1--- /dev/null+++ b/packages/alint/fixtures/no-prototype-pollution/bad-deep-path.ts@@ -0,0 +1,11 @@+export const applyImportedSetting = (+ target: Record<string, unknown>,+ input: { path: string[]; value: unknown },+) => {+ let cursor = target;+ for (const segment of input.path.slice(0, -1)) {+ cursor = cursor[segment] as Record<string, unknown>;+ }+ // alint-expect+ cursor[input.path.at(-1)!] = input.value;+};diff --git a/packages/alint/fixtures/no-prototype-pollution/bad-imported-keys.ts b/packages/alint/fixtures/no-prototype-pollution/bad-imported-keys.tsnew file mode 100644index 00000000000..e28b457520c--- /dev/null+++ b/packages/alint/fixtures/no-prototype-pollution/bad-imported-keys.ts@@ -0,0 +1,9 @@+export const importPreferences = (input: { json: string }) => {+ const preferences: Record<string, unknown> = {};+ const imported = JSON.parse(input.json) as Record<string, unknown>;+ for (const [key, value] of Object.entries(imported)) {+ // alint-expect+ preferences[key] = value;+ }+ return preferences;+};diff --git a/packages/alint/fixtures/no-prototype-pollution/good-closed-keys.ts b/packages/alint/fixtures/no-prototype-pollution/good-closed-keys.tsnew file mode 100644index 00000000000..67f15cdac8b--- /dev/null+++ b/packages/alint/fixtures/no-prototype-pollution/good-closed-keys.ts@@ -0,0 +1,9 @@+export const importPreferences = (input: { json: string }) => {+ const preferences: Record<string, unknown> = {};+ const imported = JSON.parse(input.json) as Record<string, unknown>;+ for (const [key, value] of Object.entries(imported)) {+ if (key !== 'theme' && key !== 'language') continue;+ preferences[key] = value;+ }+ return preferences;+};diff --git a/packages/alint/fixtures/no-prototype-pollution/good-map.ts b/packages/alint/fixtures/no-prototype-pollution/good-map.tsnew file mode 100644index 00000000000..1702b39d47e--- /dev/null+++ b/packages/alint/fixtures/no-prototype-pollution/good-map.ts@@ -0,0 +1,6 @@+export const importPreferences = (input: { json: string }) => {+ const preferences = new Map<string, unknown>();+ const imported = JSON.parse(input.json) as Record<string, unknown>;+ for (const [key, value] of Object.entries(imported)) preferences.set(key, value);+ return preferences;+};diff --git a/packages/alint/fixtures/no-prototype-pollution/good-null-prototype.ts b/packages/alint/fixtures/no-prototype-pollution/good-null-prototype.tsnew file mode 100644index 00000000000..6db890f7864--- /dev/null+++ b/packages/alint/fixtures/no-prototype-pollution/good-null-prototype.ts@@ -0,0 +1,6 @@+export const importPreferences = (input: { json: string }) => {+ const preferences: Record<string, unknown> = Object.create(null);+ const imported = JSON.parse(input.json) as Record<string, unknown>;+ for (const [key, value] of Object.entries(imported)) preferences[key] = value;+ return preferences;+};diff --git a/packages/alint/fixtures/no-prototype-pollution/good-object-spread.ts b/packages/alint/fixtures/no-prototype-pollution/good-object-spread.tsnew file mode 100644index 00000000000..ede1089fecc--- /dev/null+++ b/packages/alint/fixtures/no-prototype-pollution/good-object-spread.ts@@ -0,0 +1 @@+export const importPreferences = (input: { json: string }) => ({ ...JSON.parse(input.json) });diff --git a/packages/alint/fixtures/no-secret-exposure/bad-list-credentials.ts b/packages/alint/fixtures/no-secret-exposure/bad-list-credentials.tsnew file mode 100644index 00000000000..7ae6ea34f94--- /dev/null+++ b/packages/alint/fixtures/no-secret-exposure/bad-list-credentials.ts@@ -0,0 +1,9 @@+import { credentialVault } from './vault';++export const listChannels = async () => {+ const credentials = await credentialVault.decryptAll();+ // alint-expect+ return Response.json({+ channels: credentials.map((row) => ({ id: row.id, botToken: row.botToken })),+ });+};diff --git a/packages/alint/fixtures/no-secret-exposure/bad-log-credentials.ts b/packages/alint/fixtures/no-secret-exposure/bad-log-credentials.tsnew file mode 100644index 00000000000..dfe35679f59--- /dev/null+++ b/packages/alint/fixtures/no-secret-exposure/bad-log-credentials.ts@@ -0,0 +1,4 @@+export const configureProvider = (input: { apiKey: string }) => {+ // alint-expect+ console.info('Provider configuration', { apiKey: input.apiKey });+};diff --git a/packages/alint/fixtures/no-secret-exposure/bad-public-config.ts b/packages/alint/fixtures/no-secret-exposure/bad-public-config.tsnew file mode 100644index 00000000000..154c9937d2c--- /dev/null+++ b/packages/alint/fixtures/no-secret-exposure/bad-public-config.ts@@ -0,0 +1,4 @@+export const browserBootstrap = () => {+ // alint-expect+ return Response.json({ apiKey: process.env.PROVIDER_API_KEY });+};diff --git a/packages/alint/fixtures/no-secret-exposure/good-claims-metadata.ts b/packages/alint/fixtures/no-secret-exposure/good-claims-metadata.tsnew file mode 100644index 00000000000..94f9a26fec0--- /dev/null+++ b/packages/alint/fixtures/no-secret-exposure/good-claims-metadata.ts@@ -0,0 +1,3 @@+export const logIdentity = (claims: { aud: string; client_id: string; sub: string }) => {+ console.info('Verified identity', claims);+};diff --git a/packages/alint/fixtures/no-secret-exposure/good-opaque-error.ts b/packages/alint/fixtures/no-secret-exposure/good-opaque-error.tsnew file mode 100644index 00000000000..175479b341b--- /dev/null+++ b/packages/alint/fixtures/no-secret-exposure/good-opaque-error.ts@@ -0,0 +1,10 @@+import { verifyToken } from './auth';++export const authenticate = async (token: string) => {+ try {+ return await verifyToken(token);+ } catch (error) {+ console.error('Token validation failed', error);+ throw error;+ }+};diff --git a/packages/alint/fixtures/no-secret-exposure/good-owner-token-issuance.ts b/packages/alint/fixtures/no-secret-exposure/good-owner-token-issuance.tsnew file mode 100644index 00000000000..a9fa19d79d4--- /dev/null+++ b/packages/alint/fixtures/no-secret-exposure/good-owner-token-issuance.ts@@ -0,0 +1,8 @@+import { requireAuthenticatedUser, tokenService } from './auth';++// Intentional credential issuance to its authenticated owner.+export const issueToken = async (request: Request) => {+ const user = await requireAuthenticatedUser(request);+ const token = await tokenService.issue(user.id);+ return Response.json({ token });+};diff --git a/packages/alint/fixtures/no-secret-exposure/good-redacted-log.ts b/packages/alint/fixtures/no-secret-exposure/good-redacted-log.tsnew file mode 100644index 00000000000..4521e22e469--- /dev/null+++ b/packages/alint/fixtures/no-secret-exposure/good-redacted-log.ts@@ -0,0 +1,6 @@+export const configureProvider = (input: { apiKey: string }) => {+ console.info('Provider configuration', {+ hasApiKey: Boolean(input.apiKey),+ apiKey: '[REDACTED]',+ });+};diff --git a/packages/alint/fixtures/no-shell-command-injection/bad-exec-interpolation.ts b/packages/alint/fixtures/no-shell-command-injection/bad-exec-interpolation.tsnew file mode 100644index 00000000000..a08c5a644c5--- /dev/null+++ b/packages/alint/fixtures/no-shell-command-injection/bad-exec-interpolation.ts@@ -0,0 +1,6 @@+import { exec } from 'node:child_process';++export const convertUpload = (input: { filename: string }) => {+ // alint-expect+ return exec(`convert "${input.filename}" output.png`);+};diff --git a/packages/alint/fixtures/no-shell-command-injection/bad-shell-argument.ts b/packages/alint/fixtures/no-shell-command-injection/bad-shell-argument.tsnew file mode 100644index 00000000000..775edfea842--- /dev/null+++ b/packages/alint/fixtures/no-shell-command-injection/bad-shell-argument.ts@@ -0,0 +1,6 @@+import { spawn } from 'node:child_process';++export const lookup = (input: { query: string }) => {+ // alint-expect+ return spawn('bash', ['-c', `grep ${input.query} index.txt`]);+};diff --git a/packages/alint/fixtures/no-shell-command-injection/bad-shell-option.ts b/packages/alint/fixtures/no-shell-command-injection/bad-shell-option.tsnew file mode 100644index 00000000000..13e29489db2--- /dev/null+++ b/packages/alint/fixtures/no-shell-command-injection/bad-shell-option.ts@@ -0,0 +1,6 @@+import { spawn } from 'node:child_process';++export const inspectUpload = (input: { filename: string }) => {+ // alint-expect+ return spawn('file', [input.filename], { shell: true });+};diff --git a/packages/alint/fixtures/no-shell-command-injection/good-approved-terminal.ts b/packages/alint/fixtures/no-shell-command-injection/good-approved-terminal.tsnew file mode 100644index 00000000000..e8ff2d9be32--- /dev/null+++ b/packages/alint/fixtures/no-shell-command-injection/good-approved-terminal.ts@@ -0,0 +1,9 @@+import { spawn } from 'node:child_process';++import { requireExecutionApproval } from './executionPolicy';++// Intentional agent terminal: execution policy authorizes the exact command before dispatch.+export const runTerminal = async (input: { command: string }) => {+ await requireExecutionApproval(input.command);+ return spawn('bash', ['-c', input.command]);+};diff --git a/packages/alint/fixtures/no-shell-command-injection/good-argument-array.ts b/packages/alint/fixtures/no-shell-command-injection/good-argument-array.tsnew file mode 100644index 00000000000..3140cb31928--- /dev/null+++ b/packages/alint/fixtures/no-shell-command-injection/good-argument-array.ts@@ -0,0 +1,4 @@+import { execFile } from 'node:child_process';++export const lookup = (input: { query: string }) =>+ execFile('grep', ['--', input.query, 'index.txt'], { shell: false });diff --git a/packages/alint/fixtures/no-shell-command-injection/good-base64-data.ts b/packages/alint/fixtures/no-shell-command-injection/good-base64-data.tsnew file mode 100644index 00000000000..fd9dd637448--- /dev/null+++ b/packages/alint/fixtures/no-shell-command-injection/good-base64-data.ts@@ -0,0 +1,6 @@+import { exec } from 'node:child_process';++export const encodeInput = (input: { text: string }) => {+ const encoded = Buffer.from(input.text).toString('base64');+ return exec(`printf '%s' '${encoded}'`);+};diff --git a/packages/alint/fixtures/no-shell-command-injection/good-fixed-command.ts b/packages/alint/fixtures/no-shell-command-injection/good-fixed-command.tsnew file mode 100644index 00000000000..9dda839b902--- /dev/null+++ b/packages/alint/fixtures/no-shell-command-injection/good-fixed-command.ts@@ -0,0 +1,3 @@+import { exec } from 'node:child_process';++export const version = () => exec('git --version');diff --git a/packages/alint/fixtures/no-shell-command-injection/good-generated-path.ts b/packages/alint/fixtures/no-shell-command-injection/good-generated-path.tsnew file mode 100644index 00000000000..8feaee29ff4--- /dev/null+++ b/packages/alint/fixtures/no-shell-command-injection/good-generated-path.ts@@ -0,0 +1,6 @@+import { exec } from 'node:child_process';++export const inspectGeneratedFile = () => {+ const filePath = `/tmp/generated-${Date.now()}.txt`;+ return exec(`cat '${filePath}'`);+};diff --git a/packages/alint/fixtures/no-shell-command-injection/good-posix-escaping.ts b/packages/alint/fixtures/no-shell-command-injection/good-posix-escaping.tsnew file mode 100644index 00000000000..90c3c21c30d--- /dev/null+++ b/packages/alint/fixtures/no-shell-command-injection/good-posix-escaping.ts@@ -0,0 +1,6 @@+import { execFile } from 'node:child_process';++const quote = (value: string) => "'" + value.replaceAll("'", "'\\''") + "'";++export const inspectUpload = (input: { filename: string }) =>+ execFile('/bin/sh', ['-c', `cat -- ${quote(input.filename)}`]);diff --git a/packages/alint/fixtures/no-shell-command-injection/good-remote-terminal.ts b/packages/alint/fixtures/no-shell-command-injection/good-remote-terminal.tsnew file mode 100644index 00000000000..37f822e6eb0--- /dev/null+++ b/packages/alint/fixtures/no-shell-command-injection/good-remote-terminal.ts@@ -0,0 +1,5 @@+import { remoteSandbox } from './sandbox';++// Intentional arbitrary-command execution in an isolated remote sandbox.+export const runCommand = (input: { command: string }) =>+ remoteSandbox.execTerminal(`cd /workspace && ${input.command}`);diff --git a/packages/alint/fixtures/no-unsafe-html-execution/bad-artifact-frame.ts b/packages/alint/fixtures/no-unsafe-html-execution/bad-artifact-frame.tsnew file mode 100644index 00000000000..a2ddbd44913--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-html-execution/bad-artifact-frame.ts@@ -0,0 +1,5 @@+export const renderArtifact = (frame: HTMLIFrameElement, input: { html: string }) => {+ frame.setAttribute('sandbox', 'allow-scripts allow-same-origin');+ // alint-expect+ frame.srcdoc = input.html;+};diff --git a/packages/alint/fixtures/no-unsafe-html-execution/bad-inner-html.ts b/packages/alint/fixtures/no-unsafe-html-execution/bad-inner-html.tsnew file mode 100644index 00000000000..befcd6e1b3f--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-html-execution/bad-inner-html.ts@@ -0,0 +1,4 @@+export const renderMessage = (element: HTMLElement, input: { modelHtml: string }) => {+ // alint-expect+ element.innerHTML = input.modelHtml;+};diff --git a/packages/alint/fixtures/no-unsafe-html-execution/bad-regex-sanitizer.ts b/packages/alint/fixtures/no-unsafe-html-execution/bad-regex-sanitizer.tsnew file mode 100644index 00000000000..a4964434833--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-html-execution/bad-regex-sanitizer.ts@@ -0,0 +1,5 @@+export const renderHtml = (element: HTMLElement, input: { html: string }) => {+ const cleaned = input.html.replaceAll(/<script[\s\S]*?<\/script>/gi, '');+ // alint-expect+ element.innerHTML = cleaned;+};diff --git a/packages/alint/fixtures/no-unsafe-html-execution/good-isolated-artifact.ts b/packages/alint/fixtures/no-unsafe-html-execution/good-isolated-artifact.tsnew file mode 100644index 00000000000..50f4f448126--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-html-execution/good-isolated-artifact.ts@@ -0,0 +1,4 @@+export const renderArtifact = (frame: HTMLIFrameElement, input: { html: string }) => {+ frame.setAttribute('sandbox', 'allow-scripts');+ frame.srcdoc = input.html;+};diff --git a/packages/alint/fixtures/no-unsafe-html-execution/good-sanitized-html.ts b/packages/alint/fixtures/no-unsafe-html-execution/good-sanitized-html.tsnew file mode 100644index 00000000000..13c830463c7--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-html-execution/good-sanitized-html.ts@@ -0,0 +1,5 @@+import DOMPurify from 'dompurify';++export const renderMessage = (element: HTMLElement, input: { html: string }) => {+ element.innerHTML = DOMPurify.sanitize(input.html);+};diff --git a/packages/alint/fixtures/no-unsafe-html-execution/good-text-content.ts b/packages/alint/fixtures/no-unsafe-html-execution/good-text-content.tsnew file mode 100644index 00000000000..f409b3a06b7--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-html-execution/good-text-content.ts@@ -0,0 +1,3 @@+export const renderMessage = (element: HTMLElement, input: { text: string }) => {+ element.textContent = input.text;+};diff --git a/packages/alint/fixtures/no-unsafe-raw-sql/bad-raw-order.ts b/packages/alint/fixtures/no-unsafe-raw-sql/bad-raw-order.tsnew file mode 100644index 00000000000..b27539fe496--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-raw-sql/bad-raw-order.ts@@ -0,0 +1,8 @@+import { sql } from 'drizzle-orm';++import { db } from './database';++export const list = (input: { sort: string }) => {+ // alint-expect+ return db.execute(sql.raw(`SELECT id FROM topics ORDER BY ${input.sort}`));+};diff --git a/packages/alint/fixtures/no-unsafe-raw-sql/bad-raw-value.ts b/packages/alint/fixtures/no-unsafe-raw-sql/bad-raw-value.tsnew file mode 100644index 00000000000..3c039b38c13--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-raw-sql/bad-raw-value.ts@@ -0,0 +1,8 @@+import { sql } from 'drizzle-orm';++import { db } from './database';++export const search = (input: { title: string }) => {+ // alint-expect+ return db.execute(sql.raw(`SELECT id FROM topics WHERE title = '${input.title}'`));+};diff --git a/packages/alint/fixtures/no-unsafe-raw-sql/good-identifier-allowlist.ts b/packages/alint/fixtures/no-unsafe-raw-sql/good-identifier-allowlist.tsnew file mode 100644index 00000000000..453401b14ed--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-raw-sql/good-identifier-allowlist.ts@@ -0,0 +1,8 @@+import { sql } from 'drizzle-orm';++import { db } from './database';++export const list = (input: { sort: string }) => {+ if (input.sort !== 'title' && input.sort !== 'created_at') throw new Error('Invalid sort');+ return db.execute(sql.raw(`SELECT id FROM topics ORDER BY ${input.sort}`));+};diff --git a/packages/alint/fixtures/no-unsafe-raw-sql/good-parameterized.ts b/packages/alint/fixtures/no-unsafe-raw-sql/good-parameterized.tsnew file mode 100644index 00000000000..a9db83d865d--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-raw-sql/good-parameterized.ts@@ -0,0 +1,6 @@+import { sql } from 'drizzle-orm';++import { db } from './database';++export const search = (input: { title: string }) =>+ db.execute(sql`SELECT id FROM topics WHERE title = ${input.title}`);diff --git a/packages/alint/fixtures/no-unsafe-user-url-fetch/bad-import-url.ts b/packages/alint/fixtures/no-unsafe-user-url-fetch/bad-import-url.tsnew file mode 100644index 00000000000..231e846bf80--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-user-url-fetch/bad-import-url.ts@@ -0,0 +1,5 @@+export const importSkill = async (input: { url: string }) => {+ // alint-expect+ const response = await fetch(input.url);+ return response.text();+};diff --git a/packages/alint/fixtures/no-unsafe-user-url-fetch/bad-protocol-only.ts b/packages/alint/fixtures/no-unsafe-user-url-fetch/bad-protocol-only.tsnew file mode 100644index 00000000000..79d22de12c2--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-user-url-fetch/bad-protocol-only.ts@@ -0,0 +1,6 @@+export const downloadCover = async (input: { url: string }) => {+ const target = new URL(input.url);+ if (target.protocol !== 'https:') throw new Error('HTTPS required');+ // alint-expect+ return fetch(target);+};diff --git a/packages/alint/fixtures/no-unsafe-user-url-fetch/good-admin-config.ts b/packages/alint/fixtures/no-unsafe-user-url-fetch/good-admin-config.tsnew file mode 100644index 00000000000..bb196c17f7d--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-user-url-fetch/good-admin-config.ts@@ -0,0 +1 @@+export const health = async () => fetch(process.env.INTERNAL_HEALTH_URL!);diff --git a/packages/alint/fixtures/no-unsafe-user-url-fetch/good-fixed-origin.ts b/packages/alint/fixtures/no-unsafe-user-url-fetch/good-fixed-origin.tsnew file mode 100644index 00000000000..aba88156b27--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-user-url-fetch/good-fixed-origin.ts@@ -0,0 +1,2 @@+export const lookup = async (input: { query: string }) =>+ fetch(`https://api.example.com/search?q=${encodeURIComponent(input.query)}`);diff --git a/packages/alint/fixtures/no-unsafe-user-url-fetch/good-remote-sandbox.ts b/packages/alint/fixtures/no-unsafe-user-url-fetch/good-remote-sandbox.tsnew file mode 100644index 00000000000..fcfa84624de--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-user-url-fetch/good-remote-sandbox.ts@@ -0,0 +1,6 @@+// The host fetches a fixed service endpoint; the URL is data for the isolated sandbox.+export const remoteFetch = (input: { url: string }) =>+ fetch('https://sandbox.example.com/run', {+ body: JSON.stringify({ tool: 'fetch', url: input.url }),+ method: 'POST',+ });diff --git a/packages/alint/fixtures/no-unsafe-user-url-fetch/good-safe-transport.ts b/packages/alint/fixtures/no-unsafe-user-url-fetch/good-safe-transport.tsnew file mode 100644index 00000000000..f443f09874e--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-user-url-fetch/good-safe-transport.ts@@ -0,0 +1,3 @@+import { ssrfSafeFetch } from '@lobechat/ssrf-safe-fetch';++export const importSkill = async (input: { url: string }) => ssrfSafeFetch(input.url);diff --git a/packages/alint/fixtures/no-unsafe-user-url-fetch/good-unknown-provenance.ts b/packages/alint/fixtures/no-unsafe-user-url-fetch/good-unknown-provenance.tsnew file mode 100644index 00000000000..f128688272f--- /dev/null+++ b/packages/alint/fixtures/no-unsafe-user-url-fetch/good-unknown-provenance.ts@@ -0,0 +1 @@+export const transport = async (url: string) => fetch(url);diff --git a/packages/alint/fixtures/no-unscoped-resource-mutation/bad-delete-membership.ts b/packages/alint/fixtures/no-unscoped-resource-mutation/bad-delete-membership.tsnew file mode 100644index 00000000000..f11f01bf348--- /dev/null+++ b/packages/alint/fixtures/no-unscoped-resource-mutation/bad-delete-membership.ts@@ -0,0 +1,19 @@+import { and, eq, inArray } from 'drizzle-orm';++import { type Database, memberships } from './schema';++export class GroupModel {+ constructor(+ private db: Database,+ private userId: string,+ ) {}++ remove(groupId: string, agentIds: string[]) {+ return (+ this.db+ .delete(memberships)+ // alint-expect+ .where(and(eq(memberships.groupId, groupId), inArray(memberships.agentId, agentIds)))+ );+ }+}diff --git a/packages/alint/fixtures/no-unscoped-resource-mutation/bad-link-target.ts b/packages/alint/fixtures/no-unscoped-resource-mutation/bad-link-target.tsnew file mode 100644index 00000000000..270cd58c4d1--- /dev/null+++ b/packages/alint/fixtures/no-unscoped-resource-mutation/bad-link-target.ts@@ -0,0 +1,25 @@+import { and, eq, inArray } from 'drizzle-orm';++import { type Database, files, knowledgeBaseFiles } from './schema';++export class KnowledgeBaseModel {+ constructor(+ private db: Database,+ private userId: string,+ ) {}++ async addFiles(knowledgeBaseId: string, fileIds: string[]) {+ const ownedFiles = await this.db+ .select()+ .from(files)+ .where(and(eq(files.userId, this.userId), inArray(files.id, fileIds)));+ return (+ this.db+ .insert(knowledgeBaseFiles)+ // alint-expect+ .values(+ ownedFiles.map((file) => ({ fileId: file.id, knowledgeBaseId, userId: this.userId })),+ )+ );+ }+}diff --git a/packages/alint/fixtures/no-unscoped-resource-mutation/good-copy-authorized-parent.ts b/packages/alint/fixtures/no-unscoped-resource-mutation/good-copy-authorized-parent.tsnew file mode 100644index 00000000000..46e0c5a569d--- /dev/null+++ b/packages/alint/fixtures/no-unscoped-resource-mutation/good-copy-authorized-parent.ts@@ -0,0 +1,29 @@+import { and, eq } from 'drizzle-orm';++import { type Database, groups, memberships } from './schema';++export class GroupModel {+ constructor(+ private db: Database,+ private userId: string,+ ) {}++ async duplicate(groupId: string) {+ const source = await this.db.query.groups.findFirst({+ where: and(eq(groups.id, groupId), eq(groups.userId, this.userId)),+ });+ if (!source) return;+ const members = await this.db+ .select()+ .from(memberships)+ .where(eq(memberships.groupId, source.id));+ const [copy] = await this.db.insert(groups).values({ userId: this.userId }).returning();+ return this.db.insert(memberships).values(+ members.map((member) => ({+ agentId: member.agentId,+ groupId: copy.id,+ userId: this.userId,+ })),+ );+ }+}diff --git a/packages/alint/fixtures/no-unscoped-resource-mutation/good-cross-scope-primitive.ts b/packages/alint/fixtures/no-unscoped-resource-mutation/good-cross-scope-primitive.tsnew file mode 100644index 00000000000..1be08730d95--- /dev/null+++ b/packages/alint/fixtures/no-unscoped-resource-mutation/good-cross-scope-primitive.ts@@ -0,0 +1,15 @@+import { eq } from 'drizzle-orm';++import { bindings, type Database } from './schema';++export class BindingModel {+ constructor(+ private db: Database,+ private userId: string,+ ) {}++ /** Privileged cross-scope primitive. Caller MUST authorize the row before calling. */+ deleteAcrossScopes(id: string) {+ return this.db.delete(bindings).where(eq(bindings.id, id));+ }+}diff --git a/packages/alint/fixtures/no-unscoped-resource-mutation/good-global-maintenance.ts b/packages/alint/fixtures/no-unscoped-resource-mutation/good-global-maintenance.tsnew file mode 100644index 00000000000..62a823b0a16--- /dev/null+++ b/packages/alint/fixtures/no-unscoped-resource-mutation/good-global-maintenance.ts@@ -0,0 +1,7 @@+import { lt } from 'drizzle-orm';++import { db, publicCatalogCache } from './schema';++// System maintenance of shared public catalog cache; no user-owned data.+export const purgeExpiredCache = async (now: Date) =>+ db.delete(publicCatalogCache).where(lt(publicCatalogCache.expiresAt, now));diff --git a/packages/alint/fixtures/no-unscoped-resource-mutation/good-parent-guard.ts b/packages/alint/fixtures/no-unscoped-resource-mutation/good-parent-guard.tsnew file mode 100644index 00000000000..685d03b823c--- /dev/null+++ b/packages/alint/fixtures/no-unscoped-resource-mutation/good-parent-guard.ts@@ -0,0 +1,18 @@+import { and, eq } from 'drizzle-orm';++import { type Database, groups, memberships } from './schema';++export class GroupModel {+ constructor(+ private db: Database,+ private userId: string,+ ) {}++ async removeMembers(groupId: string) {+ const group = await this.db.query.groups.findFirst({+ where: and(eq(groups.id, groupId), eq(groups.userId, this.userId)),+ });+ if (!group) throw new Error('Forbidden');+ return this.db.delete(memberships).where(eq(memberships.groupId, group.id));+ }+}diff --git a/packages/alint/fixtures/no-unscoped-resource-mutation/good-scoped-junction-delete.ts b/packages/alint/fixtures/no-unscoped-resource-mutation/good-scoped-junction-delete.tsnew file mode 100644index 00000000000..d7ac72d9a99--- /dev/null+++ b/packages/alint/fixtures/no-unscoped-resource-mutation/good-scoped-junction-delete.ts@@ -0,0 +1,23 @@+import { and, eq, inArray } from 'drizzle-orm';++import { buildWorkspaceWhere, type Database, memberships } from './schema';++export class GroupModel {+ constructor(+ private db: Database,+ private userId: string,+ private workspaceId: string,+ ) {}++ remove(groupId: string, agentIds: string[]) {+ return this.db+ .delete(memberships)+ .where(+ and(+ buildWorkspaceWhere({ userId: this.userId, workspaceId: this.workspaceId }, memberships),+ eq(memberships.groupId, groupId),+ inArray(memberships.agentId, agentIds),+ ),+ );+ }+}diff --git a/packages/alint/fixtures/no-unscoped-resource-mutation/good-static-bookkeeping.ts b/packages/alint/fixtures/no-unscoped-resource-mutation/good-static-bookkeeping.tsnew file mode 100644index 00000000000..1779e0a5852--- /dev/null+++ b/packages/alint/fixtures/no-unscoped-resource-mutation/good-static-bookkeeping.ts@@ -0,0 +1,12 @@+import { eq } from 'drizzle-orm';++import { type Database, jobs } from './schema';++export class JobModel {+ constructor(private userId: string) {}++ // Background scheduler bookkeeping after executing an already-selected job.+ static async recordExecution(db: Database, jobId: string) {+ return db.update(jobs).set({ lastExecutedAt: new Date() }).where(eq(jobs.id, jobId));+ }+}diff --git a/packages/alint/fixtures/no-unscoped-resource-mutation/good-workspace-scope.ts b/packages/alint/fixtures/no-unscoped-resource-mutation/good-workspace-scope.tsnew file mode 100644index 00000000000..30aea3c1645--- /dev/null+++ b/packages/alint/fixtures/no-unscoped-resource-mutation/good-workspace-scope.ts@@ -0,0 +1,22 @@+import { and, eq } from 'drizzle-orm';++import { buildWorkspaceWhere, type Database, groups } from './schema';++export class GroupModel {+ constructor(+ private db: Database,+ private userId: string,+ private workspaceId: string,+ ) {}++ remove(id: string) {+ return this.db+ .delete(groups)+ .where(+ and(+ eq(groups.id, id),+ buildWorkspaceWhere({ userId: this.userId, workspaceId: this.workspaceId }, groups),+ ),+ );+ }+}diff --git a/packages/alint/fixtures/no-untrusted-code-execution/bad-generated-function.ts b/packages/alint/fixtures/no-untrusted-code-execution/bad-generated-function.tsnew file mode 100644index 00000000000..02ca639f8ea--- /dev/null+++ b/packages/alint/fixtures/no-untrusted-code-execution/bad-generated-function.ts@@ -0,0 +1,5 @@+export const runModelTransform = (input: { modelGeneratedCode: string; value: string }) => {+ // alint-expect+ const transform = new Function('value', input.modelGeneratedCode);+ return transform(input.value);+};diff --git a/packages/alint/fixtures/no-untrusted-code-execution/bad-interpreter-code.ts b/packages/alint/fixtures/no-untrusted-code-execution/bad-interpreter-code.tsnew file mode 100644index 00000000000..bdf107d9ae4--- /dev/null+++ b/packages/alint/fixtures/no-untrusted-code-execution/bad-interpreter-code.ts@@ -0,0 +1,6 @@+import { execFile } from 'node:child_process';++export const runGeneratedCode = (input: { modelCode: string }) => {+ // alint-expect+ return execFile('node', ['-e', input.modelCode]);+};diff --git a/packages/alint/fixtures/no-untrusted-code-execution/bad-vm-sandbox.ts b/packages/alint/fixtures/no-untrusted-code-execution/bad-vm-sandbox.tsnew file mode 100644index 00000000000..8bdabfd3624--- /dev/null+++ b/packages/alint/fixtures/no-untrusted-code-execution/bad-vm-sandbox.ts@@ -0,0 +1,6 @@+import vm from 'node:vm';++export const evaluateRequest = (input: { code: string }) => {+ // alint-expect+ return vm.runInNewContext(input.code, {});+};diff --git a/packages/alint/fixtures/no-untrusted-code-execution/good-data-parser.ts b/packages/alint/fixtures/no-untrusted-code-execution/good-data-parser.tsnew file mode 100644index 00000000000..2fe354b1db5--- /dev/null+++ b/packages/alint/fixtures/no-untrusted-code-execution/good-data-parser.ts@@ -0,0 +1 @@+export const parseRequest = (input: { json: string }) => JSON.parse(input.json);diff --git a/packages/alint/fixtures/no-untrusted-code-execution/good-isolated-runtime.ts b/packages/alint/fixtures/no-untrusted-code-execution/good-isolated-runtime.tsnew file mode 100644index 00000000000..8ed1ecbb5a6--- /dev/null+++ b/packages/alint/fixtures/no-untrusted-code-execution/good-isolated-runtime.ts@@ -0,0 +1,7 @@+import { requireExecutionApproval } from './executionPolicy';+import { remoteSandbox } from './sandbox';++export const runModelCode = async (input: { modelGeneratedCode: string }) => {+ await requireExecutionApproval(input.modelGeneratedCode);+ return remoteSandbox.execute({ code: input.modelGeneratedCode, network: false });+};diff --git a/packages/alint/fixtures/no-untrusted-path-io/bad-archive-entry.ts b/packages/alint/fixtures/no-untrusted-path-io/bad-archive-entry.tsnew file mode 100644index 00000000000..6eace6afb3c--- /dev/null+++ b/packages/alint/fixtures/no-untrusted-path-io/bad-archive-entry.ts@@ -0,0 +1,8 @@+import { writeFile } from 'node:fs/promises';+import path from 'node:path';++export const extractEntry = async (entry: { data: Uint8Array; name: string }) => {+ const target = path.resolve('/tmp/extracted', entry.name);+ // alint-expect+ await writeFile(target, entry.data);+};diff --git a/packages/alint/fixtures/no-untrusted-path-io/bad-prefix-check.ts b/packages/alint/fixtures/no-untrusted-path-io/bad-prefix-check.tsnew file mode 100644index 00000000000..35ae448e0ec--- /dev/null+++ b/packages/alint/fixtures/no-untrusted-path-io/bad-prefix-check.ts@@ -0,0 +1,10 @@+import { readFile } from 'node:fs/promises';+import path from 'node:path';++export const readAttachment = async (input: { path: string }) => {+ const root = '/srv/attachments';+ const target = path.resolve(root, input.path);+ if (!target.startsWith(root)) throw new Error('Forbidden');+ // alint-expect+ return readFile(target);+};diff --git a/packages/alint/fixtures/no-untrusted-path-io/bad-upload-name.ts b/packages/alint/fixtures/no-untrusted-path-io/bad-upload-name.tsnew file mode 100644index 00000000000..14166107475--- /dev/null+++ b/packages/alint/fixtures/no-untrusted-path-io/bad-upload-name.ts@@ -0,0 +1,8 @@+import { writeFile } from 'node:fs/promises';+import path from 'node:path';++export const saveUpload = async (upload: { data: Uint8Array; name: string }) => {+ const target = path.join('/tmp/uploads', upload.name);+ // alint-expect+ await writeFile(target, upload.data);+};diff --git a/packages/alint/fixtures/no-untrusted-path-io/good-authorized-tool.ts b/packages/alint/fixtures/no-untrusted-path-io/good-authorized-tool.tsnew file mode 100644index 00000000000..b205b34755b--- /dev/null+++ b/packages/alint/fixtures/no-untrusted-path-io/good-authorized-tool.ts@@ -0,0 +1,8 @@+import { readFile } from 'node:fs/promises';++import { assertApprovedPath } from './approvedRoots';++export const readWorkspaceFile = async (input: { path: string }) => {+ await assertApprovedPath(input.path);+ return readFile(input.path);+};diff --git a/packages/alint/fixtures/no-untrusted-path-io/good-flat-temp.ts b/packages/alint/fixtures/no-untrusted-path-io/good-flat-temp.tsnew file mode 100644index 00000000000..cd4cbbad6b1--- /dev/null+++ b/packages/alint/fixtures/no-untrusted-path-io/good-flat-temp.ts@@ -0,0 +1,8 @@+import { mkdtemp, writeFile } from 'node:fs/promises';+import { tmpdir } from 'node:os';+import path from 'node:path';++export const saveUpload = async (upload: { data: Uint8Array; name: string }) => {+ const root = await mkdtemp(path.join(tmpdir(), 'upload-'));+ await writeFile(path.join(root, path.basename(upload.name)), upload.data);+};diff --git a/packages/alint/fixtures/no-untrusted-path-io/good-generated-name.ts b/packages/alint/fixtures/no-untrusted-path-io/good-generated-name.tsnew file mode 100644index 00000000000..87ef9d999ce--- /dev/null+++ b/packages/alint/fixtures/no-untrusted-path-io/good-generated-name.ts@@ -0,0 +1,7 @@+import { randomUUID } from 'node:crypto';+import { writeFile } from 'node:fs/promises';+import path from 'node:path';++export const saveUpload = async (upload: { data: Uint8Array; name: string }) => {+ await writeFile(path.join('/tmp/uploads', `${randomUUID()}.bin`), upload.data);+};diff --git a/packages/alint/fixtures/no-untrusted-path-io/good-path-only.ts b/packages/alint/fixtures/no-untrusted-path-io/good-path-only.tsnew file mode 100644index 00000000000..fa48dc6e18f--- /dev/null+++ b/packages/alint/fixtures/no-untrusted-path-io/good-path-only.ts@@ -0,0 +1,5 @@+import path from 'node:path';++// No IO here: the consuming boundary must authorize/confine before accessing files.+export const resolveAttachmentPath = (input: { path: string }) =>+ path.resolve('/srv/attachments', input.path);diff --git a/packages/alint/fixtures/no-untrusted-path-io/good-relative-guard.ts b/packages/alint/fixtures/no-untrusted-path-io/good-relative-guard.tsnew file mode 100644index 00000000000..aaeb4e0c7b1--- /dev/null+++ b/packages/alint/fixtures/no-untrusted-path-io/good-relative-guard.ts@@ -0,0 +1,13 @@+import { readFile } from 'node:fs/promises';+import path from 'node:path';++// Private application-owned directory; remote users cannot create symlinks here.+export const readAttachment = async (input: { path: string }) => {+ const root = '/srv/attachments';+ const target = path.resolve(root, input.path);+ const relative = path.relative(root, target);+ if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {+ throw new Error('Forbidden');+ }+ return readFile(target);+};diff --git a/packages/alint/fixtures/no-unvalidated-redirect/bad-query-redirect.ts b/packages/alint/fixtures/no-unvalidated-redirect/bad-query-redirect.tsnew file mode 100644index 00000000000..ee66c459f1d--- /dev/null+++ b/packages/alint/fixtures/no-unvalidated-redirect/bad-query-redirect.ts@@ -0,0 +1,5 @@+export const callback = (request: Request) => {+ const target = new URL(request.url).searchParams.get('returnTo')!;+ // alint-expect+ return Response.redirect(target);+};diff --git a/packages/alint/fixtures/no-unvalidated-redirect/bad-slash-check.ts b/packages/alint/fixtures/no-unvalidated-redirect/bad-slash-check.tsnew file mode 100644index 00000000000..1f2ed767ba2--- /dev/null+++ b/packages/alint/fixtures/no-unvalidated-redirect/bad-slash-check.ts@@ -0,0 +1,5 @@+export const finishLogin = (input: { returnTo: string }) => {+ if (!input.returnTo.startsWith('/')) throw new Error('Local path required');+ // alint-expect+ window.location.assign(input.returnTo);+};diff --git a/packages/alint/fixtures/no-unvalidated-redirect/good-fixed-route.ts b/packages/alint/fixtures/no-unvalidated-redirect/good-fixed-route.tsnew file mode 100644index 00000000000..d8ac220b8c9--- /dev/null+++ b/packages/alint/fixtures/no-unvalidated-redirect/good-fixed-route.ts@@ -0,0 +1,3 @@+export const finishLogin = (input: { topicId: string }) => {+ window.location.assign(`/chat?topic=${encodeURIComponent(input.topicId)}`);+};diff --git a/packages/alint/fixtures/no-unvalidated-redirect/good-origin-check.ts b/packages/alint/fixtures/no-unvalidated-redirect/good-origin-check.tsnew file mode 100644index 00000000000..effbfd67c8b--- /dev/null+++ b/packages/alint/fixtures/no-unvalidated-redirect/good-origin-check.ts@@ -0,0 +1,7 @@+export const callback = (request: Request) => {+ const origin = 'https://app.example.com';+ const raw = new URL(request.url).searchParams.get('returnTo') ?? '/';+ const target = new URL(raw, origin);+ if (target.origin !== origin) throw new Error('Untrusted redirect');+ return Response.redirect(target);+};diff --git a/packages/alint/rules/no-auth-verification-bypass/rule.alint.toml b/packages/alint/rules/no-auth-verification-bypass/rule.alint.tomlnew file mode 100644index 00000000000..b7cf231b4c2--- /dev/null+++ b/packages/alint/rules/no-auth-verification-bypass/rule.alint.toml@@ -0,0 +1,21 @@+name = "no-auth-verification-bypass"+builtInAgent = "basic-structured"+instruction = """+Find authentication bypasses in this file, restricted to the THREE patterns below. Do not perform a general crypto review.++FIRST locate a protected action: a database mutation, account/resource operation, queue dispatch, middleware next() for mandatory signed-event verification, or acceptance of an authenticated identity. If a function merely computes/returns a validation result and performs none of these actions, it is OUT OF SCOPE. Returning false/null/undefined from a validator on failure is a valid failure result, not authorization success. Never assume unseen callers ignore it.++Report ONLY:+1. decodeJwt/jwt.decode/JSON.parse claims used as an authenticated identity (such as deleteAccount(claims.sub) or return { userId: claims.sub }) without signature verification in the visible flow.+2. Mandatory signature verification fails or throws, but this same function demonstrably continues to a protected action with the unverified request payload. A catch that logs and then calls applyPayment(payload) is a violation; a catch that returns undefined is NOT.+3. A handler for signed provider/payment events conditionally skips verification when its required secret/signature is absent, then processes the unverified event. An explicitly optional custom-header policy documented as a no-op when unconfigured is NOT this pattern.++For each candidate trace the exact path past failed/skipped verification to the protected action. Without that path, return no finding. Anchor at that action. Name the bypass and recommend existing verified auth middleware/jwtVerify or awaiting verification and rejecting before effects. Do not include token/secret values.++Examples that must produce NO findings:+- if (computedHmac === suppliedSignature) return JSON.parse(body); else return undefined;+- try { return await verify(token); } catch { return undefined; }+- const payload = await validate(request); if (!payload) return errorResponse; process(payload);+- public health/discovery routes; decoded claims used only for display; helpers with no protected action.+A missing signature cannot equal a computed HMAC string: a comparison mismatch returning undefined is a rejection. Do not ask for a throw instead, or report non-null assertions, optional headers, non-constant-time comparisons, algorithm choices, or token issuance under this rule. Those are not the three targeted bypass patterns.+"""diff --git a/packages/alint/rules/no-privileged-untrusted-electron/rule.alint.toml b/packages/alint/rules/no-privileged-untrusted-electron/rule.alint.tomlnew file mode 100644index 00000000000..59334f5d279--- /dev/null+++ b/packages/alint/rules/no-privileged-untrusted-electron/rule.alint.toml@@ -0,0 +1,10 @@+name = "no-privileged-untrusted-electron"+builtInAgent = "basic-structured"+instruction = """+Review only this file. Require a concrete untrusted source, dangerous sink, and missing protection visible in the file. Follow local aliases and guards. Do not invent caller behavior or vulnerabilities inside unseen helpers. Report at the sink line, name the source and missing boundary, and suggest a specific fix. Do not include secret values or payloads in diagnostics. Findings are review warnings, not claims of proven exploitability.++Prevent remote/user content obtaining Electron/Node capabilities (XSS-to-RCE boundary).+Report BrowserWindow/BrowserView/WebContentsView that visibly loads remote/user content with nodeIntegration:true, contextIsolation:false together with a privileged preload, or webSecurity:false that exposes a privileged app origin. Report a preload contextBridge API exposing raw ipcRenderer.send/invoke, require, or arbitrary host command execution to remote/untrusted frames with no constrained channels/sender/access boundary visible in the file. Report a privileged IPC handler explicitly accepting all remote sender origins before executing host commands. Anchor at the dangerous preference or exposed bridge/handler.+Recommend sandbox:true, nodeIntegration:false, contextIsolation:true for untrusted content; isolate previews from privileged preload; expose narrow typed operations/channel allowlists and validate the sender frame/origin and execution policy in main.+Do not report local trusted app windows solely because they have a preload; no finding for omitted preferences alone (defaults may be secure). Do not report sandbox:false alone without a visible route to privileged capability. Accept narrow per-operation bridges with validated inputs and main-side policy contracts. Intentional approved terminal APIs are not blanket vulnerabilities. Require remote/untrusted provenance or a raw unrestricted capability bridge, not speculative navigation.+"""diff --git a/packages/alint/rules/no-prototype-pollution/rule.alint.toml b/packages/alint/rules/no-prototype-pollution/rule.alint.tomlnew file mode 100644index 00000000000..e32333497e1--- /dev/null+++ b/packages/alint/rules/no-prototype-pollution/rule.alint.toml@@ -0,0 +1,10 @@+name = "no-prototype-pollution"+builtInAgent = "basic-structured"+instruction = """+Review only this file. Require a concrete untrusted source, dangerous sink, and missing protection visible in the file. Follow local aliases and guards. Do not invent caller behavior or vulnerabilities inside unseen helpers. Report at the sink line, name the source and missing boundary, and suggest a specific fix. Do not include secret values or payloads in diagnostics. Findings are review warnings, not claims of proven exploitability.++Prevent untrusted object keys mutating prototypes.+Report request/JSON/imported config keys used in recursive/deep assignment/merge to normal objects with no guard for __proto__, constructor, and prototype path segments, including dynamic target[key] assignment or a user-controlled deep path setter. JSON.parse alone does not pollute prototypes; identify the subsequent mutation. Anchor at the dynamic assignment or unsafe deep-set/merge sink.+Recommend an existing safe merge implementation, a closed allowlist of accepted keys, or rejecting prototype-related segments at every traversed depth; use Map/null-prototype records for arbitrary keys where no traversal into Object.prototype remains possible.+Do not report Object.entries/reads, JSON.parse alone, object spread (does not invoke the __proto__ setter), known patched library merge APIs without a visible unsafe configuration, Map.set, or assignment into Object.create(null) without unsafe nested traversal. A top-level blocklist is insufficient if nested untrusted paths still traverse prototypes. Do not demand a blocklist when a closed schema/key allowlist already excludes dangerous keys.+"""diff --git a/packages/alint/rules/no-secret-exposure/rule.alint.toml b/packages/alint/rules/no-secret-exposure/rule.alint.tomlnew file mode 100644index 00000000000..a7dd685b1c6--- /dev/null+++ b/packages/alint/rules/no-secret-exposure/rule.alint.toml@@ -0,0 +1,12 @@+name = "no-secret-exposure"+builtInAgent = "basic-structured"+instruction = """+Mandatory evidence gate: identify an actual credential field/value flowing to the sink, not merely an object that could hypothetically contain one. JWT payload/sub/aud/client_id claims alone are not access/refresh token credentials. Do not invent credential-bearing claims. Opaque caught errors and error.message are out of scope unless this file explicitly constructs the message with a secret; a secret in the surrounding scope does not prove the error embeds it. Library/parser diagnostic contents require separate review, not a speculative finding from this rule.++Review only this file. Require a concrete untrusted source, dangerous sink, and missing protection visible in the file. Follow local aliases and guards. Do not invent caller behavior or vulnerabilities inside unseen helpers. Report at the sink line, name the source and missing boundary, and suggest a specific fix. Do not include secret values or payloads in diagnostics. Findings are review warnings, not claims of proven exploitability.++Prevent accidental credential exposure through logs, public configuration, or API/list responses. Historical #19452 stopped returning bot credentials from channel lists.+Report explicitly identified passwords, API keys, access/refresh tokens, Authorization/cookie headers, decrypted credential objects, or private signing keys flowing to console/debug/logger output, an ordinary public/list response, or browser-visible config. Also report a server secret assigned into a NEXT_PUBLIC_* config/serialized bootstrap. An entire headers/credential/request object is sensitive when its credential contents are visible. Report literal credentials only when clearly a real credential rather than a placeholder; never reproduce their values.+Recommend a field allowlist for response DTOs, redaction/omission for logs, and keeping server secrets in server-only config. Anchor on logging/return/config exposure, one finding per sink.+Do not report secret presence booleans, identifiers, masked/redacted values, ciphertext stored server-side, env reads alone, token hashes/fingerprints, fixtures/placeholders, or the intentional authenticated credential-issuance/reveal endpoint needed to deliver that credential to its owner. Do not infer secret fields from every spread/object response or every error. Diagnostic messages must contain field names only, never secret contents.+"""diff --git a/packages/alint/rules/no-shell-command-injection/rule.alint.toml b/packages/alint/rules/no-shell-command-injection/rule.alint.tomlnew file mode 100644index 00000000000..8bec05d97b9--- /dev/null+++ b/packages/alint/rules/no-shell-command-injection/rule.alint.toml@@ -0,0 +1,12 @@+name = "no-shell-command-injection"+builtInAgent = "basic-structured"+instruction = """+Mandatory exclusion gate: DO NOT produce a finding unless externally controlled bytes can change shell syntax at this specific sink. Suppress any candidate that your own explanation says is currently safe, only fragile, or might become unsafe after future edits. Standard POSIX single-quote escaping (replace apostrophes with the close/escaped-quote/reopen sequence) is valid even in a local helper; do not demand a third-party library. Base64-only interpolation into quoted shell text is not command injection. Server-generated paths and fixed extension maps are not untrusted. Sending an intentional command to an isolated remote sandbox terminal is expected behavior, not shell injection by itself; require additional data escaping its intended argument role. Do not demand argv conversion of a terminal's intentionally arbitrary command.++Review only this file. Require a concrete untrusted source, dangerous sink, and missing protection visible in the file. Follow local aliases and guards. Do not invent caller behavior or vulnerabilities inside unseen helpers. Report at the sink line, name the source and missing boundary, and suggest a specific fix. Do not include secret values or payloads in diagnostics. Findings are review warnings, not claims of proven exploitability.++Prevent shell-command injection leading to RCE in server, desktop, CLI, and runtime helpers.+Report user/request/remote metadata interpolated or concatenated into child_process.exec/execSync, spawn/execFile with shell:true, execa shell mode, or an explicit sh/bash/cmd/PowerShell -c/-Command command string. An argument array does not protect input that is subsequently interpreted by a shell. Double quotes around interpolation and JSON.stringify are not shell escaping. Shell blacklist regexes are not general escaping.+Recommend a fixed executable with shell disabled and separate arguments; use '--' where the target accepts options. If a shell is required, use an existing platform-appropriate escaping helper and the execution policy/approval boundary.+Do not report fixed literal commands; fixed executable argument arrays with shell disabled and no interpreter; strict enum-to-fixed-command mapping; a demonstrated shell escaping helper used correctly for the target shell; or an intentional agent terminal executor whose visible contract/guard requires approved policy execution. Mere authentication is not shell escaping. Do not label every child_process call unsafe.+"""diff --git a/packages/alint/rules/no-unsafe-html-execution/rule.alint.toml b/packages/alint/rules/no-unsafe-html-execution/rule.alint.tomlnew file mode 100644index 00000000000..988d4486071--- /dev/null+++ b/packages/alint/rules/no-unsafe-html-execution/rule.alint.toml@@ -0,0 +1,10 @@+name = "no-unsafe-html-execution"+builtInAgent = "basic-structured"+instruction = """+Review only this file. Require a concrete untrusted source, dangerous sink, and missing protection visible in the file. Follow local aliases and guards. Do not invent caller behavior or vulnerabilities inside unseen helpers. Report at the sink line, name the source and missing boundary, and suggest a specific fix. Do not include secret values or payloads in diagnostics. Findings are review warnings, not claims of proven exploitability.++Prevent HTML/SVG injection and artifact XSS-to-RCE (historical #13529, GHSA-xq4x-622m-q8fq).+Report user/model/remote HTML reaching innerHTML, outerHTML, insertAdjacentHTML, document.write, dangerouslySetInnerHTML, or iframe srcDoc without appropriate sanitization/isolation. Removing only script tags with regex is insufficient: event attributes and URL schemes remain. For same-origin srcDoc/artifact frames, no sandbox or allow-scripts together with allow-same-origin leaves active content privileged. Report a visible unsafe frame configuration handling untrusted content even if sanitization is also used, when it explicitly restores those privileges.+Recommend the existing sanitizeHTMLContent/sanitizeSVG/DOMPurify helper for HTML sinks, textContent/normal React interpolation for plain text, and a restricted sandbox for artifacts. Preserve intentionally executable previews in an isolated origin/sandbox rather than banning all scripts.+Do not report textContent, escaped text/ordinary JSX interpolation, fixed trusted markup, sanitizer output (unless visibly weakened/bypassed), or an iframe explicitly sandboxed with no same-origin privilege (including sandbox='' or sandbox='allow-scripts' without allow-same-origin). Do not infer that an unknown library renderer is unsafe. Only report the sink/configuration visible here.+"""diff --git a/packages/alint/rules/no-unsafe-raw-sql/rule.alint.toml b/packages/alint/rules/no-unsafe-raw-sql/rule.alint.tomlnew file mode 100644index 00000000000..70b48b57b77--- /dev/null+++ b/packages/alint/rules/no-unsafe-raw-sql/rule.alint.toml@@ -0,0 +1,10 @@+name = "no-unsafe-raw-sql"+builtInAgent = "basic-structured"+instruction = """+Review only this file. Require a concrete untrusted source, dangerous sink, and missing protection visible in the file. Follow local aliases and guards. Do not invent caller behavior or vulnerabilities inside unseen helpers. Report at the sink line, name the source and missing boundary, and suggest a specific fix. Do not include secret values or payloads in diagnostics. Findings are review warnings, not claims of proven exploitability.++Prevent SQL injection in backend/database query construction.+Report request/user-controlled strings interpolated/concatenated into sql.raw, unsafe/query/execute raw SQL strings, including ORDER BY/table/column fragments. TypeScript type assertions are not runtime validation. Quote wrapping and manual quote replacement are not parameterization.+Recommend Drizzle sql tagged-template bound values, eq/inArray/query builder parameters, or a strict map of allowed identifiers/order directions to trusted SQL fragments. SQL identifiers cannot be safely substituted as value parameters; use an identifier API plus authorization/allowlist as appropriate.+Do not report Drizzle sql`...${value}...` (binds values), parameter arrays, fixed raw SQL/schema migrations, trusted generated SQL, or dynamic identifiers selected from a closed runtime-validated allowlist. Do not mistake sql.join over already-parameterized SQL objects for raw interpolation. Mere variable SQL or an SQL builder API is not evidence of injection.+"""diff --git a/packages/alint/rules/no-unsafe-user-url-fetch/rule.alint.toml b/packages/alint/rules/no-unsafe-user-url-fetch/rule.alint.tomlnew file mode 100644index 00000000000..fb116c537c0--- /dev/null+++ b/packages/alint/rules/no-unsafe-user-url-fetch/rule.alint.toml@@ -0,0 +1,20 @@+name = "no-unsafe-user-url-fetch"+builtInAgent = "basic-structured"+instruction = """+Mandatory execution-boundary gate: this rule concerns HTTP requests made by the application server. A server HTTP call to a configured sandbox API endpoint carrying a command or URL in its JSON body is NOT a fetch to that URL. Do not confuse code/commands executed inside an isolated remote sandbox with a host fetch. Sandbox egress policy is a separate boundary and cannot be inferred from this file.++You are reviewing one TypeScript file from the LobeHub server.++Prevent regressions of #16601 / GHSA-53h9-fmjf-frwr: user-provided skill and image URLs reached raw fetch, allowing requests to internal hosts and cloud metadata.++Report a server-side HTTP request only when this file shows a user-controlled destination (request input, imported manifest, webhook URL, uploaded metadata, or a helper explicitly accepting an external URL) reaching raw fetch, axios, got, or node HTTP APIs without an SSRF-safe transport. Follow local aliases. A URL parser, https-only check, hostname blacklist, or DNS preflight followed by ordinary fetch is not equivalent to connect-time IP checks and redirect-hop validation.++Anchor on the network request. Name the untrusted source and unsafe sink. Suggest the existing ssrfSafeFetch from @lobechat/ssrf-safe-fetch (or an equivalent transport that validates resolved addresses at connection time and every redirect). Never suggest a home-grown hostname regex as the fix.++Do not report:+- ssrfSafeFetch, a locally visible wrapper around it, or a transport with equivalent visible protections;+- fixed service URLs, administrator-controlled environment configuration, or fixed-origin API calls whose user input only becomes encoded path/query data;+- a request whose URL provenance is unknown: a variable called url alone is not evidence;+- browser-side fetch, test code, or network-guard implementation internals.+Authentication alone does not make a user-supplied destination safe. Require a concrete source-to-sink path in this file; do not speculate about unseen callers or helpers.+"""diff --git a/packages/alint/rules/no-unscoped-resource-mutation/rule.alint.toml b/packages/alint/rules/no-unscoped-resource-mutation/rule.alint.tomlnew file mode 100644index 00000000000..14e010746b6--- /dev/null+++ b/packages/alint/rules/no-unscoped-resource-mutation/rule.alint.toml@@ -0,0 +1,26 @@+name = "no-unscoped-resource-mutation"+builtInAgent = "basic-structured"+instruction = """+You are reviewing one TypeScript file from LobeHub database models or repositories.++Mandatory exclusion gate BEFORE producing any finding (these override the reporting criteria below):+1. Skip a method explicitly documented as a privileged/cross-scope primitive requiring caller authorization. A comment such as "Call only after authorizing the row" on deleteAcrossScopes is such a contract. Do not report "no caller visible" or "missing local guard" for that primitive.+2. Skip static background job bookkeeping without an authenticated principal in that method. Instance fields elsewhere in the class do not establish that a static method is a user-facing mutation.+3. Skip copying existing child relations obtained through a parent whose ownership was checked and failed closed in this method. Do not assume pre-existing authorized relations contain unauthorized targets.+4. Skip deletion with an ownership predicate on the affected junction rows, including a multiline buildWorkspaceWhere call.++Prevent the IDOR regressions fixed in #13683 and #16586: linking resources to somebody else's knowledge base, and deleting group membership rows without ownership scope.++Report a mutation of user/workspace-owned data when this file visibly has an authenticated principal (such as this.userId/workspaceId) but uses caller-provided resource IDs without an ownership predicate or a prior fail-closed authorization check. Cover update/delete, batches, and inserting/updating junction relations. For relations, authorizing only the source files does not authorize the target knowledge base/group; assigning the caller's userId to a new junction row does not prove ownership of the referenced target. For creating/reassigning relations, check both endpoints unless one is visibly created in the authorized scope. For deletion, an ownership predicate on the junction rows themselves is sufficient: do not additionally require ownership of both referenced resources.++Anchor on the mutation's where(...) call, or values(...)/set(...) for an unauthorized relation. Name the resource and the missing ownership boundary. Suggest the existing buildWorkspaceWhere/ownership helper or an authorized lookup that gates the mutation; preserve workspace/shared-access semantics, rather than mechanically adding userId everywhere.++Do not report:+- queries containing buildWorkspaceWhere, this.ownership(), or another visibly applicable ownership predicate;+- mutations using IDs obtained exclusively from an ownership-filtered lookup, or a prior awaited authorization check that throws/returns before the mutation on denial;+- child/junction mutations gated by authorization of the parent when all affected rows are constrained to that parent;+- explicitly privileged system maintenance, global catalog data, or new independent resources created for the current principal;+- an explicitly named cross-scope/privileged primitive whose documented contract requires the caller to authorize the row; absent caller code is not proof that this contract is violated. Do report a visible call that violates it;+- read-only queries (this rule concerns mutations), or a file with no evidence that the resource is tenant-owned.+Review all earlier guards in the method. Do not invent missing checks inside unseen helper bodies; a delegated authorized model call is not itself evidence of IDOR. Report only a concrete missing boundary in the visible mutation, not a generic request for more authorization. If callers are not visible, describe the missing local guard and ask to verify caller authorization; do not claim the endpoint is exploitable or every caller is unauthorized.+"""diff --git a/packages/alint/rules/no-untrusted-code-execution/rule.alint.toml b/packages/alint/rules/no-untrusted-code-execution/rule.alint.tomlnew file mode 100644index 00000000000..3d112a5dc09--- /dev/null+++ b/packages/alint/rules/no-untrusted-code-execution/rule.alint.toml@@ -0,0 +1,10 @@+name = "no-untrusted-code-execution"+builtInAgent = "basic-structured"+instruction = """+Review only this file. Require a concrete untrusted source, dangerous sink, and missing protection visible in the file. Follow local aliases and guards. Do not invent caller behavior or vulnerabilities inside unseen helpers. Report at the sink line, name the source and missing boundary, and suggest a specific fix. Do not include secret values or payloads in diagnostics. Findings are review warnings, not claims of proven exploitability.++Prevent untrusted data becoming executable code in the application's privileged process.+Report request, user, model-generated, downloaded, or stored user content passed to eval, Function/new Function, node:vm runInNewContext/runInThisContext/Script, or interpreter -e/-c execution (node/python etc.) on the host without a real isolation/authorization boundary. node:vm and an empty context object are not security sandboxes. Also report writing downloaded code and then executing/importing it when that chain is visible. Anchor at execution, not the download/write. For shell-string construction use the shell injection rule; this rule covers code interpreted as a program.+Recommend data parsing for data, or an existing isolated sandbox/runtime with restricted capabilities and explicit execution policy for intentional code execution.+Do not report fixed build-time code, a fixed expression containing no untrusted interpolation, JSON.parse, parsing/compiling without executing, verified signed application updates, or code delegated to a visibly isolated remote/container worker with an execution-policy boundary. A generic parameter named code with no indication of untrusted origin is not sufficient. An authorized terminal/REPL feature is not itself a bug; report a visible isolation/approval bypass, not its existence.+"""diff --git a/packages/alint/rules/no-untrusted-path-io/rule.alint.toml b/packages/alint/rules/no-untrusted-path-io/rule.alint.tomlnew file mode 100644index 00000000000..a5dba353d7c--- /dev/null+++ b/packages/alint/rules/no-untrusted-path-io/rule.alint.toml@@ -0,0 +1,19 @@+name = "no-untrusted-path-io"+builtInAgent = "basic-structured"+instruction = """+You are reviewing one TypeScript file from the LobeHub server or Electron main process.++Prevent the temporary-file path traversal fixed in #13684 / GHSA-2g9j-v25c-4j97 and attachment-cache filename traversal fixed in #13937.++Report filesystem read/write/delete/extraction when a filename or relative path visibly supplied by an upload, request, remote attachment, or archive entry reaches filesystem IO under an intended fixed root without confinement. Follow local variables through path.join/resolve/normalize: these normalize traversal but do not establish confinement. A bare candidate.startsWith(root) check accepts sibling prefixes and is not sufficient. Replacing one '../' occurrence is not sufficient either.++Only report actual read/write/delete/extraction sinks visible in this file. Returning a constructed path or checking fs.access/exists alone is outside this rule, even if an unseen caller might later use that path. Anchor on the filesystem IO call, never the path construction. Name the untrusted component and the root it can escape. Suggest a generated filename or basename for a flat file store, or a path.relative-based containment check (reject parent escapes and absolute results) for nested paths. Where attackers can create symlinks, note that lexical checks alone cannot guarantee confinement; do not invent symlink control where none is visible.++Do not report:+- a basename-normalized filename in a private flat temp directory, a generated filename with a fixed extension, or a strict allowlist that excludes separators and dot segments;+- a resolved path guarded by separator-aware containment, or a recognized confined-path helper;+- fixed local paths or server-generated cleanup paths;+- explicitly authorized full-path filesystem tools with a visible approved-root/access guard;+- path manipulation without IO, or arbitrary string arguments with no evidence of an untrusted source and intended root.+Do not demand another guard at a call site already using a confined IO abstraction. Require a concrete source-to-sink path in this file.+"""diff --git a/packages/alint/rules/no-unvalidated-redirect/rule.alint.toml b/packages/alint/rules/no-unvalidated-redirect/rule.alint.tomlnew file mode 100644index 00000000000..009b07001ed--- /dev/null+++ b/packages/alint/rules/no-unvalidated-redirect/rule.alint.toml@@ -0,0 +1,10 @@+name = "no-unvalidated-redirect"+builtInAgent = "basic-structured"+instruction = """+Review only this file. Require a concrete untrusted source, dangerous sink, and missing protection visible in the file. Follow local aliases and guards. Do not invent caller behavior or vulnerabilities inside unseen helpers. Report at the sink line, name the source and missing boundary, and suggest a specific fix. Do not include secret values or payloads in diagnostics. Findings are review warnings, not claims of proven exploitability.++Prevent open redirects from request/query/postMessage supplied returnTo/callback/redirect URLs.+Report unvalidated external input reaching HTTP redirect/Location, location.assign/replace/href or window.open. Checking only startsWith('/') allows protocol-relative //evil destinations; raw string startsWith(origin) allows lookalike hosts. Validate with the platform URL parser against an exact trusted origin/registered redirect URI or use fixed route mappings. Anchor at the navigation/response sink.+Recommend the existing safe redirect helper, or resolving against a fixed trusted origin then comparing parsed origins and any required callback allowlist. For same-origin redirects a parsed exact origin check also rejects schemes and protocol-relative foreign hosts. Never recommend URL prefix matching.+Do not report fixed internal routes, query data encoded inside a fixed route, explicit outbound-link features whose purpose is navigating to user-selected external sites, pre-registered exact OAuth callback allowlists, or a visible exact parsed-origin check. Do not flag ordinary links, router paths without untrusted provenance, or redirects already guarded by a recognized helper.+"""diff --git a/packages/alint/security-calibration.md b/packages/alint/security-calibration.mdnew file mode 100644index 00000000000..e2247b0cd4f--- /dev/null+++ b/packages/alint/security-calibration.md@@ -0,0 +1,136 @@+# Security rule calibration++These are lint-rule calibration results, not a product security audit or confirmation+that an endpoint is exploitable. All twelve rules start at `warn`.++## Fixtures++Fixtures are inert source-text inputs. They are never executed as application code.+Final cold calibration on 2026-09-29 passed all **94 fixtures**: **79 new security+fixtures** (30 unsafe, 49 safe) plus 15 existing fixtures. Including the real Logto+validator and handler, this run completed 118 rule executions with **zero execution+failures** and no diagnostics on either real auth file.++After rebasing onto the updated `canary` rule set, the complete fixture suite+passed **117 cases**, including the upstream browser and package-layer fixtures.++Every bad fixture specifies the expected diagnostic line with `// alint-expect`;+every good fixture must produce zero findings. Config groups isolate each fixture+from unrelated rules. The normal fixture suite automatically discovers all files.++| Rule | Unsafe examples | Safe examples |+| ---------------------------------- | --------------- | ------------- |+| `no-auth-verification-bypass` | 3 | 6 |+| `no-privileged-untrusted-electron` | 2 | 2 |+| `no-prototype-pollution` | 2 | 4 |+| `no-secret-exposure` | 3 | 4 |+| `no-shell-command-injection` | 3 | 7 |+| `no-unsafe-html-execution` | 3 | 3 |+| `no-unsafe-raw-sql` | 2 | 2 |+| `no-unsafe-user-url-fetch` | 2 | 5 |+| `no-unscoped-resource-mutation` | 2 | 7 |+| `no-untrusted-code-execution` | 3 | 2 |+| `no-untrusted-path-io` | 3 | 5 |+| `no-unvalidated-redirect` | 2 | 2 |++Safe cases exercise actual boundaries: shell argv/escaping/encoding, authorized+terminals and remote sandboxes, HTML sanitization and sandboxed origins,+parameterized SQL, verified authentication, redacted credentials, exact redirect+origins, null-prototype records and approved filesystem access.++## Real source sampling++The initial expanded cold scan covered 37 files and completed 255 rule executions+with no execution failures. Four files were rechecked cold (40 executions) after+refining the shell, SSRF, auth and credential rules. The CLI bot command was also+checked cold (two executions). The final auth refinement additionally checks the+real Logto validator and its consuming handler.++Observed calibration corrections:++- Remote sandbox commands are not host SSRF requests or accidental shell injection.+ Server-generated paths, correct POSIX escaping and base64 data are not unsafe+ shell syntax. No findings remained on the Onlyboxes provider in the recheck.+- A JWT claims object is not automatically a credential, and a secret in scope+ does not prove an opaque exception contains that secret. No credential warnings+ remained on the OIDC helper in the recheck. Explicit credential-bearing error+ messages remain reportable; parser/library error leakage requires separate review.+- Optional administrator-configured header policies are distinct from mandatory+ signed-event verification. No warning remained on the optional memory webhook+ header guard in the recheck.+- A verifier returning undefined is a failure result. The Logto handler explicitly+ rejects that result before processing events. The auth rule now demands one of+ three visible acceptance/side-effect bypasses and has a matching HMAC fixture.++Three path-confinement warnings on desktop `fileSrv` (upload/read/delete) remain+candidates for separate caller/reachability investigation. They are not confirmed+endpoint vulnerabilities and this change does not alter their implementation.+Earlier calibration of the original three rules also varied on knowledge-base+and group relation checks; a group-copy warning was a false positive despite its+small fixture passing. Large-file and cross-file reasoning remain limitations.++Additional scope limits are intentional: dependency vulnerabilities, configuration+policy decisions, arbitrary custom interpreters and full cross-file authorization+proof need other checks/review. Do not treat a clean ALint run as a security proof.++### Sample manifest++```text+apps/server/src/services/skill/importer.ts+apps/server/src/services/generation/index.ts+apps/server/src/utils/tempFileManager.ts+packages/database/src/models/knowledgeBase.ts+packages/database/src/repositories/agentGroup/index.ts+packages/database/src/models/agentBotProvider.ts+packages/database/src/models/agentCronJob.ts+apps/desktop/src/main/services/fileSrv.ts+packages/local-file-shell/src/shell/runner.ts+packages/local-file-shell/src/git/info.ts+packages/local-file-shell/src/git/pullRequest.ts+packages/local-file-shell/src/file/grep.ts+packages/heterogeneous-agents/src/spawn/devinAcpSession.ts+apps/desktop/src/main/utils/heteroCliProcess.ts+apps/desktop/src/main/utils/heteroExecProcess.ts+apps/server/src/services/sandbox/providers/onlyboxes.ts+apps/server/src/services/sandbox/index.ts+packages/utils/src/client/sanitize.ts+apps/server/src/utils/serializeForHtml.ts+src/features/Portal/Artifacts/Body/Renderer/SVG.tsx+packages/database/src/repositories/ftsSearch/pgSearch/index.ts+packages/database/src/repositories/ftsSearch/pgLike/index.ts+packages/database/src/repositories/ftsSearch/elasticsearch/query-fields.ts+apps/server/src/services/bot/credentialMasking.ts+apps/server/src/routers/lambda/agentBotProvider.ts+apps/server/src/router-hono/webhooks/handlers/github.ts+apps/server/src/router-hono/webhooks/handlers/logtoValidateRequest.ts+apps/server/src/router-hono/webhooks/handlers/casdoorValidateRequest.ts+apps/server/src/router-hono/webhooks/middlewares/memoryWebhookAuth.ts+src/libs/oidc-provider/jwt.ts+apps/server/src/router-hono/agent/handlers/messengerOAuthCallback.ts+apps/server/src/router-hono/webhooks/handlers/githubSetup.ts+src/features/Settings/oauth-apps/redirectUris.ts+apps/desktop/src/main/core/browser/Browser.ts+apps/desktop/src/preload/index.ts+apps/desktop/src/preload/invoke.ts+apps/desktop/src/main/controllers/ConnectorOAuthCtr.ts+apps/cli/src/commands/bot.ts+apps/server/src/router-hono/webhooks/handlers/logto.ts+```++## Reproduce++From the repository root:++```sh+bun run alint plugin install+cd packages/alint+bunx vitest run fixtures.test.ts --silent='passed-only'+```++For a cold run, pass the fixture/source paths to `bun run alint --no-cache --format json`.+Inspect `execution.failed` as well as diagnostics. Nonzero status from a source+sample can come from existing non-security error rules; it is not itself a model+execution failure. Review each security finding in context.++This is tooling-only: no product behavior changed, so no product acceptance run is+required. Lint and model-backed fixture calibration are the relevant checks.