agentid-sdk 0.1.36 → 0.1.37

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 CHANGED
@@ -87,18 +87,16 @@ await agent.log({
87
87
  npm install agentid-sdk openai
88
88
  ```
89
89
 
90
- ```ts
91
- import OpenAI from "openai";
92
- import { AgentID } from "agentid-sdk";
93
-
94
- const agent = new AgentID({
95
- piiMasking: true,
96
- });
97
-
98
- const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY! });
99
- const secured = agent.wrapOpenAI(openai, {
100
- system_id: process.env.AGENTID_SYSTEM_ID!,
101
- user_id: "customer-123",
90
+ ```ts
91
+ import OpenAI from "openai";
92
+ import { AgentID } from "agentid-sdk";
93
+
94
+ const agent = new AgentID();
95
+
96
+ const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY! });
97
+ const secured = agent.wrapOpenAI(openai, {
98
+ system_id: process.env.AGENTID_SYSTEM_ID!,
99
+ user_id: "customer-123",
102
100
  expected_languages: ["en"],
103
101
  });
104
102
 
@@ -107,8 +105,12 @@ const response = await secured.chat.completions.create({
107
105
  messages: [{ role: "user", content: "What is the capital of the Czech Republic?" }],
108
106
  });
109
107
 
110
- console.log(response.choices[0]?.message?.content ?? "");
111
- ```
108
+ console.log(response.choices[0]?.message?.content ?? "");
109
+ ```
110
+
111
+ By default, official AgentID SDK integrations inherit `enable_sdk_pii_masking`
112
+ from the dashboard/runtime config. You only need to set `piiMasking: true` in
113
+ code if you want to force local masking on even when the dashboard policy is off.
112
114
 
113
115
  Wrapped OpenAI calls persist telemetry for both regular and streamed completions. For `stream: true`, logging happens when the stream finishes.
114
116
 
@@ -1810,7 +1810,7 @@ function getInjectionScanner() {
1810
1810
 
1811
1811
  // src/sdk-version.ts
1812
1812
  var FALLBACK_SDK_VERSION = "js-0.0.0-dev";
1813
- var AGENTID_SDK_VERSION_HEADER = "js-0.1.36".trim().length > 0 ? "js-0.1.36" : FALLBACK_SDK_VERSION;
1813
+ var AGENTID_SDK_VERSION_HEADER = "js-0.1.37".trim().length > 0 ? "js-0.1.37" : FALLBACK_SDK_VERSION;
1814
1814
 
1815
1815
  // src/local-security-enforcer.ts
1816
1816
  var DEFAULT_FAIL_OPEN_CONFIG = {
@@ -2604,10 +2604,13 @@ var AgentID = class {
2604
2604
  return this.configuredPiiMasking ?? void 0;
2605
2605
  }
2606
2606
  resolveEffectivePiiMasking(config) {
2607
+ if (config?.enable_sdk_pii_masking === true) {
2608
+ return true;
2609
+ }
2607
2610
  if (this.configuredPiiMasking !== null) {
2608
2611
  return this.configuredPiiMasking;
2609
2612
  }
2610
- return config?.enable_sdk_pii_masking === true;
2613
+ return false;
2611
2614
  }
2612
2615
  getEffectivePiiMasking(options) {
2613
2616
  return this.resolveEffectivePiiMasking(this.getCachedCapabilityConfig(options));
package/dist/index.js CHANGED
@@ -75,7 +75,7 @@ var OpenAIAdapter = class {
75
75
 
76
76
  // src/sdk-version.ts
77
77
  var FALLBACK_SDK_VERSION = "js-0.0.0-dev";
78
- var AGENTID_SDK_VERSION_HEADER = "js-0.1.36".trim().length > 0 ? "js-0.1.36" : FALLBACK_SDK_VERSION;
78
+ var AGENTID_SDK_VERSION_HEADER = "js-0.1.37".trim().length > 0 ? "js-0.1.37" : FALLBACK_SDK_VERSION;
79
79
 
80
80
  // src/pii-national-identifiers.ts
81
81
  var MAX_CANDIDATES_PER_RULE = 256;
@@ -2637,10 +2637,13 @@ var AgentID = class {
2637
2637
  return this.configuredPiiMasking ?? void 0;
2638
2638
  }
2639
2639
  resolveEffectivePiiMasking(config) {
2640
+ if (config?.enable_sdk_pii_masking === true) {
2641
+ return true;
2642
+ }
2640
2643
  if (this.configuredPiiMasking !== null) {
2641
2644
  return this.configuredPiiMasking;
2642
2645
  }
2643
- return config?.enable_sdk_pii_masking === true;
2646
+ return false;
2644
2647
  }
2645
2648
  getEffectivePiiMasking(options) {
2646
2649
  return this.resolveEffectivePiiMasking(this.getCachedCapabilityConfig(options));
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  SecurityBlockError,
8
8
  getInjectionScanner,
9
9
  scanWithRegex
10
- } from "./chunk-TY4AXWGS.mjs";
10
+ } from "./chunk-HWES3LI2.mjs";
11
11
  export {
12
12
  AgentID,
13
13
  DependencyError,
package/dist/langchain.js CHANGED
@@ -27,7 +27,7 @@ var import_base = require("@langchain/core/callbacks/base");
27
27
 
28
28
  // src/sdk-version.ts
29
29
  var FALLBACK_SDK_VERSION = "js-0.0.0-dev";
30
- var AGENTID_SDK_VERSION_HEADER = "js-0.1.36".trim().length > 0 ? "js-0.1.36" : FALLBACK_SDK_VERSION;
30
+ var AGENTID_SDK_VERSION_HEADER = "js-0.1.37".trim().length > 0 ? "js-0.1.37" : FALLBACK_SDK_VERSION;
31
31
 
32
32
  // src/pii-national-identifiers.ts
33
33
  var MAX_CANDIDATES_PER_RULE = 256;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  PIIManager,
3
3
  SecurityBlockError
4
- } from "./chunk-TY4AXWGS.mjs";
4
+ } from "./chunk-HWES3LI2.mjs";
5
5
 
6
6
  // src/langchain.ts
7
7
  import { BaseCallbackHandler } from "@langchain/core/callbacks/base";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentid-sdk",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "description": "AgentID JavaScript/TypeScript SDK for guard, ingest, tracing, and analytics.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://agentid.ai",