@guardrail-ai/rules 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +63 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # @guardrail-ai/rules
2
+
3
+ 22 built-in detection rules for [Guardrail](https://github.com/Manavarya09/Guardrail).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @guardrail-ai/rules
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { builtinRules } from '@guardrail-ai/rules';
15
+ import { GuardrailEngine } from '@guardrail-ai/core';
16
+
17
+ const engine = new GuardrailEngine();
18
+ engine.registerRules(builtinRules);
19
+ ```
20
+
21
+ ## Rules
22
+
23
+ ### Security (8)
24
+ | Rule | Severity |
25
+ |------|----------|
26
+ | `security/hardcoded-api-key` | critical |
27
+ | `security/sql-injection` | critical |
28
+ | `security/no-eval` | critical |
29
+ | `security/insecure-cors` | high |
30
+ | `security/env-var-leak` | high |
31
+ | `security/unsafe-regex` | high |
32
+ | `security/no-secrets-in-logs` | high |
33
+ | `security/no-rate-limiting` | info |
34
+
35
+ ### AI-Codegen (10)
36
+ | Rule | Severity |
37
+ |------|----------|
38
+ | `ai-codegen/hallucinated-import` | high |
39
+ | `ai-codegen/placeholder-code` | warning |
40
+ | `ai-codegen/hardcoded-localhost` | warning |
41
+ | `ai-codegen/overly-broad-catch` | warning |
42
+ | `ai-codegen/unused-imports` | warning |
43
+ | `ai-codegen/any-type-abuse` | warning |
44
+ | `ai-codegen/fetch-without-error-handling` | warning |
45
+ | `ai-codegen/promise-without-catch` | warning |
46
+ | `ai-codegen/console-log-spam` | info |
47
+ | `ai-codegen/magic-numbers` | info |
48
+
49
+ ### Quality (2)
50
+ | Rule | Severity |
51
+ |------|----------|
52
+ | `quality/dead-code` | warning |
53
+ | `quality/duplicate-logic` | warning |
54
+
55
+ ### Performance (2)
56
+ | Rule | Severity |
57
+ |------|----------|
58
+ | `performance/inefficient-loop` | warning |
59
+ | `performance/n-plus-one-query` | high |
60
+
61
+ ## License
62
+
63
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardrail-ai/rules",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Built-in detection rules for Guardrail (19 rules across security, performance, quality, and AI-codegen)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",