@silmaril-security/sdk 0.10.3 → 0.11.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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.0
4
+
5
+ - Breaking: rename the tenant acceptable-use policy outcome to `abuse`.
6
+ `Outcome.Abuse` replaces the tenant-specific member, and
7
+ `KnownPrimaryOutcome`, `KnownHarmfulOutcome`, `PRIMARY_OUTCOMES`,
8
+ `HARMFUL_OUTCOMES`, and `OUTCOME_DESCRIPTIONS` list `abuse` in the same
9
+ position. Responses that still carry the previous label continue to decode
10
+ as an `UnknownOutcome` string.
11
+
3
12
  ## 0.10.3
4
13
 
5
14
  - Match Python `str.strip()` when validating optional governance
@@ -254,8 +263,8 @@ All notable changes to the Silmaril Firewall TypeScript SDK are documented here.
254
263
  ## 0.5.1 - 2026-07-29
255
264
 
256
265
  - Add typed support for `code_generation`, `story_script_generation`,
257
- `game_generation`, `website_generation`, `clickup_terms_violation`, and
258
- `traditional_ai_abuse`.
266
+ `game_generation`, `website_generation`, `traditional_ai_abuse`, and the
267
+ tenant acceptable-use policy outcome now named `abuse`.
259
268
  - Extend ordered outcome collections, descriptions, guards, normalization
260
269
  fixtures, exports, and documentation without changing the `/classify` wire
261
270
  shape.
package/README.md CHANGED
@@ -35,10 +35,10 @@ This SDK is distributed as an npm package.
35
35
  npm install @silmaril-security/sdk
36
36
  ```
37
37
 
38
- Pin version 0.10.3 for reproducible installs:
38
+ Pin version 0.11.0 for reproducible installs:
39
39
 
40
40
  ```sh
