eslint-plugin-vercel-ai-security 1.4.0 → 1.4.2
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/package.json +5 -20
- package/src/index.d.ts +17 -74
- package/src/index.js +1 -99
- package/src/oxlint.d.ts +17 -20
- package/src/oxlint.js +0 -18
- package/src/rules/no-dynamic-system-prompt/index.js +1 -23
- package/src/rules/no-hardcoded-api-keys/index.js +5 -28
- package/src/rules/no-sensitive-in-prompt/index.js +1 -21
- package/src/rules/no-system-prompt-leak/index.js +0 -25
- package/src/rules/no-training-data-exposure/index.js +0 -16
- package/src/rules/no-unsafe-output-handling/index.js +0 -35
- package/src/rules/require-abort-signal/index.js +0 -14
- package/src/rules/require-audit-logging/index.js +0 -24
- package/src/rules/require-embedding-validation/index.js +0 -23
- package/src/rules/require-error-handling/index.js +0 -19
- package/src/rules/require-max-steps/index.js +0 -18
- package/src/rules/require-max-tokens/index.js +0 -14
- package/src/rules/require-output-filtering/index.js +0 -23
- package/src/rules/require-output-validation/index.js +0 -23
- package/src/rules/require-rag-content-validation/index.js +1 -29
- package/src/rules/require-request-timeout/index.js +0 -16
- package/src/rules/require-tool-confirmation/index.js +1 -25
- package/src/rules/require-tool-schema/index.js +0 -19
- package/src/rules/require-validated-prompt/index.js +1 -34
- package/src/types/index.js +0 -5
- package/src/utils/prompt-props.js +8 -28
- package/AGENTS.md +0 -131
- package/CHANGELOG.md +0 -255
- package/src/rules/no-dynamic-system-prompt/index.d.ts +0 -14
- package/src/rules/no-hardcoded-api-keys/index.d.ts +0 -14
- package/src/rules/no-sensitive-in-prompt/index.d.ts +0 -14
- package/src/rules/no-system-prompt-leak/index.d.ts +0 -14
- package/src/rules/no-training-data-exposure/index.d.ts +0 -14
- package/src/rules/no-unsafe-output-handling/index.d.ts +0 -15
- package/src/rules/require-abort-signal/index.d.ts +0 -14
- package/src/rules/require-audit-logging/index.d.ts +0 -14
- package/src/rules/require-embedding-validation/index.d.ts +0 -16
- package/src/rules/require-error-handling/index.d.ts +0 -14
- package/src/rules/require-max-steps/index.d.ts +0 -14
- package/src/rules/require-max-tokens/index.d.ts +0 -16
- package/src/rules/require-output-filtering/index.d.ts +0 -16
- package/src/rules/require-output-validation/index.d.ts +0 -16
- package/src/rules/require-rag-content-validation/index.d.ts +0 -16
- package/src/rules/require-request-timeout/index.d.ts +0 -14
- package/src/rules/require-tool-confirmation/index.d.ts +0 -14
- package/src/rules/require-tool-schema/index.d.ts +0 -15
- package/src/rules/require-validated-prompt/index.d.ts +0 -19
- package/src/utils/prompt-props.d.ts +0 -27
package/CHANGELOG.md
DELETED
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
## 1.4.0
|
|
2
|
-
|
|
3
|
-
### Minor Changes
|
|
4
|
-
|
|
5
|
-
- [#299](https://github.com/ofri-peretz/eslint/pull/299) [`608defb`](https://github.com/ofri-peretz/eslint/commit/608defbbce6818e2ad4f51d7425e044c4ca04e3e) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Detect the AI SDK v7 `instructions` option, not just the deprecated `system`.
|
|
6
|
-
|
|
7
|
-
AI SDK v7 renamed the system-prompt option to `instructions` and marks `system` as
|
|
8
|
-
`@deprecated Use 'instructions' instead` in its own type definitions. Four rules matched
|
|
9
|
-
the property name `system` literally, so on any code written against current AI SDK docs
|
|
10
|
-
they reported nothing at all:
|
|
11
|
-
|
|
12
|
-
- `no-dynamic-system-prompt`
|
|
13
|
-
- `require-validated-prompt` (its `unsafeSystemPrompt` branch)
|
|
14
|
-
- `require-rag-content-validation`
|
|
15
|
-
- `no-sensitive-in-prompt`
|
|
16
|
-
|
|
17
|
-
All four now accept either spelling via a shared `SYSTEM_PROMPT_PROPS` set, so `system`
|
|
18
|
-
keeps working for pre-v7 code and `instructions` is covered going forward.
|
|
19
|
-
|
|
20
|
-
The same pass closed a second silent miss in those rules: a quoted key
|
|
21
|
-
(`{ "instructions": … }`) parses to a string `Literal`, not an `Identifier`, and
|
|
22
|
-
three of the four rules read only `Identifier` keys — so putting quotes round the
|
|
23
|
-
key was enough to stop them firing. Key extraction now goes through a shared
|
|
24
|
-
`getStaticPropName` helper. Three fixtures that recorded this as expected
|
|
25
|
-
behaviour (one labelled "documented FN: only Identifier keys are matched") moved
|
|
26
|
-
from `valid` to `invalid`, since a rule that stops firing on formatting is a miss,
|
|
27
|
-
not a design decision. Computed keys (`{ [k]: … }`) still return `null` — there
|
|
28
|
-
the name genuinely isn't statically known.
|
|
29
|
-
|
|
30
|
-
This was found the hard way. Scanning the `nuxt-ui-templates/chat` template, a system
|
|
31
|
-
prompt interpolating the signed-in user's name straight into `instructions:` went
|
|
32
|
-
unreported — the finding was spotted by reading the file, not by the linter that exists to
|
|
33
|
-
catch it. Each of the four rules now carries a regression test that fails if the
|
|
34
|
-
`instructions` spelling is dropped again, and one of them uses the exact template-literal
|
|
35
|
-
shape from that file.
|
|
36
|
-
|
|
37
|
-
### Patch Changes
|
|
38
|
-
|
|
39
|
-
- Updated dependencies [[`09d2951`](https://github.com/ofri-peretz/eslint/commit/09d2951b3ac74efc9ba49b64e9089d66800b16cc)]:
|
|
40
|
-
- @interlace/eslint-devkit@1.4.4
|
|
41
|
-
|
|
42
|
-
## 1.3.10
|
|
43
|
-
|
|
44
|
-
### Patch Changes
|
|
45
|
-
|
|
46
|
-
- [#294](https://github.com/ofri-peretz/eslint/pull/294) [`659f6dc`](https://github.com/ofri-peretz/eslint/commit/659f6dc0181b03b675f72b5949fcf123dd066358) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Rewrite `description` and `keywords` on every published package for npm search discovery. npm ranks on name, description, and keywords, and the registry only picks up these fields at publish — so this is metadata-only and takes effect for each package on its next release.
|
|
47
|
-
|
|
48
|
-
**Descriptions now lead with the search phrase.** Every one starts `ESLint plugin for <the thing you'd search>` instead of a brand-first or category-first framing, and names the concrete vulnerabilities the plugin actually detects. Three were corrected while doing so:
|
|
49
|
-
|
|
50
|
-
- `eslint-plugin-import-next` claimed "100x faster no-cycle detection". No 100x measurement exists: `CLAIMS.md` records **3.1x end-to-end** (8x in pure rule execution) on a 5,483-file React codebase, and the highest number in any benchmark result is 54.9x on the synthetic corpus. The description now states the real-codebase figure.
|
|
51
|
-
- `eslint-plugin-secure-coding` claimed SQL injection, XSS and CSRF coverage — none of which are its rules. It now names what it does detect: LDAP, XPath, XXE, GraphQL and template injection, unsafe deserialization, ReDoS, missing authentication, and PII in logs.
|
|
52
|
-
- `eslint-plugin-secure-coding` ("89 rules") and `eslint-plugin-react-a11y` ("37 rules") hard-coded rule counts that had drifted from reality. Counts are generated into `interlace-numbers.json`; hand-typed copies are removed rather than corrected.
|
|
53
|
-
|
|
54
|
-
**Keywords now match the vocabulary of the plugins that rank.** `eslint-plugin-security`, `eslint-plugin-jsx-a11y`, `eslint-plugin-n` and `eslint-plugin-import` all carry the `eslint` / `eslintplugin` / `eslint-plugin` trio — six of our packages were missing `eslintplugin`, and every one now carries all three plus `static-analysis`, `linting` and `code-quality`. Security plugins add `sast`, `appsec` and `vulnerability`; `node-security` and `secure-coding` also carry `nodesecurity`, the exact keyword `eslint-plugin-security` ranks on. Each plugin gained the CWE identifiers and attack names for what it detects (`cwe-78` command injection, `cwe-22` path traversal, `cwe-89` SQL injection, `cwe-79` XSS, `cwe-347` JWT algorithm confusion, `cwe-352` CSRF, `cwe-943` NoSQL injection), and `node-security` gained the crypto vocabulary it had been missing entirely despite absorbing the crypto rule set (`crypto`, `cryptography`, `weak-hash`, `md5`, `sha1`, `timing-attack`).
|
|
55
|
-
|
|
56
|
-
No rule behavior, exports, or configuration changes.
|
|
57
|
-
|
|
58
|
-
- Updated dependencies [[`e1cdf83`](https://github.com/ofri-peretz/eslint/commit/e1cdf83e3db761907f0ab06f7fc6c1f1da7513a5), [`659f6dc`](https://github.com/ofri-peretz/eslint/commit/659f6dc0181b03b675f72b5949fcf123dd066358)]:
|
|
59
|
-
- @interlace/eslint-devkit@1.4.3
|
|
60
|
-
|
|
61
|
-
## 1.3.9
|
|
62
|
-
|
|
63
|
-
### Patch Changes
|
|
64
|
-
|
|
65
|
-
- [#277](https://github.com/ofri-peretz/eslint/pull/277) [`d1ad332`](https://github.com/ofri-peretz/eslint/commit/d1ad332cc7366887482b288bcf65098d425501d0) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Accept AI SDK v5+ idioms: `stopWhen` (e.g. `stopWhen: stepCountIs(5)`) now satisfies require-max-steps, and `maxOutputTokens` (v5 rename of `maxTokens`) satisfies require-max-tokens — fixing false positives on v5/v7 code.
|
|
66
|
-
|
|
67
|
-
## 1.3.8
|
|
68
|
-
|
|
69
|
-
### Patch Changes
|
|
70
|
-
|
|
71
|
-
- [#269](https://github.com/ofri-peretz/eslint/pull/269) [`7028fe2`](https://github.com/ofri-peretz/eslint/commit/7028fe2668a42266d831014184dcef70e73101ad) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - docs: dual-logo README header (Interlace mark + ESLint mark side by side) and closing Interlace footer — refreshes the README rendered on npmjs.com. No runtime changes.
|
|
72
|
-
|
|
73
|
-
- Updated dependencies [[`7028fe2`](https://github.com/ofri-peretz/eslint/commit/7028fe2668a42266d831014184dcef70e73101ad)]:
|
|
74
|
-
- @interlace/eslint-devkit@1.4.2
|
|
75
|
-
|
|
76
|
-
## 1.3.7
|
|
77
|
-
|
|
78
|
-
### Patch Changes
|
|
79
|
-
|
|
80
|
-
- [#252](https://github.com/ofri-peretz/eslint/pull/252) [`d67e395`](https://github.com/ofri-peretz/eslint/commit/d67e3953c2748ad36e6aebe0f24b1d04e518b4d0) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Fix Codecov badge showing "unknown" — switch from flag to component URL format
|
|
81
|
-
|
|
82
|
-
## 1.3.6
|
|
83
|
-
|
|
84
|
-
### Patch Changes
|
|
85
|
-
|
|
86
|
-
- [#144](https://github.com/ofri-peretz/eslint/pull/144) [`8843ce7`](https://github.com/ofri-peretz/eslint/commit/8843ce7fbb465caad161b97032467b3a37a49319) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - fix: ILB-Wild FP reduction + doc examples + doc-test-alignment scanner fixes
|
|
87
|
-
|
|
88
|
-
**`no-unlimited-resource-allocation` — FP reduction (430 Edge FPs)**
|
|
89
|
-
- Skip loop-allocation reporting when the first argument is a numeric literal (e.g. `Buffer.alloc(1024)` inside a loop is statically bounded, not a risk)
|
|
90
|
-
- Skip `Array.isArray`, `Array.from`, `Array.of` calls in the `alloc/Array` pattern check (these don't allocate unbounded memory)
|
|
91
|
-
|
|
92
|
-
**`no-hardcoded-credentials` — FP reduction (~280 Edge FPs)**
|
|
93
|
-
- Extended test-file skip to cover `.fixture.`, `.mock.`, `__mocks__/`, `/tests/`, `/fixtures/`, `/mocks/` paths
|
|
94
|
-
- Skip string literals that are fallback values in `process.env.X || 'fallback'` expressions — the secret lives in the environment, the string is only a dev-mode default
|
|
95
|
-
|
|
96
|
-
**Doc examples — 4 rules now have ❌ Incorrect examples**
|
|
97
|
-
- `lambda-security/no-missing-authorization-check`
|
|
98
|
-
- `lambda-security/no-overly-permissive-iam-policy`
|
|
99
|
-
- `node-security/prefer-native-crypto` (renamed non-standard `### ❌ Third-Party (Flagged)` to `### ❌ Incorrect`)
|
|
100
|
-
- `vercel-ai-security/require-tool-confirmation` (replaced placeholder with a real tested example)
|
|
101
|
-
|
|
102
|
-
**`ilb-doc-test-alignment` scanner fixes**
|
|
103
|
-
- Accept both `## ❌` and `### ❌` headings (docs use H3 under an H2 `## Examples` section; was only finding H2)
|
|
104
|
-
- Slice from end-of-line rather than end-of-regex-match (prevents `## ❌ Incorrect Code` from leaving a partial heading in the parsed section)
|
|
105
|
-
|
|
106
|
-
Result: `ilb:doc-test-alignment` → 206 ok, 0 doc has no ❌ examples (was 165 missing).
|
|
107
|
-
|
|
108
|
-
- [#143](https://github.com/ofri-peretz/eslint/pull/143) [`213cde1`](https://github.com/ofri-peretz/eslint/commit/213cde190ff2aea49ca7c1b533170940f879d9b4) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - fix(no-missing-null-checks): eliminate 53 false positives via three new narrowing patterns
|
|
109
|
-
|
|
110
|
-
Rules that were recognized as null guards are now correctly identified as safe:
|
|
111
|
-
1. **Truthy if guard** — `if (obj) { obj.prop }` — direct truthy check proves non-null. Also covers chains: `if (response)` protects `response.data.items`.
|
|
112
|
-
2. **Short-circuit AND** — `obj && obj.prop` — right side of `&&` only runs when left is truthy.
|
|
113
|
-
3. **Ternary consequent** — `obj ? obj.prop : fallback` — truthy test guards the consequent.
|
|
114
|
-
|
|
115
|
-
Also: bumped `beforeAll` timeout to 30 seconds in 7 compatibility test files (`__compatibility__/*.spec.ts`). Native-addon packages routinely exceed the previous 10-second default on a cold ESM load.
|
|
116
|
-
|
|
117
|
-
- Updated dependencies [[`736a5fe`](https://github.com/ofri-peretz/eslint/commit/736a5fed47e673f6157ea900b29fe2a54e4bc7df)]:
|
|
118
|
-
- @interlace/eslint-devkit@1.4.1
|
|
119
|
-
|
|
120
|
-
## 1.3.5 (2026-02-09)
|
|
121
|
-
|
|
122
|
-
This was a version bump only for eslint-plugin-vercel-ai-security to align it with other projects, there were no code changes.
|
|
123
|
-
|
|
124
|
-
## [1.3.3] - 2026-02-08
|
|
125
|
-
|
|
126
|
-
### Bug Fixes
|
|
127
|
-
|
|
128
|
-
- align codecov component IDs with full package names ([2831b968](https://github.com/ofri-peretz/eslint/commit/2831b968))
|
|
129
|
-
|
|
130
|
-
### Documentation
|
|
131
|
-
|
|
132
|
-
- fix changelog header format across all packages ([c3a15082](https://github.com/ofri-peretz/eslint/commit/c3a15082))
|
|
133
|
-
|
|
134
|
-
### ❤️ Thank You
|
|
135
|
-
|
|
136
|
-
- Ofri Peretz
|
|
137
|
-
|
|
138
|
-
## [1.3.2] - 2026-02-06
|
|
139
|
-
|
|
140
|
-
### Bug Fixes
|
|
141
|
-
|
|
142
|
-
- align codecov component names and update docs components ([0a59a86c](https://github.com/ofri-peretz/eslint/commit/0a59a86c))
|
|
143
|
-
|
|
144
|
-
### ❤️ Thank You
|
|
145
|
-
|
|
146
|
-
- Ofri Peretz
|
|
147
|
-
|
|
148
|
-
## [1.3.1] - 2026-02-02
|
|
149
|
-
|
|
150
|
-
This was a version bump only for eslint-plugin-vercel-ai-security to align it with other projects, there were no code changes.
|
|
151
|
-
|
|
152
|
-
# Changelog
|
|
153
|
-
|
|
154
|
-
All notable changes to `eslint-plugin-vercel-ai-security` will be documented in this file.
|
|
155
|
-
|
|
156
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
157
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
## [1.0.1] - 2024-12-13
|
|
162
|
-
|
|
163
|
-
### Added
|
|
164
|
-
|
|
165
|
-
- **Peer Dependencies**: Added explicit peer dependency requirements:
|
|
166
|
-
- `eslint`: `^8.0.0 || ^9.0.0`
|
|
167
|
-
- `ai` (Vercel AI SDK): `^3.0.0 || ^4.0.0 || ^5.0.0`
|
|
168
|
-
|
|
169
|
-
### Changed
|
|
170
|
-
|
|
171
|
-
- Updated README compatibility section to reflect supported versions
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
## [0.2.0] - 2024-12-13
|
|
176
|
-
|
|
177
|
-
### Added
|
|
178
|
-
|
|
179
|
-
#### 🔒 New Security Rules (+5)
|
|
180
|
-
|
|
181
|
-
- **`no-system-prompt-leak`** - Prevent system prompts from being exposed in API responses (LLM07)
|
|
182
|
-
- **`no-dynamic-system-prompt`** - Prevent dynamic content in system prompts (ASI01)
|
|
183
|
-
- **`require-output-filtering`** - Require filtering of sensitive data in tool output (ASI04)
|
|
184
|
-
- **`require-audit-logging`** - Suggest audit logging for AI operations (ASI10)
|
|
185
|
-
- **`require-rag-content-validation`** - Validate RAG content before use in prompts (ASI07)
|
|
186
|
-
|
|
187
|
-
#### ⚙️ New Configuration
|
|
188
|
-
|
|
189
|
-
- **`minimal`** - Gradual adoption config with only 2 critical rules
|
|
190
|
-
|
|
191
|
-
#### 📚 Documentation
|
|
192
|
-
|
|
193
|
-
- Individual documentation for all 15 rules in `/docs/rules/`
|
|
194
|
-
- Updated README with complete OWASP coverage tables
|
|
195
|
-
- Options documentation for each rule
|
|
196
|
-
|
|
197
|
-
### Changed
|
|
198
|
-
|
|
199
|
-
- **Plugin version**: 0.1.0 → 0.2.0
|
|
200
|
-
- **Total rules**: 10 → 15
|
|
201
|
-
- **Total tests**: 122 → 168
|
|
202
|
-
- **OWASP LLM coverage**: 5/10 → 6/10
|
|
203
|
-
- **OWASP Agentic coverage**: 5/10 → 9/10
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
## [0.1.0] - 2024-12-13
|
|
208
|
-
|
|
209
|
-
### Added
|
|
210
|
-
|
|
211
|
-
#### 🔒 Security Rules (10 Total)
|
|
212
|
-
|
|
213
|
-
##### Critical Priority
|
|
214
|
-
|
|
215
|
-
- **`require-validated-prompt`** - Detect unsafe prompts (CWE-74, OWASP LLM01)
|
|
216
|
-
- **`no-sensitive-in-prompt`** - Prevent secrets/PII in prompts (CWE-200, OWASP LLM02)
|
|
217
|
-
- **`no-hardcoded-api-keys`** - Detect hardcoded API keys (CWE-798, OWASP ASI03)
|
|
218
|
-
- **`no-unsafe-output-handling`** - Prevent unsafe output handling (CWE-94, OWASP LLM05/ASI05)
|
|
219
|
-
|
|
220
|
-
##### High Priority
|
|
221
|
-
|
|
222
|
-
- **`require-tool-schema`** - Ensure tools have Zod inputSchema (CWE-20, OWASP ASI02)
|
|
223
|
-
- **`require-max-tokens`** - Require maxTokens limit (CWE-770, OWASP LLM10)
|
|
224
|
-
- **`require-max-steps`** - Require maxSteps for multi-step tool calling (CWE-834, OWASP LLM10)
|
|
225
|
-
- **`require-tool-confirmation`** - Require confirmation for destructive tools (CWE-862, OWASP ASI09/LLM06)
|
|
226
|
-
|
|
227
|
-
##### Medium Priority
|
|
228
|
-
|
|
229
|
-
- **`require-error-handling`** - Require try-catch for AI calls (CWE-755, OWASP ASI08)
|
|
230
|
-
- **`require-abort-signal`** - Require AbortSignal for streaming calls (CWE-404)
|
|
231
|
-
|
|
232
|
-
#### ⚙️ Configurations
|
|
233
|
-
|
|
234
|
-
- `recommended` - Balanced security (critical rules as errors, high as warnings)
|
|
235
|
-
- `strict` - Maximum security (all rules enabled)
|
|
236
|
-
|
|
237
|
-
#### 📊 Coverage
|
|
238
|
-
|
|
239
|
-
- **122 tests passing**
|
|
240
|
-
- **98.31% line coverage**
|
|
241
|
-
- **100% function coverage**
|
|
242
|
-
|
|
243
|
-
#### 📚 Documentation
|
|
244
|
-
|
|
245
|
-
- Comprehensive README with AEO optimization
|
|
246
|
-
- AGENTS.md for AI coding assistants
|
|
247
|
-
- Full OWASP LLM Top 10 and OWASP Agentic Top 10 mapping
|
|
248
|
-
|
|
249
|
-
#### Supported Functions
|
|
250
|
-
|
|
251
|
-
- `generateText` - Full coverage
|
|
252
|
-
- `streamText` - Full coverage with abort signal
|
|
253
|
-
- `generateObject` - Full coverage
|
|
254
|
-
- `streamObject` - Full coverage with abort signal
|
|
255
|
-
- `tool()` helper - Schema validation
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Allow template literals with only static parts */
|
|
8
|
-
allowStaticTemplates?: boolean;
|
|
9
|
-
}
|
|
10
|
-
type RuleOptions = [Options?];
|
|
11
|
-
export declare const noDynamicSystemPrompt: import("@typescript-eslint/utils/ts-eslint").RuleModule<"dynamicSystemPrompt", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Patterns that suggest API key configuration */
|
|
8
|
-
apiKeyPatterns?: string[];
|
|
9
|
-
}
|
|
10
|
-
type RuleOptions = [Options?];
|
|
11
|
-
export declare const noHardcodedApiKeys: import("@typescript-eslint/utils/ts-eslint").RuleModule<"hardcodedApiKey", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Patterns that suggest sensitive data */
|
|
8
|
-
sensitivePatterns?: string[];
|
|
9
|
-
}
|
|
10
|
-
type RuleOptions = [Options?];
|
|
11
|
-
export declare const noSensitiveInPrompt: import("@typescript-eslint/utils/ts-eslint").RuleModule<"sensitiveInPrompt", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Patterns that suggest system prompt variables */
|
|
8
|
-
systemPromptPatterns?: string[];
|
|
9
|
-
}
|
|
10
|
-
type RuleOptions = [Options?];
|
|
11
|
-
export declare const noSystemPromptLeak: import("@typescript-eslint/utils/ts-eslint").RuleModule<"systemPromptLeak", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Patterns suggesting training endpoints or flags */
|
|
8
|
-
trainingPatterns?: string[];
|
|
9
|
-
}
|
|
10
|
-
type RuleOptions = [Options?];
|
|
11
|
-
export declare const noTrainingDataExposure: import("@typescript-eslint/utils/ts-eslint").RuleModule<"trainingDataExposure", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
type MessageIds = 'unsafeOutputExecution' | 'unsafeOutputInSQL' | 'unsafeOutputInHTML';
|
|
7
|
-
export interface Options {
|
|
8
|
-
/** Variable patterns that suggest AI output */
|
|
9
|
-
aiOutputPatterns?: string[];
|
|
10
|
-
}
|
|
11
|
-
type RuleOptions = [Options?];
|
|
12
|
-
export declare const noUnsafeOutputHandling: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
13
|
-
name: string;
|
|
14
|
-
};
|
|
15
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Functions that should have abort signal */
|
|
8
|
-
targetFunctions?: string[];
|
|
9
|
-
}
|
|
10
|
-
type RuleOptions = [Options?];
|
|
11
|
-
export declare const requireAbortSignal: import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingAbortSignal", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Disable in test files */
|
|
8
|
-
allowInTests?: boolean;
|
|
9
|
-
}
|
|
10
|
-
type RuleOptions = [Options?];
|
|
11
|
-
export declare const requireAuditLogging: import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingAuditLogging", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Patterns suggesting embedding operations */
|
|
8
|
-
embeddingPatterns?: string[];
|
|
9
|
-
/** Functions that validate embeddings */
|
|
10
|
-
validatorFunctions?: string[];
|
|
11
|
-
}
|
|
12
|
-
type RuleOptions = [Options?];
|
|
13
|
-
export declare const requireEmbeddingValidation: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unvalidatedEmbedding", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
14
|
-
name: string;
|
|
15
|
-
};
|
|
16
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Allow unhandled AI calls in test files */
|
|
8
|
-
allowInTests?: boolean;
|
|
9
|
-
}
|
|
10
|
-
type RuleOptions = [Options?];
|
|
11
|
-
export declare const requireErrorHandling: import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingErrorHandling", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Default max steps to suggest */
|
|
8
|
-
suggestedMaxSteps?: number;
|
|
9
|
-
}
|
|
10
|
-
type RuleOptions = [Options?];
|
|
11
|
-
export declare const requireMaxSteps: import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingMaxSteps", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Default max tokens to suggest */
|
|
8
|
-
suggestedLimit?: number;
|
|
9
|
-
/** Functions that require max tokens */
|
|
10
|
-
targetFunctions?: string[];
|
|
11
|
-
}
|
|
12
|
-
type RuleOptions = [Options?];
|
|
13
|
-
export declare const requireMaxTokens: import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingMaxTokens", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
14
|
-
name: string;
|
|
15
|
-
};
|
|
16
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Patterns suggesting data sources that need filtering */
|
|
8
|
-
dataSourcePatterns?: string[];
|
|
9
|
-
/** Function names that are considered safe filters */
|
|
10
|
-
filterFunctions?: string[];
|
|
11
|
-
}
|
|
12
|
-
type RuleOptions = [Options?];
|
|
13
|
-
export declare const requireOutputFiltering: import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingOutputFilter", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
14
|
-
name: string;
|
|
15
|
-
};
|
|
16
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Patterns suggesting display operations */
|
|
8
|
-
displayPatterns?: string[];
|
|
9
|
-
/** Functions that validate output */
|
|
10
|
-
validatorFunctions?: string[];
|
|
11
|
-
}
|
|
12
|
-
type RuleOptions = [Options?];
|
|
13
|
-
export declare const requireOutputValidation: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unvalidatedOutput", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
14
|
-
name: string;
|
|
15
|
-
};
|
|
16
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Patterns suggesting RAG/retrieval operations */
|
|
8
|
-
ragPatterns?: string[];
|
|
9
|
-
/** Functions considered safe for RAG content validation */
|
|
10
|
-
validatorFunctions?: string[];
|
|
11
|
-
}
|
|
12
|
-
type RuleOptions = [Options?];
|
|
13
|
-
export declare const requireRagContentValidation: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unsanitizedRagContent", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
14
|
-
name: string;
|
|
15
|
-
};
|
|
16
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Skip in test files */
|
|
8
|
-
allowInTests?: boolean;
|
|
9
|
-
}
|
|
10
|
-
type RuleOptions = [Options?];
|
|
11
|
-
export declare const requireRequestTimeout: import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingTimeout", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
/** Patterns that suggest destructive operations */
|
|
8
|
-
destructivePatterns?: string[];
|
|
9
|
-
}
|
|
10
|
-
type RuleOptions = [Options?];
|
|
11
|
-
export declare const requireToolConfirmation: import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingConfirmation", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
type MessageIds = 'missingInputSchema' | 'emptyToolsObject';
|
|
7
|
-
export interface Options {
|
|
8
|
-
/** Allow tools without inputSchema in test files */
|
|
9
|
-
allowInTests?: boolean;
|
|
10
|
-
}
|
|
11
|
-
type RuleOptions = [Options?];
|
|
12
|
-
export declare const requireToolSchema: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
13
|
-
name: string;
|
|
14
|
-
};
|
|
15
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
type MessageIds = 'unsafePrompt' | 'unsafeSystemPrompt';
|
|
7
|
-
export interface Options {
|
|
8
|
-
/** Function names considered as input validators */
|
|
9
|
-
validatorFunctions?: string[];
|
|
10
|
-
/** Variable patterns that suggest user input */
|
|
11
|
-
userInputPatterns?: string[];
|
|
12
|
-
/** Allow in test files */
|
|
13
|
-
allowInTests?: boolean;
|
|
14
|
-
}
|
|
15
|
-
type RuleOptions = [Options?];
|
|
16
|
-
export declare const requireValidatedPrompt: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
17
|
-
name: string;
|
|
18
|
-
};
|
|
19
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Ofri Peretz
|
|
3
|
-
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
-
* MIT license that can be found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
import { type TSESTree } from '@interlace/eslint-devkit';
|
|
7
|
-
/**
|
|
8
|
-
* Property names the AI SDK accepts for the system prompt.
|
|
9
|
-
*
|
|
10
|
-
* As of AI SDK v7 the canonical name is `instructions`; `system` still works but
|
|
11
|
-
* is marked `@deprecated Use 'instructions' instead` in the SDK's own types. Both
|
|
12
|
-
* must be checked — code written against current docs uses `instructions`, and
|
|
13
|
-
* code predating v7 uses `system`.
|
|
14
|
-
*/
|
|
15
|
-
export declare const SYSTEM_PROMPT_PROPS: ReadonlySet<string>;
|
|
16
|
-
/** True when `name` is a property the AI SDK treats as the system prompt. */
|
|
17
|
-
export declare function isSystemPromptProp(name: string | null): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Static name of an object property key, or `null` when it isn't statically known.
|
|
20
|
-
*
|
|
21
|
-
* `{ instructions: x }` and `{ 'instructions': x }` are the same property, but the
|
|
22
|
-
* first parses to an `Identifier` key and the second to a string `Literal`. Reading
|
|
23
|
-
* only `Identifier` silently skips the quoted form, so a rule stops firing on code
|
|
24
|
-
* that is semantically identical. Computed keys (`{ [k]: x }`) stay `null` — the
|
|
25
|
-
* name genuinely isn't known statically.
|
|
26
|
-
*/
|
|
27
|
-
export declare function getStaticPropName(key: TSESTree.Node): string | null;
|