@lintsure/core 0.3.16 → 0.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +3 -3
- package/dist/src/knowledge/more.js +2 -2
- package/dist/src/knowledge/owasp-top10.js +1 -1
- package/dist/src/rules/owasp.d.ts +6 -0
- package/dist/src/rules/owasp.js +85 -1
- package/docs/README.md +1 -1
- package/docs/agents.md +1 -1
- package/docs/frameworks.md +4 -4
- package/docs/rules.md +26 -2
- package/package.json +42 -42
package/dist/src/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export { toAssessmentHtml } from "./assessment.js";
|
|
|
14
14
|
export * from "./knowledge/index.js";
|
|
15
15
|
export { loadPacks, registerPack, type Pack } from "./packs.js";
|
|
16
16
|
export { checksFor } from "./plan.js";
|
|
17
|
-
export declare const RULES_VERSION = "0.3.
|
|
17
|
+
export declare const RULES_VERSION = "0.3.18";
|
|
18
18
|
/** Shown with every result, in every interface. Lintsure prepares; people decide. */
|
|
19
19
|
export declare const DISCLAIMER: string;
|
|
20
20
|
/** What a report must never be read as. Used in the report and by the MCP server. */
|
package/dist/src/index.js
CHANGED
|
@@ -23,7 +23,7 @@ export { loadPacks, registerPack } from "./packs.js";
|
|
|
23
23
|
export { checksFor } from "./plan.js";
|
|
24
24
|
import { configPacks, loadPacks, packFrameworks, packsLoaded } from "./packs.js";
|
|
25
25
|
import { buildGraph, declaredEntries, reachOf } from "./reach.js";
|
|
26
|
-
export const RULES_VERSION = "0.3.
|
|
26
|
+
export const RULES_VERSION = "0.3.18";
|
|
27
27
|
/** Shown with every result, in every interface. Lintsure prepares; people decide. */
|
|
28
28
|
export const DISCLAIMER = "Lintsure is a readiness tool, not an audit, a certification or legal advice. " +
|
|
29
29
|
"Its rules reflect our reading of the publicly available text of each framework, and they check code only. " +
|
|
@@ -43,7 +43,7 @@ export function nextSteps(r) {
|
|
|
43
43
|
for (const f of r.findings)
|
|
44
44
|
if (f.accepted && !f.accepted.expired)
|
|
45
45
|
perRule.set(f.ruleId, (perRule.get(f.ruleId) ?? 0) + 1);
|
|
46
|
-
const repeats = [...perRule].filter(([, n]) => n >=
|
|
46
|
+
const repeats = [...perRule].filter(([, n]) => n >= 2); // twice is a pattern: the bar teams use before they write a rule down
|
|
47
47
|
return [
|
|
48
48
|
gaps ? `Review the ${gaps} gap${gaps === 1 ? "" : "s"} and decide how to fix each one. Approve any change before it is made.` : "No gaps were found by the current rules. Keep checking as the code changes.",
|
|
49
49
|
partial ? `Check the ${partial} partial finding${partial === 1 ? "" : "s"}: each depends on context only you can confirm.` : "",
|
|
@@ -310,7 +310,7 @@ export function importedNames(file, text, files, byEnding) {
|
|
|
310
310
|
}
|
|
311
311
|
return out;
|
|
312
312
|
}
|
|
313
|
-
const TOOLING_RULES = new Set(["agent.config-runs-remote-code", "agent.instructions-unsafe", "agent.permissions-allow-all", "skill.fetches-remote-instructions", "skill.writes-agent-memory", "skill.unrestricted-shell"]);
|
|
313
|
+
const TOOLING_RULES = new Set(["agent.config-runs-remote-code", "agent.instructions-unsafe", "agent.permissions-allow-all", "agent.approval-author-alone", "agent.approval-rule-files-open", "skill.fetches-remote-instructions", "skill.writes-agent-memory", "skill.unrestricted-shell"]);
|
|
314
314
|
// Lines a person already reviewed. lintsure-ignore and the secret allowlist pragma count only in a comment and apply
|
|
315
315
|
// to every rule. Other linters' markers (noqa, nosec, NOSONAR) don't hide secrets: `# noqa: E501` is about line length.
|
|
316
316
|
const REVIEWED = /(#|\/\/|\/\*|--)\s*(lintsure-ignore|pragma:\s*allowlist secret)\b/;
|
|
@@ -16,7 +16,7 @@ export const owaspLlm = {
|
|
|
16
16
|
{ ref: "LLM02:2026", title: "Sensitive Information Disclosure", inCode: "partly", rules: ["secret.in-source", "secret.public-env", "pii.logged", "log.secret"],
|
|
17
17
|
plain: "Keys, personal data and internal details must not reach the model, its logs or its answers unless they're meant to.",
|
|
18
18
|
evidence: "What data is sent to the model provider, and the provider's data retention terms." },
|
|
19
|
-
{ ref: "LLM03:2026", title: "Excessive Agency", inCode: "partly", rules: ["agent.permissions-allow-all", "mcp.tool-runs-shell", "mcp.tool-uses-secret"],
|
|
19
|
+
{ ref: "LLM03:2026", title: "Excessive Agency", inCode: "partly", rules: ["agent.permissions-allow-all", "agent.approval-author-alone", "agent.approval-rule-files-open", "mcp.tool-runs-shell", "mcp.tool-uses-secret"],
|
|
20
20
|
plain: "Tools and permissions given to an agent should be the minimum it needs, with a person approving anything risky.",
|
|
21
21
|
evidence: "A list of the tools each agent can call and which need approval." },
|
|
22
22
|
{ ref: "LLM04:2026", title: "Supply Chain", inCode: "partly", rules: ["deps.unpinned-version", "deps.install-script", "agent.config-runs-remote-code", "ml.unsafe-model-load", "mcp.config-unsafe-server"],
|
|
@@ -80,7 +80,7 @@ export const owaspAst = {
|
|
|
80
80
|
{ ref: "AST02", title: "Supply Chain Compromise", inCode: "partly", rules: ["agent.config-runs-remote-code", "mcp.config-unsafe-server"],
|
|
81
81
|
plain: "Skills, hooks and tool servers come from others. Pin them to a version you have read, and treat config files an agent runs by itself as code.",
|
|
82
82
|
evidence: "A list of installed skills and servers with their versions and sources." },
|
|
83
|
-
{ ref: "AST03", title: "Over-Privileged Skills", inCode: "partly", rules: ["agent.permissions-allow-all", "skill.unrestricted-shell"],
|
|
83
|
+
{ ref: "AST03", title: "Over-Privileged Skills", inCode: "partly", rules: ["agent.permissions-allow-all", "agent.approval-author-alone", "agent.approval-rule-files-open", "skill.unrestricted-shell"],
|
|
84
84
|
plain: "A skill should get only the tools, files and network access its job needs. Open shell access makes every other limit moot.",
|
|
85
85
|
evidence: "The permissions each skill declares, and why it needs them." },
|
|
86
86
|
{ ref: "AST04", title: "Insecure Metadata", inCode: "partly", rules: ["agent.instructions-unsafe"],
|
|
@@ -23,7 +23,7 @@ export const owaspTop10 = {
|
|
|
23
23
|
plain: "Whether each endpoint checks that the record belongs to the person asking (often called IDOR). A line-by-line code check can't tell; it needs design review and testing with two accounts.",
|
|
24
24
|
evidence: "Access control tests per role, or a penetration test report." },
|
|
25
25
|
{ ref: "A02:2025", title: "Security Misconfiguration", inCode: "partly",
|
|
26
|
-
rules: ["cloud.database-public", "cloud.network-open", "cloud.iam-allow-all", "cloud.function-url-no-auth", "docker.runs-as-root", "docker.image-unpinned", "docker.secret-in-build", "docker.copies-everything", "config.debug-on", "agent.permissions-allow-all", "config.allowed-hosts-any", "config.default-secret-key", "xml.external-entities", "cors.any-origin", "session.cookie-insecure", "error.stack-to-client", "build.sourcemaps-public", "release.env-not-ignored", "k8s.privileged", "docker.socket-mounted", "graphql.introspection"],
|
|
26
|
+
rules: ["cloud.database-public", "cloud.network-open", "cloud.iam-allow-all", "cloud.function-url-no-auth", "docker.runs-as-root", "docker.image-unpinned", "docker.secret-in-build", "docker.copies-everything", "config.debug-on", "agent.permissions-allow-all", "agent.approval-author-alone", "agent.approval-rule-files-open", "config.allowed-hosts-any", "config.default-secret-key", "xml.external-entities", "cors.any-origin", "session.cookie-insecure", "error.stack-to-client", "build.sourcemaps-public", "release.env-not-ignored", "k8s.privileged", "docker.socket-mounted", "graphql.introspection"],
|
|
27
27
|
plain: "Safe settings by default: debug off, real host names, strong secret keys, cookies marked secure, XML parsers that don't load outside files, and errors that don't reveal internals.",
|
|
28
28
|
evidence: "Production configuration and a hardening checklist." },
|
|
29
29
|
{ ref: "A02:2025 (deployed settings)", title: "Server, cloud and header configuration in production", inCode: "no",
|
|
@@ -8,6 +8,12 @@ export declare const poisonedDescription: (l: string) => boolean;
|
|
|
8
8
|
/** A YAML permissions file whose allow list names the whole shell or every tool (Continue's permissions.yaml). Only items
|
|
9
9
|
* under "allow:" count: the same entry under "ask:" or "exclude:" is a limit. Returns line numbers. Pure. */
|
|
10
10
|
export declare function yamlAllowsAll(lines: string[]): number[];
|
|
11
|
+
export declare const APPROVALS_FILE: RegExp;
|
|
12
|
+
/** Lines of an approval policy where a change needs nobody but its author. Pure. */
|
|
13
|
+
export declare function approvalByAuthorAlone(lines: string[]): number[];
|
|
14
|
+
/** The "rules:" line of a policy that has an easy path (the author alone, or Claude approving) and no stricter rule that
|
|
15
|
+
* names the files steering agents and reviews. The strictest matching rule wins, so one such rule is what covers them. Pure. */
|
|
16
|
+
export declare function ruleFilesShareAnApprover(lines: string[]): number[];
|
|
11
17
|
/** Agent instruction line: Gap for override, concealment, hidden text or sending secrets out; Partial for download-and-run. Pure. */
|
|
12
18
|
export declare function instructionsUnsafe(l: string): boolean | "partial";
|
|
13
19
|
/** A risk in the OWASP list for agent skills. Ids and names only. */
|
package/dist/src/rules/owasp.js
CHANGED
|
@@ -18,7 +18,7 @@ const RUNS_REMOTE = new RegExp([
|
|
|
18
18
|
// The folder each agent keeps its own files in: .claude, .agents, .cursor, .kiro, .continue, .github (Copilot) and the rest.
|
|
19
19
|
export const AGENT_DIRS = String.raw `\.(claude|agents?|codex|gemini|cursor|continue|kiro|kilocode|factory|codebuddy|opencode|pi|hermes|mastracode|openclaw|adal|autohand|roo|windsurf|cline|junie|rovodev|github)`;
|
|
20
20
|
export const AGENT_INSTRUCTIONS = new RegExp([
|
|
21
|
-
String.raw `(^|\/)(SKILL\.md|AGENTS\.md|CLAUDE\.md|GEMINI\.md|\.cursorrules|\.windsurfrules|\.clinerules|copilot-instructions\.md)$`,
|
|
21
|
+
String.raw `(^|\/)(SKILL\.md|AGENTS\.md|CLAUDE\.md|REVIEW\.md|GEMINI\.md|\.cursorrules|\.windsurfrules|\.clinerules|copilot-instructions\.md)$`,
|
|
22
22
|
String.raw `(^|\/)\.cursor\/rules\/[^/]+\.mdc?$`,
|
|
23
23
|
String.raw `(^|\/)\.clinerules\/[^/]+\.md$|(^|\/)\.junie\/guidelines\.md$`,
|
|
24
24
|
String.raw `(^|\/)${AGENT_DIRS}\/(skills|commands|agents|rules|steering|prompts|instructions)\/.+\.md$`,
|
|
@@ -59,6 +59,78 @@ export function yamlAllowsAll(lines) {
|
|
|
59
59
|
});
|
|
60
60
|
return out;
|
|
61
61
|
}
|
|
62
|
+
// ---- Approval policies (.claude/approvals.yml): who has to say yes before a pull request can merge. ----
|
|
63
|
+
export const APPROVALS_FILE = /(^|\/)\.claude\/approvals\.ya?ml$/;
|
|
64
|
+
// Files that steer agents and reviews and that the policy does not protect by itself. (The policy file, a root REVIEW.md
|
|
65
|
+
// and CODEOWNERS always need a person; these do not unless a rule names them.)
|
|
66
|
+
const RULE_FILES = /\.github\b|\bCLAUDE\.md|\bAGENTS\.md|\.mcp\.json|\.claude\b/;
|
|
67
|
+
const noComment = (l) => l.replace(/\s+#.*$/, "").replace(/^\s*#.*$/, "");
|
|
68
|
+
/** The rules of an approvals file: one block per item under "rules:", with its first line number. Pure. */
|
|
69
|
+
function approvalBlocks(lines) {
|
|
70
|
+
const out = [];
|
|
71
|
+
let inRules = false, indent = -1;
|
|
72
|
+
lines.forEach((raw, i) => {
|
|
73
|
+
const l = noComment(raw);
|
|
74
|
+
if (/^rules:\s*$/.test(l)) {
|
|
75
|
+
inRules = true;
|
|
76
|
+
indent = -1;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (!inRules || !l.trim())
|
|
80
|
+
return;
|
|
81
|
+
if (/^\S/.test(l)) {
|
|
82
|
+
inRules = false;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const item = /^(\s*)-\s/.exec(l);
|
|
86
|
+
if (item && (indent < 0 || item[1].length === indent)) {
|
|
87
|
+
indent = item[1].length;
|
|
88
|
+
out.push({ at: i + 1, rows: [] });
|
|
89
|
+
}
|
|
90
|
+
out[out.length - 1]?.rows.push({ n: i + 1, text: l });
|
|
91
|
+
});
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
94
|
+
/** The seat lines of one rule that leave nobody but the author: "seats: 0" or "seats: 1" as a number, or a set of one
|
|
95
|
+
* drawn from everyone with the author not taken out. A number N is short for N people, and the author can be one of
|
|
96
|
+
* them. A set that admits bots beside "claude: approves" needs no person at all. Reads a set written on one line or
|
|
97
|
+
* spread over the lines below it. Pure. */
|
|
98
|
+
function loneSeats(rows) {
|
|
99
|
+
const out = [], approves = rows.some((r) => /\bclaude:\s*approves\b/.test(r.text));
|
|
100
|
+
rows.forEach((r, i) => {
|
|
101
|
+
if (!/\bseats:/.test(r.text))
|
|
102
|
+
return;
|
|
103
|
+
// The seats value: the rest of this line, plus the deeper lines under it when it is written as a block.
|
|
104
|
+
const depth = r.text.search(/\S/), rest = [r.text.slice(r.text.indexOf("seats:"))];
|
|
105
|
+
if (/\bseats:\s*$/.test(r.text))
|
|
106
|
+
for (let j = i + 1; j < rows.length && rows[j].text.search(/\S/) > depth; j++)
|
|
107
|
+
rest.push(rows[j].text);
|
|
108
|
+
const v = rest.join(" ");
|
|
109
|
+
if (/!pr\/authors/.test(v))
|
|
110
|
+
return;
|
|
111
|
+
const number = /\bseats:\s*([01])\b/.test(v), oneOfAll = /\bcount:\s*1\b/.test(v) && /\bfrom:\s*\[?\s*(humans|everyone)\b/.test(v) && !/\bcount:\s*(?:[2-9]|1\d)\b/.test(v);
|
|
112
|
+
const botsFill = approves && /\bfrom:[^\n]*\b(bots|everyone|bot:claude)\b/.test(v);
|
|
113
|
+
if (number || oneOfAll || botsFill)
|
|
114
|
+
out.push(r.n);
|
|
115
|
+
});
|
|
116
|
+
return out;
|
|
117
|
+
}
|
|
118
|
+
/** Lines of an approval policy where a change needs nobody but its author. Pure. */
|
|
119
|
+
export function approvalByAuthorAlone(lines) {
|
|
120
|
+
return approvalBlocks(lines).flatMap((b) => loneSeats(b.rows));
|
|
121
|
+
}
|
|
122
|
+
/** The "rules:" line of a policy that has an easy path (the author alone, or Claude approving) and no stricter rule that
|
|
123
|
+
* names the files steering agents and reviews. The strictest matching rule wins, so one such rule is what covers them. Pure. */
|
|
124
|
+
export function ruleFilesShareAnApprover(lines) {
|
|
125
|
+
const blocks = approvalBlocks(lines);
|
|
126
|
+
const easy = (b) => loneSeats(b.rows).length > 0 || b.rows.some((r) => /\bclaude:\s*approves\b/.test(r.text));
|
|
127
|
+
if (!blocks.some(easy))
|
|
128
|
+
return [];
|
|
129
|
+
if (blocks.some((b) => !easy(b) && b.rows.some((r) => /\bverdict:|\buse:/.test(r.text)) && RULE_FILES.test(b.rows.map((r) => r.text).join("\n"))))
|
|
130
|
+
return [];
|
|
131
|
+
const at = lines.findIndex((l) => /^rules:\s*$/.test(noComment(l)));
|
|
132
|
+
return [at < 0 ? 1 : at + 1];
|
|
133
|
+
}
|
|
62
134
|
/** Agent instruction line: Gap for override, concealment, hidden text or sending secrets out; Partial for download-and-run. Pure. */
|
|
63
135
|
export function instructionsUnsafe(l) {
|
|
64
136
|
if (hiddenText(l))
|
|
@@ -215,6 +287,18 @@ export const owaspRules = [
|
|
|
215
287
|
note: "Committed agent settings apply to everyone who opens the repo with that agent. Skipping prompts or allowing every shell command lets a bad instruction, a poisoned file or a mistake run without a person seeing it (CWE-250, OWASP LLM03 Excessive Agency).",
|
|
216
288
|
extensions: [".json", ".toml", ".yaml", ".yml"], fileTest: yamlAllowsAll, pathMatch: /(^|\/)(\.claude\/settings\.json|\.gemini\/settings\.json|\.codex\/config\.toml|\.continue\/(config|permissions)\.ya?ml|\.vscode\/settings\.json)$/,
|
|
217
289
|
test: (l) => /"defaultMode"\s*:\s*"bypassPermissions"|(?:^|[[,])\s*"(Bash|Bash\(\*\)|Bash\(:\*\)|\*)"\s*(?:[,\]]|$)|--dangerously-skip-permissions|"(yolo|autoAccept)"\s*:\s*true|\bapproval_policy\s*=\s*["']never["']|\bsandbox_mode\s*=\s*["']danger-full-access["']|"chat\.tools\.autoApprove"\s*:\s*true/.test(l) }),
|
|
290
|
+
// An approval policy decides who must say yes before a pull request merges. Two shapes leave nobody but the author:
|
|
291
|
+
// Claude approves and one seat is enough, and the files that set the rules ride on the same easy path.
|
|
292
|
+
rule({ id: "agent.approval-author-alone", title: "Approval policy asks for nobody but the author", status: "partial", severity: "high", controls: [A02, LLM03, AST03],
|
|
293
|
+
fix: "Ask for a person who isn't the author on this path: seats: [{ count: 1, from: [humans, \"!pr/authors\"] }], or raise seats to 2. Keep the rule as it is only for paths where you have decided the author alone is enough, and say so in its purpose.",
|
|
294
|
+
note: "The author of a pull request can fill one seat, so seats: 1 asks for nobody else, and seats: 0 asks for no person at all. Where Claude also approves, a branch rule that needs one approval is met by Claude's, and with auto-merge on nobody has to act (CWE-284, OWASP LLM03 Excessive Agency).",
|
|
295
|
+
extensions: [".yml", ".yaml"], pathMatch: APPROVALS_FILE, fileTest: approvalByAuthorAlone,
|
|
296
|
+
unseen: "Lintsure reads this file, not your branch rules or CODEOWNERS. A branch rule that needs another person's approval covers this, mode: observe means the policy only reports, and a verdict copied in with use is not followed." }),
|
|
297
|
+
rule({ id: "agent.approval-rule-files-open", title: "Approval policy has no stricter rule for the files that set the rules", status: "partial", severity: "medium", controls: [A02, LLM03, AST03],
|
|
298
|
+
fix: "Add a rule for the files that steer agents and reviews, for example paths: [\"**/.claude/**\", \"**/CLAUDE.md\", \"**/AGENTS.md\", \".mcp.json\", \".github/**\"] with nested: inherit and verdict: { claude: comments, seats: [{ count: 1, from: [humans, \"!pr/authors\"] }] }.",
|
|
299
|
+
note: "This policy has an easy path, and no stricter rule names the agent's instructions, its settings or CI. The policy file, a root REVIEW.md and CODEOWNERS always need a person; CLAUDE.md, AGENTS.md, .mcp.json, the rest of .claude and .github do not unless a rule says so. A change there changes what every later review checks (CWE-284).",
|
|
300
|
+
extensions: [".yml", ".yaml"], pathMatch: APPROVALS_FILE, fileTest: ruleFilesShareAnApprover,
|
|
301
|
+
unseen: "Lintsure can't tell which rule your paths resolve to for a given file, or what CODEOWNERS and branch rules add on top. Check one change to CLAUDE.md against the policy by hand." }),
|
|
218
302
|
rule({ id: "ci.action-unpinned", title: "Third-party GitHub Action not pinned to a commit", status: "partial", severity: "medium", controls: [A03],
|
|
219
303
|
fix: "Pin third-party actions to a full commit SHA, with the version as a comment, for example uses: owner/action@<40-character sha> # v2.",
|
|
220
304
|
note: "A tag like @v1 can be moved by the action's owner, or by whoever takes over their account (CWE-829).", extensions: YAML,
|
package/docs/README.md
CHANGED
package/docs/agents.md
CHANGED
package/docs/frameworks.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated from Lintsure 0.3.
|
|
1
|
+
<!-- Generated from Lintsure 0.3.18 by scripts/build-docs.mjs. -->
|
|
2
2
|
# Frameworks
|
|
3
3
|
|
|
4
4
|
## EU AI Act (`eu-ai-act`)
|
|
@@ -62,7 +62,7 @@ Applies to: Any team building a web application or API. It's voluntary, but ofte
|
|
|
62
62
|
|
|
63
63
|
- A01:2025 Broken Access Control [partly in code]: People must only reach the data and actions meant for them. This covers file paths, redirects, requests your server makes on a user's behalf (SSRF), forged requests from other sites, and permissions kept where users can change them. Rules: path.user-input, redirect.open, ssrf.user-url, csrf.disabled, fs.world-writable, cors.any-origin, cookie.trusted-role, supabase.rls-disabled, supabase.policy-allows-all, supabase.service-key-in-client, supabase.function-no-auth, authz.no-owner-check, ws.no-origin-check, cloud.public-bucket.
|
|
64
64
|
- A01:2025 (ownership checks) Every record is checked against the signed-in user [outside code]: Whether each endpoint checks that the record belongs to the person asking (often called IDOR). A line-by-line code check can't tell; it needs design review and testing with two accounts.
|
|
65
|
-
- A02:2025 Security Misconfiguration [partly in code]: Safe settings by default: debug off, real host names, strong secret keys, cookies marked secure, XML parsers that don't load outside files, and errors that don't reveal internals. Rules: cloud.database-public, cloud.network-open, cloud.iam-allow-all, cloud.function-url-no-auth, docker.runs-as-root, docker.image-unpinned, docker.secret-in-build, docker.copies-everything, config.debug-on, agent.permissions-allow-all, config.allowed-hosts-any, config.default-secret-key, xml.external-entities, cors.any-origin, session.cookie-insecure, error.stack-to-client, build.sourcemaps-public, release.env-not-ignored, k8s.privileged, docker.socket-mounted, graphql.introspection.
|
|
65
|
+
- A02:2025 Security Misconfiguration [partly in code]: Safe settings by default: debug off, real host names, strong secret keys, cookies marked secure, XML parsers that don't load outside files, and errors that don't reveal internals. Rules: cloud.database-public, cloud.network-open, cloud.iam-allow-all, cloud.function-url-no-auth, docker.runs-as-root, docker.image-unpinned, docker.secret-in-build, docker.copies-everything, config.debug-on, agent.permissions-allow-all, agent.approval-author-alone, agent.approval-rule-files-open, config.allowed-hosts-any, config.default-secret-key, xml.external-entities, cors.any-origin, session.cookie-insecure, error.stack-to-client, build.sourcemaps-public, release.env-not-ignored, k8s.privileged, docker.socket-mounted, graphql.introspection.
|
|
66
66
|
- A02:2025 (deployed settings) Server, cloud and header configuration in production [outside code]: What is actually running: server and cloud settings, open ports, default accounts, security headers on real responses. These need a scan of the deployed system.
|
|
67
67
|
- A03:2025 Software Supply Chain Failures [partly in code]: The code you didn't write: dependencies, build tools and CI. Versions should be pinned, install scripts shouldn't fetch code, CI actions should be pinned, untrusted pull requests must not run with your secrets, and text from issues or pull requests must never become part of a CI command. Rules: deps.unpinned-version, deps.install-script, agent.config-runs-remote-code, agent.instructions-unsafe, ci.action-unpinned, ci.prt-checkout-head, ci.write-all-permissions, ci.script-injection, update.unverified-download.
|
|
68
68
|
- A03:2025 (known vulnerabilities) Dependencies with known vulnerabilities [outside code]: Whether any dependency version has a published vulnerability, and whether it's maintained. This needs vulnerability advisory data, which Lintsure doesn't download, so use a dependency scanner alongside it.
|
|
@@ -117,7 +117,7 @@ Applies to: Any team that builds a feature on an AI model: chatbots, assistants,
|
|
|
117
117
|
|
|
118
118
|
- LLM01:2026 Prompt Injection [partly in code]: User text, web pages or files can carry instructions that change what the model does. Keep instructions and user content apart, and limit what the model can do. Rules: llm.user-input-in-system-prompt, llm.retrieved-text-in-system-prompt, agent.instructions-unsafe, llm.client-controls-system, mcp.tool-description-poisoned.
|
|
119
119
|
- LLM02:2026 Sensitive Information Disclosure [partly in code]: Keys, personal data and internal details must not reach the model, its logs or its answers unless they're meant to. Rules: secret.in-source, secret.public-env, pii.logged, log.secret.
|
|
120
|
-
- LLM03:2026 Excessive Agency [partly in code]: Tools and permissions given to an agent should be the minimum it needs, with a person approving anything risky. Rules: agent.permissions-allow-all, mcp.tool-runs-shell, mcp.tool-uses-secret.
|
|
120
|
+
- LLM03:2026 Excessive Agency [partly in code]: Tools and permissions given to an agent should be the minimum it needs, with a person approving anything risky. Rules: agent.permissions-allow-all, agent.approval-author-alone, agent.approval-rule-files-open, mcp.tool-runs-shell, mcp.tool-uses-secret.
|
|
121
121
|
- LLM04:2026 Supply Chain [partly in code]: Models, datasets, plugins and packages come from others. Pin and check them like any dependency. Rules: deps.unpinned-version, deps.install-script, agent.config-runs-remote-code, ml.unsafe-model-load, mcp.config-unsafe-server.
|
|
122
122
|
- LLM05:2026 Data and Model Poisoning [outside code]: Training, fine-tuning or retrieval data can be tampered with to change the model's behaviour.
|
|
123
123
|
- LLM06:2026 Unbounded Consumption [partly in code]: Limit output size, request rate and cost per user, so one person can't run up a bill or take the service down. Rules: llm.no-output-limit, ai.call-not-logged, llm.unbounded-agent-loop.
|
|
@@ -153,7 +153,7 @@ Applies to: Any team whose developers or products use an AI agent that loads ski
|
|
|
153
153
|
|
|
154
154
|
- AST01 Malicious Skills [partly in code]: A skill can look useful and still tell the agent to hide a step, send secrets out or change its own instructions. Read a skill's text like code before an agent uses it. Rules: agent.instructions-unsafe, skill.writes-agent-memory.
|
|
155
155
|
- AST02 Supply Chain Compromise [partly in code]: Skills, hooks and tool servers come from others. Pin them to a version you have read, and treat config files an agent runs by itself as code. Rules: agent.config-runs-remote-code, mcp.config-unsafe-server.
|
|
156
|
-
- AST03 Over-Privileged Skills [partly in code]: A skill should get only the tools, files and network access its job needs. Open shell access makes every other limit moot. Rules: agent.permissions-allow-all, skill.unrestricted-shell.
|
|
156
|
+
- AST03 Over-Privileged Skills [partly in code]: A skill should get only the tools, files and network access its job needs. Open shell access makes every other limit moot. Rules: agent.permissions-allow-all, agent.approval-author-alone, agent.approval-rule-files-open, skill.unrestricted-shell.
|
|
157
157
|
- AST04 Insecure Metadata [partly in code]: A skill's description and front matter are read by the agent too. They must match what the skill does and carry no hidden characters. Rules: agent.instructions-unsafe.
|
|
158
158
|
- AST05 Untrusted External Instructions [partly in code]: A skill that tells the agent to fetch a page and follow it hands control to whoever owns that page tomorrow. Keep the instructions inside the skill, or pin what is fetched. Rules: skill.fetches-remote-instructions.
|
|
159
159
|
- AST06 Weak Isolation [partly in code]: Skills and tool servers should run boxed in: local interfaces only, with sign-in, and limited to the files they declare. Rules: mcp.server-binds-all-interfaces.
|
package/docs/rules.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!-- Generated from Lintsure 0.3.
|
|
2
|
-
# Lintsure rules (
|
|
1
|
+
<!-- Generated from Lintsure 0.3.18 by scripts/build-docs.mjs. -->
|
|
2
|
+
# Lintsure rules (116)
|
|
3
3
|
|
|
4
4
|
## pii.logged
|
|
5
5
|
**Personal data written to logs** · status when found: gap · risk: high
|
|
@@ -308,6 +308,30 @@
|
|
|
308
308
|
- In other standards: https://www.opencre.org/node/standard/CWE/sectionid/250
|
|
309
309
|
- Page: https://lintsure.com/rules/agent-permissions-allow-all
|
|
310
310
|
|
|
311
|
+
## agent.approval-author-alone
|
|
312
|
+
**Approval policy asks for nobody but the author** · status when found: partial · risk: high
|
|
313
|
+
|
|
314
|
+
- Controls: owasp-top10 A02:2025 (Security Misconfiguration); owasp-llm LLM03:2026 (Excessive Agency); owasp-ast AST03 (Over-Privileged Skills)
|
|
315
|
+
- Fix: Ask for a person who isn't the author on this path: seats: [{ count: 1, from: [humans, "!pr/authors"] }], or raise seats to 2. Keep the rule as it is only for paths where you have decided the author alone is enough, and say so in its purpose.
|
|
316
|
+
- Note: The author of a pull request can fill one seat, so seats: 1 asks for nobody else, and seats: 0 asks for no person at all. Where Claude also approves, a branch rule that needs one approval is met by Claude's, and with auto-merge on nobody has to act (CWE-284, OWASP LLM03 Excessive Agency).
|
|
317
|
+
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
318
|
+
- Not a problem when: The file is a detector, a test set or documentation that lists these patterns to catch or explain them. It is the stated job of the skill or tool, and the user is asked before it happens. A limit set elsewhere applies: the agent's own permission prompts, an output cap, a sandbox.
|
|
319
|
+
- In other standards: https://www.opencre.org/node/standard/CWE/sectionid/284
|
|
320
|
+
- When Partial, Lintsure can't see: Lintsure reads this file, not your branch rules or CODEOWNERS. A branch rule that needs another person's approval covers this, mode: observe means the policy only reports, and a verdict copied in with use is not followed.
|
|
321
|
+
- Page: https://lintsure.com/rules/agent-approval-author-alone
|
|
322
|
+
|
|
323
|
+
## agent.approval-rule-files-open
|
|
324
|
+
**Approval policy has no stricter rule for the files that set the rules** · status when found: partial · risk: medium
|
|
325
|
+
|
|
326
|
+
- Controls: owasp-top10 A02:2025 (Security Misconfiguration); owasp-llm LLM03:2026 (Excessive Agency); owasp-ast AST03 (Over-Privileged Skills)
|
|
327
|
+
- Fix: Add a rule for the files that steer agents and reviews, for example paths: ["**/.claude/**", "**/CLAUDE.md", "**/AGENTS.md", ".mcp.json", ".github/**"] with nested: inherit and verdict: { claude: comments, seats: [{ count: 1, from: [humans, "!pr/authors"] }] }.
|
|
328
|
+
- Note: This policy has an easy path, and no stricter rule names the agent's instructions, its settings or CI. The policy file, a root REVIEW.md and CODEOWNERS always need a person; CLAUDE.md, AGENTS.md, .mcp.json, the rest of .claude and .github do not unless a rule says so. A change there changes what every later review checks (CWE-284).
|
|
329
|
+
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
330
|
+
- Not a problem when: The file is a detector, a test set or documentation that lists these patterns to catch or explain them. It is the stated job of the skill or tool, and the user is asked before it happens. A limit set elsewhere applies: the agent's own permission prompts, an output cap, a sandbox.
|
|
331
|
+
- In other standards: https://www.opencre.org/node/standard/CWE/sectionid/284
|
|
332
|
+
- When Partial, Lintsure can't see: Lintsure can't tell which rule your paths resolve to for a given file, or what CODEOWNERS and branch rules add on top. Check one change to CLAUDE.md against the policy by hand.
|
|
333
|
+
- Page: https://lintsure.com/rules/agent-approval-rule-files-open
|
|
334
|
+
|
|
311
335
|
## ci.action-unpinned
|
|
312
336
|
**Third-party GitHub Action not pinned to a commit** · status when found: partial · risk: medium
|
|
313
337
|
|
package/package.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@lintsure/core",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Lintsure engine: rules, framework knowledge and reports for readiness checks of AI-written code. Not an audit or legal advice.",
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "dist/src/index.js",
|
|
8
|
-
"types": "dist/src/index.d.ts",
|
|
9
|
-
"files": [
|
|
10
|
-
"dist/src",
|
|
11
|
-
"docs",
|
|
12
|
-
"README.md",
|
|
13
|
-
"LICENSE"
|
|
14
|
-
],
|
|
15
|
-
"author": "Lintsure <hello@lintsure.com>",
|
|
16
|
-
"homepage": "https://lintsure.com/docs",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/lintsure/lintsure.git"
|
|
20
|
-
},
|
|
21
|
-
"bugs": {
|
|
22
|
-
"url": "https://github.com/lintsure/lintsure/issues",
|
|
23
|
-
"email": "support@lintsure.com"
|
|
24
|
-
},
|
|
25
|
-
"engines": {
|
|
26
|
-
"node": ">=22"
|
|
27
|
-
},
|
|
28
|
-
"publishConfig": {
|
|
29
|
-
"access": "public"
|
|
30
|
-
},
|
|
31
|
-
"keywords": [
|
|
32
|
-
"compliance",
|
|
33
|
-
"gdpr",
|
|
34
|
-
"eu-ai-act",
|
|
35
|
-
"mcp",
|
|
36
|
-
"static-analysis",
|
|
37
|
-
"readiness"
|
|
38
|
-
],
|
|
39
|
-
"scripts": {
|
|
40
|
-
"prepublishOnly": "cd ../.. && npm test"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@lintsure/core",
|
|
3
|
+
"version": "0.3.18",
|
|
4
|
+
"description": "Lintsure engine: rules, framework knowledge and reports for readiness checks of AI-written code. Not an audit or legal advice.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/src/index.js",
|
|
8
|
+
"types": "dist/src/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/src",
|
|
11
|
+
"docs",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"author": "Lintsure <hello@lintsure.com>",
|
|
16
|
+
"homepage": "https://lintsure.com/docs",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/lintsure/lintsure.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/lintsure/lintsure/issues",
|
|
23
|
+
"email": "support@lintsure.com"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=22"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"compliance",
|
|
33
|
+
"gdpr",
|
|
34
|
+
"eu-ai-act",
|
|
35
|
+
"mcp",
|
|
36
|
+
"static-analysis",
|
|
37
|
+
"readiness"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"prepublishOnly": "cd ../.. && npm test"
|
|
41
|
+
}
|
|
42
|
+
}
|