41
- npm install @silmaril-security/sdk@0.10.3
41
+ npm install @silmaril-security/sdk@0.11.0
42
42
  ```
43
43
 
44
44
  Requires Node 20 or later.
@@ -262,7 +262,7 @@ if (result.prediction === "BENIGN") {
262
262
  case Outcome.StoryScriptGeneration:
263
263
  case Outcome.GameGeneration:
264
264
  case Outcome.WebsiteGeneration:
265
- case Outcome.ClickUpTermsViolation:
265
+ case Outcome.Abuse:
266
266
  case Outcome.TraditionalAiAbuse:
267
267
  applyTenantPolicy(result);
268
268
  break;
@@ -284,7 +284,7 @@ Outcome taxonomy:
284
284
  - `story_script_generation`: generation of narrative prose, dialogue, scripts, or story artifacts.
285
285
  - `game_generation`: generation of a game, quest, level, mechanic, or playable experience.
286
286
  - `website_generation`: generation of a website, landing page, storefront, or web experience.
287
- - `clickup_terms_violation`: content or actions that violate the configured ClickUp tenant policy.
287
+ - `abuse`: content or actions that violate the tenant's acceptable-use policy.
288
288
  - `traditional_ai_abuse`: unsafe AI assistance outside the concrete security outcome classes.
289
289
 
290
290
  ## Options
@@ -13,7 +13,7 @@ import * as langchain from 'langchain';
13
13
  import { CreateAgentParams } from 'langchain';
14
14
  import * as _langchain_core_tools from '@langchain/core/tools';
15
15
  import { StructuredTool } from '@langchain/core/tools';
16
- import { h as FirewallMode, b as ClassifyEvent, e as Firewall } from '../firewall-BXM2BWEr.cjs';
16
+ import { h as FirewallMode, b as ClassifyEvent, e as Firewall } from '../firewall-BD4YdAmB.cjs';
17
17
 
18
18
  declare const SAFE_TOOL_MESSAGE = "Silmaril Firewall blocked this tool interaction. Choose a different safe action.";
19
19
  declare const SAFE_FINAL_MESSAGE = "Silmaril Firewall stopped this request after repeated unsafe actions.";
@@ -13,7 +13,7 @@ import * as langchain from 'langchain';
13
13
  import { CreateAgentParams } from 'langchain';
14
14
  import * as _langchain_core_tools from '@langchain/core/tools';
15
15
  import { StructuredTool } from '@langchain/core/tools';
16
- import { h as FirewallMode, b as ClassifyEvent, e as Firewall } from '../firewall-BXM2BWEr.js';
16
+ import { h as FirewallMode, b as ClassifyEvent, e as Firewall } from '../firewall-BD4YdAmB.js';
17
17
 
18
18
  declare const SAFE_TOOL_MESSAGE = "Silmaril Firewall blocked this tool interaction. Choose a different safe action.";
19
19
  declare const SAFE_FINAL_MESSAGE = "Silmaril Firewall stopped this request after repeated unsafe actions.";
@@ -1,6 +1,6 @@
1
1
  import { RunnableConfig, Runnable, RunnableBinding } from '@langchain/core/runnables';
2
2
  import { BaseCallbackHandler } from '@langchain/core/callbacks/base';
3
- import { e as Firewall, L as LangChainAdapterOptions } from '../firewall-BXM2BWEr.cjs';
3
+ import { e as Firewall, L as LangChainAdapterOptions } from '../firewall-BD4YdAmB.cjs';
4
4
 
5
5
  declare function createLangChainHandler(firewall: Firewall, options?: LangChainAdapterOptions): Promise<BaseCallbackHandler>;
6
6
  /** Protect a runnable using its actual invocation config, including direct model/tool calls. */
@@ -1,6 +1,6 @@
1
1
  import { RunnableConfig, Runnable, RunnableBinding } from '@langchain/core/runnables';
2
2
  import { BaseCallbackHandler } from '@langchain/core/callbacks/base';
3
- import { e as Firewall, L as LangChainAdapterOptions } from '../firewall-BXM2BWEr.js';
3
+ import { e as Firewall, L as LangChainAdapterOptions } from '../firewall-BD4YdAmB.js';
4
4
 
5
5
  declare function createLangChainHandler(firewall: Firewall, options?: LangChainAdapterOptions): Promise<BaseCallbackHandler>;
6
6
  /** Protect a runnable using its actual invocation config, including direct model/tool calls. */
@@ -1,4 +1,4 @@
1
- import { M as MiddlewareOptions, e as Firewall } from '../firewall-BXM2BWEr.cjs';
1
+ import { M as MiddlewareOptions, e as Firewall } from '../firewall-BD4YdAmB.cjs';
2
2
 
3
3
  /**
4
4
  * Vercel AI SDK 7 middleware integration.
@@ -1,4 +1,4 @@
1
- import { M as MiddlewareOptions, e as Firewall } from '../firewall-BXM2BWEr.js';
1
+ import { M as MiddlewareOptions, e as Firewall } from '../firewall-BD4YdAmB.js';
2
2
 
3
3
  /**
4
4
  * Vercel AI SDK 7 middleware integration.
@@ -1 +1 @@
1
- export { g as FirewallMiddleware, S as createMiddleware } from '../firewall-BXM2BWEr.cjs';
1
+ export { g as FirewallMiddleware, S as createMiddleware } from '../firewall-BD4YdAmB.cjs';
@@ -1 +1 @@
1
- export { g as FirewallMiddleware, S as createMiddleware } from '../firewall-BXM2BWEr.js';
1
+ export { g as FirewallMiddleware, S as createMiddleware } from '../firewall-BD4YdAmB.js';
@@ -37,7 +37,7 @@ declare const Outcome: {
37
37
  readonly StoryScriptGeneration: "story_script_generation";
38
38
  readonly GameGeneration: "game_generation";
39
39
  readonly WebsiteGeneration: "website_generation";
40
- readonly ClickUpTermsViolation: "clickup_terms_violation";
40
+ readonly Abuse: "abuse";
41
41
  readonly TraditionalAiAbuse: "traditional_ai_abuse";
42
42
  };
43
43
  declare const unknownOutcomeBrand: unique symbol;
@@ -48,8 +48,8 @@ type UnknownOutcome = string & {
48
48
  };
49
49
  type PrimaryOutcome = KnownPrimaryOutcome | UnknownOutcome;
50
50
  type HarmfulOutcome = KnownHarmfulOutcome | UnknownOutcome;
51
- declare const PRIMARY_OUTCOMES: readonly ["benign", "information_disclosure", "secret_exposure", "control_abuse", "system_compromise", "service_disruption", "code_generation", "story_script_generation", "game_generation", "website_generation", "clickup_terms_violation", "traditional_ai_abuse"];
52
- declare const HARMFUL_OUTCOMES: readonly ["information_disclosure", "secret_exposure", "control_abuse", "system_compromise", "service_disruption", "code_generation", "story_script_generation", "game_generation", "website_generation", "clickup_terms_violation", "traditional_ai_abuse"];
51
+ declare const PRIMARY_OUTCOMES: readonly ["benign", "information_disclosure", "secret_exposure", "control_abuse", "system_compromise", "service_disruption", "code_generation", "story_script_generation", "game_generation", "website_generation", "abuse", "traditional_ai_abuse"];
52
+ declare const HARMFUL_OUTCOMES: readonly ["information_disclosure", "secret_exposure", "control_abuse", "system_compromise", "service_disruption", "code_generation", "story_script_generation", "game_generation", "website_generation", "abuse", "traditional_ai_abuse"];
53
53
  declare const OUTCOME_DESCRIPTIONS: {
54
54
  readonly benign: "No harmful firewall outcome detected.";
55
55
  readonly information_disclosure: "Exposes private data, documents, internal context, logs, traces, customer data, SQL rows, topology, or similar non-secret sensitive information.";
@@ -61,7 +61,7 @@ declare const OUTCOME_DESCRIPTIONS: {
61
61
  readonly story_script_generation: "Requests generation of narrative prose, dialogue, scripts, or story artifacts.";
62
62
  readonly game_generation: "Requests generation of a game, quest, level, mechanic, or playable experience.";
63
63
  readonly website_generation: "Requests generation of a website, landing page, storefront, or web experience.";
64
- readonly clickup_terms_violation: "Requests content or actions that violate the configured ClickUp tenant policy.";
64
+ readonly abuse: "Requests content or actions that violate the tenant's acceptable-use policy.";
65
65
  readonly traditional_ai_abuse: "Requests unsafe AI assistance outside the concrete security outcome classes.";
66
66
  };
67
67
  declare function isPrimaryOutcome(value: unknown): value is KnownPrimaryOutcome;
@@ -37,7 +37,7 @@ declare const Outcome: {
37
37
  readonly StoryScriptGeneration: "story_script_generation";
38
38
  readonly GameGeneration: "game_generation";
39
39
  readonly WebsiteGeneration: "website_generation";
40
- readonly ClickUpTermsViolation: "clickup_terms_violation";
40
+ readonly Abuse: "abuse";
41
41
  readonly TraditionalAiAbuse: "traditional_ai_abuse";
42
42
  };
43
43
  declare const unknownOutcomeBrand: unique symbol;
@@ -48,8 +48,8 @@ type UnknownOutcome = string & {
48
48
  };
49
49
  type PrimaryOutcome = KnownPrimaryOutcome | UnknownOutcome;
50
50
  type HarmfulOutcome = KnownHarmfulOutcome | UnknownOutcome;
51
- declare const PRIMARY_OUTCOMES: readonly ["benign", "information_disclosure", "secret_exposure", "control_abuse", "system_compromise", "service_disruption", "code_generation", "story_script_generation", "game_generation", "website_generation", "clickup_terms_violation", "traditional_ai_abuse"];
52
- declare const HARMFUL_OUTCOMES: readonly ["information_disclosure", "secret_exposure", "control_abuse", "system_compromise", "service_disruption", "code_generation", "story_script_generation", "game_generation", "website_generation", "clickup_terms_violation", "traditional_ai_abuse"];
51
+ declare const PRIMARY_OUTCOMES: readonly ["benign", "information_disclosure", "secret_exposure", "control_abuse", "system_compromise", "service_disruption", "code_generation", "story_script_generation", "game_generation", "website_generation", "abuse", "traditional_ai_abuse"];
52
+ declare const HARMFUL_OUTCOMES: readonly ["information_disclosure", "secret_exposure", "control_abuse", "system_compromise", "service_disruption", "code_generation", "story_script_generation", "game_generation", "website_generation", "abuse", "traditional_ai_abuse"];
53
53
  declare const OUTCOME_DESCRIPTIONS: {
54
54
  readonly benign: "No harmful firewall outcome detected.";
55
55
  readonly information_disclosure: "Exposes private data, documents, internal context, logs, traces, customer data, SQL rows, topology, or similar non-secret sensitive information.";
@@ -61,7 +61,7 @@ declare const OUTCOME_DESCRIPTIONS: {
61
61
  readonly story_script_generation: "Requests generation of narrative prose, dialogue, scripts, or story artifacts.";
62
62
  readonly game_generation: "Requests generation of a game, quest, level, mechanic, or playable experience.";
63
63
  readonly website_generation: "Requests generation of a website, landing page, storefront, or web experience.";
64
- readonly clickup_terms_violation: "Requests content or actions that violate the configured ClickUp tenant policy.";
64
+ readonly abuse: "Requests content or actions that violate the tenant's acceptable-use policy.";
65
65
  readonly traditional_ai_abuse: "Requests unsafe AI assistance outside the concrete security outcome classes.";
66
66
  };
67
67
  declare function isPrimaryOutcome(value: unknown): value is KnownPrimaryOutcome;
package/dist/index.cjs CHANGED
@@ -1457,7 +1457,7 @@ var Outcome = {
1457
1457
  StoryScriptGeneration: "story_script_generation",
1458
1458
  GameGeneration: "game_generation",
1459
1459
  WebsiteGeneration: "website_generation",
1460
- ClickUpTermsViolation: "clickup_terms_violation",
1460
+ Abuse: "abuse",
1461
1461
  TraditionalAiAbuse: "traditional_ai_abuse"
1462
1462
  };
1463
1463
  var PRIMARY_OUTCOMES = [
@@ -1471,7 +1471,7 @@ var PRIMARY_OUTCOMES = [
1471
1471
  Outcome.StoryScriptGeneration,
1472
1472
  Outcome.GameGeneration,
1473
1473
  Outcome.WebsiteGeneration,
1474
- Outcome.ClickUpTermsViolation,
1474
+ Outcome.Abuse,
1475
1475
  Outcome.TraditionalAiAbuse
1476
1476
  ];
1477
1477
  var HARMFUL_OUTCOMES = [
@@ -1484,7 +1484,7 @@ var HARMFUL_OUTCOMES = [
1484
1484
  Outcome.StoryScriptGeneration,
1485
1485
  Outcome.GameGeneration,
1486
1486
  Outcome.WebsiteGeneration,
1487
- Outcome.ClickUpTermsViolation,
1487
+ Outcome.Abuse,
1488
1488
  Outcome.TraditionalAiAbuse
1489
1489
  ];
1490
1490
  var OUTCOME_DESCRIPTIONS = {
@@ -1498,7 +1498,7 @@ var OUTCOME_DESCRIPTIONS = {
1498
1498
  [Outcome.StoryScriptGeneration]: "Requests generation of narrative prose, dialogue, scripts, or story artifacts.",
1499
1499
  [Outcome.GameGeneration]: "Requests generation of a game, quest, level, mechanic, or playable experience.",
1500
1500
  [Outcome.WebsiteGeneration]: "Requests generation of a website, landing page, storefront, or web experience.",
1501
- [Outcome.ClickUpTermsViolation]: "Requests content or actions that violate the configured ClickUp tenant policy.",
1501
+ [Outcome.Abuse]: "Requests content or actions that violate the tenant's acceptable-use policy.",
1502
1502
  [Outcome.TraditionalAiAbuse]: "Requests unsafe AI assistance outside the concrete security outcome classes."
1503
1503
  };
1504
1504
  var PRIMARY_OUTCOME_SET = new Set(PRIMARY_OUTCOMES);
@@ -1580,7 +1580,7 @@ function sanitizeText(text) {
1580
1580
  }
1581
1581
 
1582
1582
  // src/firewall.ts
1583
- var SDK_VERSION = "0.10.3";
1583
+ var SDK_VERSION = "0.11.0";
1584
1584
  var DEFAULT_TIMEOUT_MS = 1e4;
1585
1585
  var DEFAULT_MAX_RETRIES = 5;
1586
1586
  var MAX_BACKOFF_SECONDS = 30;