@groovysec/whiteout-ai 0.3.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/LICENSE +202 -0
- package/README.md +192 -0
- package/dist/appGuard.d.ts +193 -0
- package/dist/appGuard.d.ts.map +1 -0
- package/dist/appGuard.js +627 -0
- package/dist/appGuard.js.map +1 -0
- package/dist/auto.d.ts +17 -0
- package/dist/auto.d.ts.map +1 -0
- package/dist/auto.js +205 -0
- package/dist/auto.js.map +1 -0
- package/dist/exceptions.d.ts +28 -0
- package/dist/exceptions.d.ts.map +1 -0
- package/dist/exceptions.js +39 -0
- package/dist/exceptions.js.map +1 -0
- package/dist/extract.d.ts +8 -0
- package/dist/extract.d.ts.map +1 -0
- package/dist/extract.js +167 -0
- package/dist/extract.js.map +1 -0
- package/dist/guard.d.ts +64 -0
- package/dist/guard.d.ts.map +1 -0
- package/dist/guard.js +168 -0
- package/dist/guard.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/register.d.ts +2 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +16 -0
- package/dist/register.js.map +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# @groovysec/whiteout-ai
|
|
2
|
+
|
|
3
|
+
Whiteout AI governance SDK for Node.js. Add policy enforcement, audit, and
|
|
4
|
+
compliance to any AI workload in three lines of code.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm install @groovysec/whiteout-ai
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Requires Node 18+ (uses native `fetch` and `AbortController`).
|
|
13
|
+
|
|
14
|
+
## Custom AI Apps: `AppGuard` (0.2+)
|
|
15
|
+
|
|
16
|
+
For your own LLM applications registered under **Integrations → Custom AI Apps**.
|
|
17
|
+
Authenticates with the app key from the setup wizard, with no registration step, and
|
|
18
|
+
checks **both** the prompt and the model's reply.
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm i @groovysec/whiteout-ai@^0.2
|
|
22
|
+
export WHITEOUT_APP_KEY=wo_app_prod_...
|
|
23
|
+
export WHITEOUT_BASE_URL=https://api.whiteout.groovysec.com # the default
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import OpenAI from "openai";
|
|
28
|
+
import { AppGuard, WhiteoutBlockedError } from "@groovysec/whiteout-ai";
|
|
29
|
+
|
|
30
|
+
const guard = new AppGuard();
|
|
31
|
+
const client = guard.openai(new OpenAI()); // or guard.anthropic(new Anthropic())
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
const reply = await client.chat.completions.create({
|
|
35
|
+
model: "gpt-5",
|
|
36
|
+
messages,
|
|
37
|
+
whiteout: { endUser: user.id }, // optional; never sent to OpenAI
|
|
38
|
+
} as any);
|
|
39
|
+
} catch (e) {
|
|
40
|
+
if (e instanceof WhiteoutBlockedError) console.log(e.stage, e.reason); // "input" | "output"
|
|
41
|
+
else throw e;
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The wrapped create returns a plain `Promise`, so OpenAI's `.withResponse()` helpers
|
|
46
|
+
aren't available on it. Everything else on the client passes through.
|
|
47
|
+
|
|
48
|
+
- **`scan`**: `["user"]` by default. Add `"system"`, `"context"` and `"tool"` to also
|
|
49
|
+
scan system prompts, retrieved documents (`context`) and tool results.
|
|
50
|
+
- **Manual checks**: `await guard.checkInput({ messages, context })`, then
|
|
51
|
+
`await guard.checkOutput(d.evaluationId, reply)`.
|
|
52
|
+
- **Streaming** (`stream: true`, both providers):
|
|
53
|
+
- `streamMode: "buffered"` (default) holds the response until it passes.
|
|
54
|
+
- `"passthrough"` yields as it goes, with a check every `checkEvery` characters, and
|
|
55
|
+
aborts the upstream stream on block. Text already shown can't be retracted.
|
|
56
|
+
- **Fail behaviour**: follows the policy group's `fail_behavior` (from
|
|
57
|
+
`/v1/guard/config`, cached 5 minutes) unless `failOpen` is set. With no config it
|
|
58
|
+
fails open. A revoked key is logged with `console.error`.
|
|
59
|
+
- **`blockOutput: false`**: output checks become fire-and-forget. Call
|
|
60
|
+
`await guard.flush()` before a serverless handler returns.
|
|
61
|
+
- **`sendEvents([...])`**: observe-only reporting after the fact.
|
|
62
|
+
|
|
63
|
+
## No code changes: auto-instrumentation (0.3+)
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npm i @groovysec/whiteout-ai
|
|
67
|
+
NODE_OPTIONS="--import @groovysec/whiteout-ai/register" WHITEOUT_APP_KEY=wo_app_prod_... node server.js
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
This governs `openai` (chat completions and the Responses API) and `@anthropic-ai/sdk` (`messages.create`), in both ESM and CommonJS apps. It needs Node 18.19+.
|
|
71
|
+
|
|
72
|
+
**Environment variables:**
|
|
73
|
+
|
|
74
|
+
| Variable | Values |
|
|
75
|
+
|---|---|
|
|
76
|
+
| `WHITEOUT_MODE` | `enforce` (default) or `observe` |
|
|
77
|
+
| `WHITEOUT_STREAM_MODE` | Stream mode for governed calls |
|
|
78
|
+
| `WHITEOUT_SCAN` | Which parts of the call to scan |
|
|
79
|
+
| `WHITEOUT_INCLUDE` / `WHITEOUT_EXCLUDE` | `openai`, `anthropic` |
|
|
80
|
+
| `WHITEOUT_DISABLE=1` | Turns it off completely |
|
|
81
|
+
|
|
82
|
+
**Limits:**
|
|
83
|
+
- Governed calls return a plain Promise, so openai's `.withResponse()` isn't available on them.
|
|
84
|
+
- The anthropic `messages.stream()` helper isn't covered. Use `create({ stream: true })` instead.
|
|
85
|
+
|
|
86
|
+
## Quarantine and employee policies (0.3+)
|
|
87
|
+
|
|
88
|
+
**Quarantine.** With Prompt Injection Defense on, quarantined tool and system turns are replaced before the model sees them. `cleanContext(docs, decision)` drops quarantined `context` documents.
|
|
89
|
+
|
|
90
|
+
**Employee policies.** For apps set to *the employee's own policies*, pass `userToken` (the employee's OIDC id_token):
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
await guard.checkInput({ messages, userToken: session.idToken });
|
|
94
|
+
await client.chat.completions.create({ model, messages, whiteout: { userToken: session.idToken } });
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Infrastructure workloads: `WhiteoutGuard`
|
|
98
|
+
|
|
99
|
+
Unchanged. It uses an enrollment token and the `/infra-agent` routes.
|
|
100
|
+
|
|
101
|
+
## Quick start
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
import { WhiteoutGuard, WhiteoutBlockedError } from "@groovysec/whiteout-ai";
|
|
105
|
+
import OpenAI from "openai";
|
|
106
|
+
|
|
107
|
+
const guard = new WhiteoutGuard({
|
|
108
|
+
token: process.env.WHITEOUT_TOKEN!, // minted in the Whiteout admin UI
|
|
109
|
+
backendUrl: process.env.WHITEOUT_BACKEND_URL!, // e.g. https://api.whiteout.example.com
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const openai = new OpenAI();
|
|
113
|
+
|
|
114
|
+
try {
|
|
115
|
+
const response = await guard.wrap(
|
|
116
|
+
openai.chat.completions.create.bind(openai.chat.completions),
|
|
117
|
+
{
|
|
118
|
+
model: "gpt-4o",
|
|
119
|
+
messages: [{ role: "user", content: userPrompt }],
|
|
120
|
+
},
|
|
121
|
+
);
|
|
122
|
+
console.log(response.choices[0].message.content);
|
|
123
|
+
} catch (err) {
|
|
124
|
+
if (err instanceof WhiteoutBlockedError) {
|
|
125
|
+
console.error("Blocked by policy:", err.reason);
|
|
126
|
+
} else {
|
|
127
|
+
throw err;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Three integration patterns
|
|
133
|
+
|
|
134
|
+
### 1. Evaluate a prompt manually
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
const result = await guard.evaluate({
|
|
138
|
+
prompt: "Summarize this patient record …",
|
|
139
|
+
aiProvider: "openai",
|
|
140
|
+
model: "gpt-4o",
|
|
141
|
+
});
|
|
142
|
+
// { decision: "allow" | "block" | "warn", reason?, violatedPolicies? }
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 2. Wrap an SDK call
|
|
146
|
+
|
|
147
|
+
`guard.wrap(fn, ...args)` extracts the prompt/provider/model from the call
|
|
148
|
+
arguments, evaluates pre-call, runs the call, and asynchronously scans the
|
|
149
|
+
response for output governance.
|
|
150
|
+
|
|
151
|
+
Supported call shapes today:
|
|
152
|
+
- OpenAI `chat.completions.create({ model, messages })`
|
|
153
|
+
- Anthropic `messages.create({ model, system, messages })`
|
|
154
|
+
- Bedrock `InvokeModel({ modelId, body })` (Anthropic/Titan/Cohere body shapes)
|
|
155
|
+
- Google `generateContent({ contents })`
|
|
156
|
+
|
|
157
|
+
### 3. Catch blocks
|
|
158
|
+
|
|
159
|
+
`WhiteoutBlockedError` is thrown from `evaluate()` and `wrap()` when the
|
|
160
|
+
backend returns `decision: "block"`. It carries `reason`, `violatedPolicies`,
|
|
161
|
+
and `rule`.
|
|
162
|
+
|
|
163
|
+
## Configuration
|
|
164
|
+
|
|
165
|
+
| Option | Default | Notes |
|
|
166
|
+
|---|---|---|
|
|
167
|
+
| `token` | required | Enrollment token from admin UI |
|
|
168
|
+
| `backendUrl` | required | https://… (no trailing slash needed) |
|
|
169
|
+
| `agentName` | `sdk-<pid>` | Shown on Infrastructure page |
|
|
170
|
+
| `resourceId` | `sdk-<pid>` | EC2 instance id, k8s pod, etc. |
|
|
171
|
+
| `resourceType` | `vm` | `vm`, `pod`, `lambda`, `ecs_task` |
|
|
172
|
+
| `mode` | `sdk` | Reported to backend; informational |
|
|
173
|
+
| `timeoutMs` | `10000` | Per-request timeout to the backend |
|
|
174
|
+
| `failOpen` | `true` | If backend unreachable, allow calls through |
|
|
175
|
+
| `register` | `true` | Set false to defer registration |
|
|
176
|
+
|
|
177
|
+
## Fail-open behavior
|
|
178
|
+
|
|
179
|
+
Default is fail-open: if the Whiteout backend is unreachable at startup or
|
|
180
|
+
during evaluation, calls are allowed through so a Whiteout outage never
|
|
181
|
+
breaks the customer's AI app. Set `failOpen: false` to fail closed.
|
|
182
|
+
|
|
183
|
+
## Streaming
|
|
184
|
+
|
|
185
|
+
Streaming responses (e.g., `openai.chat.completions.create({ stream: true })`)
|
|
186
|
+
are not yet wrapped end-to-end — `evaluate()` runs pre-call but the
|
|
187
|
+
streaming chunks are not scanned. Call `evaluateResponse()` manually after
|
|
188
|
+
the stream completes if response governance is required.
|
|
189
|
+
|
|
190
|
+
## License
|
|
191
|
+
|
|
192
|
+
Apache-2.0
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
export declare const DEFAULT_BASE_URL = "https://api.whiteout.groovysec.com";
|
|
3
|
+
export declare const SCAN_TARGETS: readonly ["user", "system", "context", "tool"];
|
|
4
|
+
export type ScanTarget = (typeof SCAN_TARGETS)[number];
|
|
5
|
+
export type StreamMode = "buffered" | "passthrough";
|
|
6
|
+
type FetchLike = (url: string, init: RequestInit) => Promise<Response>;
|
|
7
|
+
export type AppGuardOptions = {
|
|
8
|
+
appKey?: string;
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
timeoutMs?: number;
|
|
11
|
+
/** Overrides the server's fail_behavior when set. */
|
|
12
|
+
failOpen?: boolean;
|
|
13
|
+
/** Block responses synchronously (default). `false` = fire-and-forget output checks. */
|
|
14
|
+
blockOutput?: boolean;
|
|
15
|
+
scan?: ScanTarget[];
|
|
16
|
+
streamMode?: StreamMode;
|
|
17
|
+
checkEvery?: number;
|
|
18
|
+
/** Injectable for tests and custom agents. Defaults to global fetch. */
|
|
19
|
+
fetch?: FetchLike;
|
|
20
|
+
logger?: Pick<Console, "warn" | "error">;
|
|
21
|
+
/** `false` = observe: every call is checked and recorded, nothing throws. Default true. */
|
|
22
|
+
enforce?: boolean;
|
|
23
|
+
/** @internal set by auto-instrumentation (labels the coverage method). */
|
|
24
|
+
auto?: boolean;
|
|
25
|
+
/** Gateway keys: which app calls are for (default WHITEOUT_APP_REF), unless a call says otherwise. */
|
|
26
|
+
appRef?: string;
|
|
27
|
+
};
|
|
28
|
+
export declare const SDK_VERSION = "0.3.0";
|
|
29
|
+
/** What a quarantined system / tool turn is replaced with before the model sees it (ids kept, so tool calls stay paired). */
|
|
30
|
+
export declare const QUARANTINE_NOTICE = "[Removed by Whiteout: this content contained instructions aimed at the AI assistant and was not passed to the model.]";
|
|
31
|
+
export type GuardMessage = {
|
|
32
|
+
role: "system" | "user" | "assistant" | "tool";
|
|
33
|
+
content: string;
|
|
34
|
+
};
|
|
35
|
+
export type ContextDoc = {
|
|
36
|
+
content: string;
|
|
37
|
+
source?: string;
|
|
38
|
+
};
|
|
39
|
+
export type CheckInputOptions = {
|
|
40
|
+
messages?: unknown[];
|
|
41
|
+
text?: string;
|
|
42
|
+
system?: unknown;
|
|
43
|
+
context?: Array<string | ContextDoc>;
|
|
44
|
+
scan?: ScanTarget[];
|
|
45
|
+
endUser?: string;
|
|
46
|
+
/** The signed-in employee's OIDC id_token — for apps set to enforce the employee's own policies. */
|
|
47
|
+
userToken?: string;
|
|
48
|
+
/** Gateway keys: which app this call is for. */
|
|
49
|
+
appRef?: string;
|
|
50
|
+
sessionId?: string;
|
|
51
|
+
model?: string;
|
|
52
|
+
provider?: string;
|
|
53
|
+
tokenCountIn?: number;
|
|
54
|
+
metadata?: Record<string, unknown>;
|
|
55
|
+
raiseOnBlock?: boolean;
|
|
56
|
+
};
|
|
57
|
+
export type CheckOutputOptions = {
|
|
58
|
+
finish?: boolean;
|
|
59
|
+
appRef?: string;
|
|
60
|
+
model?: string;
|
|
61
|
+
provider?: string;
|
|
62
|
+
tokenCountIn?: number;
|
|
63
|
+
tokenCountOut?: number;
|
|
64
|
+
raiseOnBlock?: boolean;
|
|
65
|
+
};
|
|
66
|
+
/** Per-call options passed to wrapped clients as `whiteout: {...}`; never sent to the provider. */
|
|
67
|
+
export type WhiteoutCallOptions = Pick<CheckInputOptions, "endUser" | "userToken" | "appRef" | "sessionId" | "scan" | "context" | "metadata">;
|
|
68
|
+
export type GuardDecision = {
|
|
69
|
+
decision: "allow" | "warn" | "block";
|
|
70
|
+
violatedPolicies: string[];
|
|
71
|
+
reason: string;
|
|
72
|
+
evaluationId?: string;
|
|
73
|
+
failOpen: boolean;
|
|
74
|
+
mode: string;
|
|
75
|
+
latencyMs?: number;
|
|
76
|
+
rule?: unknown;
|
|
77
|
+
responseFlagged: boolean;
|
|
78
|
+
failedClosed: boolean;
|
|
79
|
+
allowed: boolean;
|
|
80
|
+
/** User-aware apps: the verified employee. */
|
|
81
|
+
user?: {
|
|
82
|
+
email: string;
|
|
83
|
+
group_id?: string;
|
|
84
|
+
verified_by?: string;
|
|
85
|
+
};
|
|
86
|
+
/** User-aware apps: why the call fell back to the app's policy group. */
|
|
87
|
+
identity?: {
|
|
88
|
+
verified: boolean;
|
|
89
|
+
fallback?: string;
|
|
90
|
+
reason?: string;
|
|
91
|
+
};
|
|
92
|
+
/** Prompt Injection Defense: what was seen (when the org has it on). */
|
|
93
|
+
injection?: Record<string, unknown>;
|
|
94
|
+
/** Indices of normalized messages / context docs to keep away from the model. */
|
|
95
|
+
quarantine: {
|
|
96
|
+
messages: number[];
|
|
97
|
+
context: number[];
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
/** `docs` minus the ones Whiteout quarantined — pass the same list you sent as `context`. */
|
|
101
|
+
export declare function cleanContext<T>(docs: T[], decision: Pick<GuardDecision, "quarantine">): T[];
|
|
102
|
+
export type GuardConfig = {
|
|
103
|
+
mode?: string;
|
|
104
|
+
fail_behavior?: "open" | "closed";
|
|
105
|
+
data_capture?: string;
|
|
106
|
+
[key: string]: unknown;
|
|
107
|
+
};
|
|
108
|
+
/** Chat history from OpenAI, Anthropic or LangChain shapes → Guard API messages. */
|
|
109
|
+
export declare function normalizeMessages(messages?: unknown[], system?: unknown): GuardMessage[];
|
|
110
|
+
/**
|
|
111
|
+
* A copy of the provider params with every quarantined system / tool turn replaced by
|
|
112
|
+
* QUARANTINE_NOTICE. Tool results keep their ids; the caller's objects are never mutated.
|
|
113
|
+
*/
|
|
114
|
+
export declare function applyQuarantine<P extends Record<string, any>>(params: P, decision: Pick<GuardDecision, "quarantine">, systemKey?: string | null): P;
|
|
115
|
+
/**
|
|
116
|
+
* True while a governed model call is in flight — auto-instrumentation passes such
|
|
117
|
+
* calls straight through, so a hand-wrapped client is never checked twice.
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
export declare const guarding: AsyncLocalStorage<boolean>;
|
|
121
|
+
type Usage = [number | undefined, number | undefined];
|
|
122
|
+
/** @internal */
|
|
123
|
+
export type Provider = {
|
|
124
|
+
name: string;
|
|
125
|
+
createPath: [string, ...string[]];
|
|
126
|
+
text: (resp: unknown) => string;
|
|
127
|
+
usage: (resp: unknown) => Usage;
|
|
128
|
+
chunk: (chunk: unknown) => [string, number | undefined, number | undefined];
|
|
129
|
+
/** The chat history and system prompt a call carries. Default: `messages` / `system`. */
|
|
130
|
+
messagesOf?: (params: Record<string, any>) => [unknown[] | undefined, unknown];
|
|
131
|
+
/** Quarantined turns can be rewritten in place (chat-shaped `messages`). Default true. */
|
|
132
|
+
quarantine?: boolean;
|
|
133
|
+
systemKey?: string | null;
|
|
134
|
+
};
|
|
135
|
+
export declare const OPENAI: Provider;
|
|
136
|
+
/** OpenAI Responses API: `input` (string or items) + `instructions`. */
|
|
137
|
+
export declare const OPENAI_RESPONSES: Provider;
|
|
138
|
+
export declare const ANTHROPIC: Provider;
|
|
139
|
+
export declare class AppGuard {
|
|
140
|
+
private readonly key;
|
|
141
|
+
private readonly baseUrl;
|
|
142
|
+
private readonly timeoutMs;
|
|
143
|
+
private readonly failOpen?;
|
|
144
|
+
readonly blockOutput: boolean;
|
|
145
|
+
private readonly scan;
|
|
146
|
+
readonly streamMode: StreamMode;
|
|
147
|
+
readonly checkEvery: number;
|
|
148
|
+
private readonly fetchFn;
|
|
149
|
+
private readonly log;
|
|
150
|
+
private cfg;
|
|
151
|
+
private cfgEtag;
|
|
152
|
+
private cfgCheckedAt;
|
|
153
|
+
private cfgInflight;
|
|
154
|
+
private readonly pending;
|
|
155
|
+
readonly enforce: boolean;
|
|
156
|
+
private readonly auto;
|
|
157
|
+
private readonly appRef?;
|
|
158
|
+
constructor(opts?: AppGuardOptions);
|
|
159
|
+
private static checkScan;
|
|
160
|
+
private request;
|
|
161
|
+
private configStale;
|
|
162
|
+
private effectiveFailOpen;
|
|
163
|
+
/** The app's policy-group settings (mode, fail behaviour, ...). Cached with ETag. */
|
|
164
|
+
config(refresh?: boolean): Promise<GuardConfig | null>;
|
|
165
|
+
private fail;
|
|
166
|
+
private interpret;
|
|
167
|
+
private raiseIfBlocked;
|
|
168
|
+
/** Evaluate a prompt before it reaches the model. Throws WhiteoutBlockedError on block. */
|
|
169
|
+
checkInput(opts: CheckInputOptions): Promise<GuardDecision>;
|
|
170
|
+
/** Evaluate a model response. `finish: false` marks a streaming checkpoint. */
|
|
171
|
+
checkOutput(evaluationId: string | undefined, text: string, opts?: CheckOutputOptions): Promise<GuardDecision>;
|
|
172
|
+
/** @internal Blocking or fire-and-forget output check, per `blockOutput`. */
|
|
173
|
+
afterOutput(evaluationId: string | undefined, text: string, opts: CheckOutputOptions): Promise<void>;
|
|
174
|
+
/** Report calls after the fact (observe-only). Batched 100 per request. */
|
|
175
|
+
sendEvents(events: Record<string, unknown>[]): Promise<{
|
|
176
|
+
accepted: number;
|
|
177
|
+
flagged: number;
|
|
178
|
+
}>;
|
|
179
|
+
/** Wait for fire-and-forget output checks (call before a serverless handler returns). */
|
|
180
|
+
flush(): Promise<void>;
|
|
181
|
+
/** Govern `client.chat.completions.create` and `client.responses.create` on an `openai` client. */
|
|
182
|
+
openai<T extends object>(client: T): T;
|
|
183
|
+
/** Govern `client.messages.create` on an `@anthropic-ai/sdk` client. */
|
|
184
|
+
anthropic<T extends object>(client: T): T;
|
|
185
|
+
/**
|
|
186
|
+
* @internal One governed model call: input check, quarantine, the call, output check.
|
|
187
|
+
* `call` sends the (possibly rewritten) params to the provider.
|
|
188
|
+
*/
|
|
189
|
+
guardedCreate(provider: Provider, call: (params: Record<string, any>) => Promise<any>, params: Record<string, any>): Promise<any>;
|
|
190
|
+
private wrapClient;
|
|
191
|
+
}
|
|
192
|
+
export {};
|
|
193
|
+
//# sourceMappingURL=appGuard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appGuard.d.ts","sourceRoot":"","sources":["../src/appGuard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AA0BrD,eAAO,MAAM,gBAAgB,uCAAuC,CAAC;AACrE,eAAO,MAAM,YAAY,gDAAiD,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AACvD,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,aAAa,CAAC;AAUpD,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvE,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC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