eslint-plugin-anthropic-security 0.3.4 → 1.0.0
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/README.md
CHANGED
|
@@ -149,6 +149,7 @@ Part of the **Interlace ESLint ecosystem** — AI-native rules with LLM-optimize
|
|
|
149
149
|
| [`eslint-plugin-secure-coding`](https://www.npmjs.com/package/eslint-plugin-secure-coding) | [](https://www.npmjs.com/package/eslint-plugin-secure-coding) | Injection prevention. |
|
|
150
150
|
| [`eslint-plugin-sequelize-security`](https://www.npmjs.com/package/eslint-plugin-sequelize-security) | [](https://www.npmjs.com/package/eslint-plugin-sequelize-security) | Sequelize ORM security. |
|
|
151
151
|
| [`eslint-plugin-sqlite-security`](https://www.npmjs.com/package/eslint-plugin-sqlite-security) | [](https://www.npmjs.com/package/eslint-plugin-sqlite-security) | SQLite security. |
|
|
152
|
+
| [`eslint-plugin-supabase-security`](https://www.npmjs.com/package/eslint-plugin-supabase-security) | [](https://www.npmjs.com/package/eslint-plugin-supabase-security) | Supabase security. |
|
|
152
153
|
| [`eslint-plugin-typeorm-security`](https://www.npmjs.com/package/eslint-plugin-typeorm-security) | [](https://www.npmjs.com/package/eslint-plugin-typeorm-security) | TypeORM security. |
|
|
153
154
|
| [`eslint-plugin-vercel-ai-security`](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | [](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | AI SDK security. |
|
|
154
155
|
|
|
@@ -156,6 +157,7 @@ Part of the **Interlace ESLint ecosystem** — AI-native rules with LLM-optimize
|
|
|
156
157
|
|
|
157
158
|
| Plugin | Downloads | Description |
|
|
158
159
|
| :--- | :---: | :--- |
|
|
160
|
+
| [`eslint-plugin-cli-floor`](https://www.npmjs.com/package/eslint-plugin-cli-floor) | [](https://www.npmjs.com/package/eslint-plugin-cli-floor) | CLI floor for commander, yargs and burgee. |
|
|
159
161
|
| [`eslint-plugin-conventions`](https://www.npmjs.com/package/eslint-plugin-conventions) | [](https://www.npmjs.com/package/eslint-plugin-conventions) | Team-specific habits and styles. |
|
|
160
162
|
| [`eslint-plugin-import-next`](https://www.npmjs.com/package/eslint-plugin-import-next) | [](https://www.npmjs.com/package/eslint-plugin-import-next) | Fast cycle + import-graph analysis. |
|
|
161
163
|
| [`eslint-plugin-maintainability`](https://www.npmjs.com/package/eslint-plugin-maintainability) | [](https://www.npmjs.com/package/eslint-plugin-maintainability) | Cognitive load and clean-code patterns. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-anthropic-security",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "ESLint plugin for Anthropic SDK security — catches hardcoded Claude API keys, the browser escape hatch that ships them to every visitor, and system prompts assembled from untrusted input.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@interlace/eslint-devkit": "^1.
|
|
78
|
+
"@interlace/eslint-devkit": "^1.20.0"
|
|
79
79
|
},
|
|
80
80
|
"funding": {
|
|
81
81
|
"type": "github",
|
package/src/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.configs=exports.plugin=exports.rules=exports.noUntrustedContentInPrompt=exports.noHardcodedApiKey=exports.noBrowserApiKeyExposure=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");var no_browser_api_key_exposure_2=require("./rules/no-browser-api-key-exposure");Object.defineProperty(exports,"noBrowserApiKeyExposure",{enumerable:true,get:function(){return no_browser_api_key_exposure_2.noBrowserApiKeyExposure}});var no_hardcoded_api_key_2=require("./rules/no-hardcoded-api-key");Object.defineProperty(exports,"noHardcodedApiKey",{enumerable:true,get:function(){return no_hardcoded_api_key_2.noHardcodedApiKey}});var no_untrusted_content_in_prompt_2=require("./rules/no-untrusted-content-in-prompt");Object.defineProperty(exports,"noUntrustedContentInPrompt",{enumerable:true,get:function(){return no_untrusted_content_in_prompt_2.noUntrustedContentInPrompt}});exports.rules={get"no-browser-api-key-exposure"(){return require("./rules/no-browser-api-key-exposure").noBrowserApiKeyExposure},get"no-hardcoded-api-key"(){return require("./rules/no-hardcoded-api-key").noHardcodedApiKey},get"no-untrusted-content-in-prompt"(){return require("./rules/no-untrusted-content-in-prompt").noUntrustedContentInPrompt}};(0,eslint_devkit_1.withCanonicalDocsUrls)("plugin-anthropic-security",exports.rules);exports.plugin={meta:{name:"eslint-plugin-anthropic-security",version:"0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.configs=exports.plugin=exports.rules=exports.noUntrustedContentInPrompt=exports.noHardcodedApiKey=exports.noBrowserApiKeyExposure=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");var no_browser_api_key_exposure_2=require("./rules/no-browser-api-key-exposure");Object.defineProperty(exports,"noBrowserApiKeyExposure",{enumerable:true,get:function(){return no_browser_api_key_exposure_2.noBrowserApiKeyExposure}});var no_hardcoded_api_key_2=require("./rules/no-hardcoded-api-key");Object.defineProperty(exports,"noHardcodedApiKey",{enumerable:true,get:function(){return no_hardcoded_api_key_2.noHardcodedApiKey}});var no_untrusted_content_in_prompt_2=require("./rules/no-untrusted-content-in-prompt");Object.defineProperty(exports,"noUntrustedContentInPrompt",{enumerable:true,get:function(){return no_untrusted_content_in_prompt_2.noUntrustedContentInPrompt}});exports.rules={get"no-browser-api-key-exposure"(){return require("./rules/no-browser-api-key-exposure").noBrowserApiKeyExposure},get"no-hardcoded-api-key"(){return require("./rules/no-hardcoded-api-key").noHardcodedApiKey},get"no-untrusted-content-in-prompt"(){return require("./rules/no-untrusted-content-in-prompt").noUntrustedContentInPrompt}};(0,eslint_devkit_1.withCanonicalDocsUrls)("plugin-anthropic-security",exports.rules);exports.plugin={meta:{name:"eslint-plugin-anthropic-security",version:"1.0.0"},rules:exports.rules};const enabled={plugins:{"anthropic-security":exports.plugin},rules:{"anthropic-security/no-browser-api-key-exposure":"error","anthropic-security/no-hardcoded-api-key":"error"}};const strict={plugins:{"anthropic-security":exports.plugin},rules:{...enabled.rules,"anthropic-security/no-untrusted-content-in-prompt":"error"}};exports.configs={minimal:enabled,recommended:enabled,strict};exports.default={...exports.plugin,configs:exports.configs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.noBrowserApiKeyExposure=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.noBrowserApiKeyExposure=(0,eslint_devkit_1.createBrowserEscapeHatchRule)({ruleName:"no-browser-api-key-exposure",vendor:"Anthropic",modules:["@anthropic-ai"],docsUrl:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-anthropic-security/docs/rules/no-browser-api-key-exposure.md",documentationLink:"https://docs.anthropic.com/en/api/getting-started"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.noBrowserApiKeyExposure=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.noBrowserApiKeyExposure=(0,eslint_devkit_1.createBrowserEscapeHatchRule)({ruleName:"no-browser-api-key-exposure",vendor:"Anthropic",modules:["@anthropic-ai"],credentialProps:["apiKey","authToken"],docsUrl:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-anthropic-security/docs/rules/no-browser-api-key-exposure.md",documentationLink:"https://docs.anthropic.com/en/api/getting-started"});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.noHardcodedApiKey=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.noHardcodedApiKey=(0,eslint_devkit_1.createSdkApiKeyRule)({ruleName:"no-hardcoded-api-key",vendor:"Anthropic",modules:["@anthropic-ai"],keyProps:["apiKey","authToken"],fixTemplate:"new Anthropic({ {{prop}}: process.env.ANTHROPIC_API_KEY })",docsUrl:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-anthropic-security/docs/rules/no-hardcoded-api-key.md",documentationLink:"https://docs.anthropic.com/en/api/getting-started"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.noHardcodedApiKey=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.noHardcodedApiKey=(0,eslint_devkit_1.createSdkApiKeyRule)({ruleName:"no-hardcoded-api-key",vendor:"Anthropic",modules:["@anthropic-ai"],keyProps:["apiKey","authToken","webhookKey","awsSecretKey","awsSecretAccessKey","awsSessionToken","accessToken"],fixTemplate:"new Anthropic({ {{prop}}: process.env.ANTHROPIC_API_KEY })",docsUrl:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-anthropic-security/docs/rules/no-hardcoded-api-key.md",documentationLink:"https://docs.anthropic.com/en/api/getting-started"});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.noUntrustedContentInPrompt=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.noUntrustedContentInPrompt=(0,eslint_devkit_1.createSystemPromptInjectionRule)({ruleName:"no-untrusted-content-in-prompt",vendor:"Anthropic",modules:["@anthropic-ai"],requestPaths:["messages.create","messages.stream"],systemPromptProps:["system"],docsUrl:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-anthropic-security/docs/rules/no-untrusted-content-in-prompt.md",documentationLink:"https://docs.anthropic.com/en/docs/system-prompts"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.noUntrustedContentInPrompt=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.noUntrustedContentInPrompt=(0,eslint_devkit_1.createSystemPromptInjectionRule)({ruleName:"no-untrusted-content-in-prompt",vendor:"Anthropic",modules:["@anthropic-ai"],requestPaths:["messages.create","messages.stream","messages.parse","messages.toolRunner"],systemPromptProps:["system"],batchRequestPaths:["messages.batches.create"],docsUrl:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-anthropic-security/docs/rules/no-untrusted-content-in-prompt.md",documentationLink:"https://docs.anthropic.com/en/docs/system-prompts"});
|