@hazeljs/guardrails 0.7.9 → 0.8.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 +13 -13
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -95,7 +95,10 @@ import { GuardrailsService, GuardrailInput, GuardrailOutput } from '@hazeljs/gua
|
|
|
95
95
|
|
|
96
96
|
@Controller({ path: '/chat' })
|
|
97
97
|
export class ChatController {
|
|
98
|
-
constructor(
|
|
98
|
+
constructor(
|
|
99
|
+
private aiService: AIService,
|
|
100
|
+
private guardrailsService: GuardrailsService
|
|
101
|
+
) {}
|
|
99
102
|
|
|
100
103
|
@GuardrailInput()
|
|
101
104
|
@GuardrailOutput()
|
|
@@ -113,24 +116,21 @@ When both `GuardrailsModule` and `AgentModule` are imported, tool input and outp
|
|
|
113
116
|
|
|
114
117
|
```typescript
|
|
115
118
|
@HazelModule({
|
|
116
|
-
imports: [
|
|
117
|
-
GuardrailsModule.forRoot(),
|
|
118
|
-
AgentModule.forRoot(),
|
|
119
|
-
],
|
|
119
|
+
imports: [GuardrailsModule.forRoot(), AgentModule.forRoot()],
|
|
120
120
|
})
|
|
121
121
|
export class AppModule {}
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
## Configuration
|
|
125
125
|
|
|
126
|
-
| Option
|
|
127
|
-
|
|
128
|
-
| `piiEntities`
|
|
129
|
-
| `redactPIIByDefault`
|
|
130
|
-
| `blockInjectionByDefault` | `boolean`
|
|
131
|
-
| `blockToxicityByDefault`
|
|
132
|
-
| `injectionBlocklist`
|
|
133
|
-
| `toxicityBlocklist`
|
|
126
|
+
| Option | Type | Default | Description |
|
|
127
|
+
| ------------------------- | ----------------- | --------------------------------------- | --------------------------------- |
|
|
128
|
+
| `piiEntities` | `PIIEntityType[]` | `['email','phone','ssn','credit_card']` | Entities to detect/redact |
|
|
129
|
+
| `redactPIIByDefault` | `boolean` | `false` | Redact PII in input by default |
|
|
130
|
+
| `blockInjectionByDefault` | `boolean` | `true` | Block prompt injection by default |
|
|
131
|
+
| `blockToxicityByDefault` | `boolean` | `true` | Block toxic content by default |
|
|
132
|
+
| `injectionBlocklist` | `string[]` | — | Custom injection patterns |
|
|
133
|
+
| `toxicityBlocklist` | `string[]` | — | Custom toxicity keywords |
|
|
134
134
|
|
|
135
135
|
## API
|
|
136
136
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hazeljs/guardrails",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Content safety, PII handling, and output validation for HazelJS AI applications",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@hazeljs/core": ">=0.2.0-beta.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "e0ed98ca074dd4f7472816d3c32ef576900dcca6"
|
|
57
57
|
}
|