@n8n/n8n-nodes-langchain 1.121.0 → 1.122.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.
Files changed (137) hide show
  1. package/dist/nodes/Guardrails/Guardrails.node.js +29 -40
  2. package/dist/nodes/Guardrails/Guardrails.node.js.map +1 -1
  3. package/dist/nodes/Guardrails/actions/execute.js +68 -0
  4. package/dist/nodes/Guardrails/actions/execute.js.map +1 -0
  5. package/dist/nodes/Guardrails/actions/process.js +10 -7
  6. package/dist/nodes/Guardrails/actions/process.js.map +1 -1
  7. package/dist/nodes/Guardrails/description.js +326 -365
  8. package/dist/nodes/Guardrails/description.js.map +1 -1
  9. package/dist/nodes/Guardrails/helpers/configureNodeInputs.js +37 -3
  10. package/dist/nodes/Guardrails/helpers/configureNodeInputs.js.map +1 -1
  11. package/dist/nodes/Guardrails/helpers/model.js.map +1 -1
  12. package/dist/nodes/Guardrails/v1/GuardrailsV1.node.js +59 -0
  13. package/dist/nodes/Guardrails/v1/GuardrailsV1.node.js.map +1 -0
  14. package/dist/nodes/Guardrails/v2/GuardrailsV2.node.js +59 -0
  15. package/dist/nodes/Guardrails/v2/GuardrailsV2.node.js.map +1 -0
  16. package/dist/nodes/ToolExecutor/ToolExecutor.node.js.map +1 -1
  17. package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js +1 -1
  18. package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js.map +1 -1
  19. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js +3 -85
  20. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js.map +1 -1
  21. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.js +1 -1
  22. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.js.map +1 -1
  23. package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js +1 -1
  24. package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js.map +1 -1
  25. package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js +2 -2
  26. package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js.map +1 -1
  27. package/dist/nodes/agents/Agent/agents/ToolsAgent/V1/execute.js +1 -1
  28. package/dist/nodes/agents/Agent/agents/ToolsAgent/V1/execute.js.map +1 -1
  29. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js +1 -1
  30. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js.map +1 -1
  31. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/buildExecutionContext.js.map +1 -1
  32. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/createAgentSequence.js +1 -1
  33. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/createAgentSequence.js.map +1 -1
  34. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/executeBatch.js.map +1 -1
  35. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/finalizeResult.js.map +1 -1
  36. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/prepareItemContext.js.map +1 -1
  37. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/runAgent.js +8 -16
  38. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/runAgent.js.map +1 -1
  39. package/dist/nodes/agents/Agent/agents/ToolsAgent/common.js +1 -1
  40. package/dist/nodes/agents/Agent/agents/ToolsAgent/common.js.map +1 -1
  41. package/dist/nodes/agents/Agent/agents/utils.js.map +1 -1
  42. package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js +2 -2
  43. package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js.map +1 -1
  44. package/dist/nodes/chains/ChainRetrievalQA/processItem.js +2 -2
  45. package/dist/nodes/chains/ChainRetrievalQA/processItem.js.map +1 -1
  46. package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js +1 -1
  47. package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js.map +1 -1
  48. package/dist/nodes/chains/ChainSummarization/V2/processItem.js +1 -1
  49. package/dist/nodes/chains/ChainSummarization/V2/processItem.js.map +1 -1
  50. package/dist/nodes/chains/ChainSummarization/helpers.js.map +1 -1
  51. package/dist/nodes/chains/InformationExtractor/InformationExtractor.node.js +1 -1
  52. package/dist/nodes/chains/InformationExtractor/InformationExtractor.node.js.map +1 -1
  53. package/dist/nodes/chains/InformationExtractor/processItem.js.map +1 -1
  54. package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js +1 -1
  55. package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js.map +1 -1
  56. package/dist/nodes/chains/TextClassifier/TextClassifier.node.js +1 -1
  57. package/dist/nodes/chains/TextClassifier/TextClassifier.node.js.map +1 -1
  58. package/dist/nodes/chains/TextClassifier/processItem.js.map +1 -1
  59. package/dist/nodes/code/Code.node.js +66 -2
  60. package/dist/nodes/code/Code.node.js.map +1 -1
  61. package/dist/nodes/llms/LMOllama/LmOllama.node.js +1 -1
  62. package/dist/nodes/llms/LMOllama/LmOllama.node.js.map +1 -1
  63. package/dist/nodes/mcp/McpClientTool/utils.js +1 -1
  64. package/dist/nodes/mcp/McpClientTool/utils.js.map +1 -1
  65. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js +1 -1
  66. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js.map +1 -1
  67. package/dist/nodes/memory/MemoryMongoDbChat/MemoryMongoDbChat.node.js +1 -1
  68. package/dist/nodes/memory/MemoryMongoDbChat/MemoryMongoDbChat.node.js.map +1 -1
  69. package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js +1 -1
  70. package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js.map +1 -1
  71. package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js +1 -1
  72. package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js.map +1 -1
  73. package/dist/nodes/memory/MemoryXata/MemoryXata.node.js +1 -1
  74. package/dist/nodes/memory/MemoryXata/MemoryXata.node.js.map +1 -1
  75. package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js +2 -2
  76. package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js.map +1 -1
  77. package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js +1 -1
  78. package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js.map +1 -1
  79. package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js +1 -1
  80. package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js.map +1 -1
  81. package/dist/nodes/tools/ToolThink/ToolThink.node.js +1 -1
  82. package/dist/nodes/tools/ToolThink/ToolThink.node.js.map +1 -1
  83. package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js +2 -2
  84. package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js.map +1 -1
  85. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js +5 -21
  86. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js.map +1 -1
  87. package/dist/nodes/trigger/ChatTrigger/Chat.node.js +2 -2
  88. package/dist/nodes/trigger/ChatTrigger/Chat.node.js.map +1 -1
  89. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js +1 -1
  90. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -1
  91. package/dist/nodes/vector_store/VectorStoreAzureAISearch/VectorStoreAzureAISearch.node.js +65 -17
  92. package/dist/nodes/vector_store/VectorStoreAzureAISearch/VectorStoreAzureAISearch.node.js.map +1 -1
  93. package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js.map +1 -1
  94. package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js.map +1 -1
  95. package/dist/nodes/vector_store/VectorStoreQdrant/qdrant.svg +23 -19
  96. package/dist/nodes/vector_store/shared/MemoryManager/MemoryCalculator.js.map +1 -1
  97. package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.js +1 -1
  98. package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.js.map +1 -1
  99. package/dist/nodes/vector_store/shared/MemoryManager/StoreCleanupService.js.map +1 -1
  100. package/dist/nodes/vector_store/shared/MemoryManager/types.js.map +1 -1
  101. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js +18 -16
  102. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js.map +1 -1
  103. package/dist/nodes/vendors/GoogleGemini/actions/image/edit.operation.js +6 -1
  104. package/dist/nodes/vendors/GoogleGemini/actions/image/edit.operation.js.map +1 -1
  105. package/dist/nodes/vendors/GoogleGemini/actions/image/generate.operation.js +1 -1
  106. package/dist/nodes/vendors/GoogleGemini/actions/image/generate.operation.js.map +1 -1
  107. package/dist/nodes/vendors/GoogleGemini/methods/listSearch.js +23 -8
  108. package/dist/nodes/vendors/GoogleGemini/methods/listSearch.js.map +1 -1
  109. package/dist/nodes/vendors/OpenAi/helpers/utils.js.map +1 -1
  110. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.js +2 -2
  111. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.js.map +1 -1
  112. package/dist/types/nodes.json +7 -6
  113. package/dist/utils/N8nBinaryLoader.js +2 -2
  114. package/dist/utils/N8nBinaryLoader.js.map +1 -1
  115. package/dist/utils/N8nJsonLoader.js +2 -2
  116. package/dist/utils/N8nJsonLoader.js.map +1 -1
  117. package/dist/utils/N8nTool.js +1 -1
  118. package/dist/utils/N8nTool.js.map +1 -1
  119. package/dist/utils/agent-execution/buildSteps.js +12 -8
  120. package/dist/utils/agent-execution/buildSteps.js.map +1 -1
  121. package/dist/utils/agent-execution/createEngineRequests.js +19 -1
  122. package/dist/utils/agent-execution/createEngineRequests.js.map +1 -1
  123. package/dist/utils/agent-execution/index.js +4 -4
  124. package/dist/utils/agent-execution/index.js.map +1 -1
  125. package/dist/utils/agent-execution/memoryManagement.js +15 -14
  126. package/dist/utils/agent-execution/memoryManagement.js.map +1 -1
  127. package/dist/utils/agent-execution/processEventStream.js +1 -47
  128. package/dist/utils/agent-execution/processEventStream.js.map +1 -1
  129. package/dist/utils/agent-execution/types.js.map +1 -1
  130. package/dist/utils/fromAIToolFactory.js +61 -0
  131. package/dist/utils/fromAIToolFactory.js.map +1 -0
  132. package/dist/utils/helpers.js +1 -1
  133. package/dist/utils/helpers.js.map +1 -1
  134. package/dist/utils/logWrapper.js.map +1 -1
  135. package/dist/utils/output_parsers/N8nStructuredOutputParser.js +1 -1
  136. package/dist/utils/output_parsers/N8nStructuredOutputParser.js.map +1 -1
  137. package/package.json +31 -30
@@ -18,15 +18,13 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var description_exports = {};
20
20
  __export(description_exports, {
21
- versionDescription: () => versionDescription
21
+ propertiesDescription: () => propertiesDescription
22
22
  });
23
23
  module.exports = __toCommonJS(description_exports);
24
- var import_n8n_workflow = require("n8n-workflow");
25
24
  var import_jailbreak = require("./actions/checks/jailbreak");
26
25
  var import_nsfw = require("./actions/checks/nsfw");
27
26
  var import_pii = require("./actions/checks/pii");
28
27
  var import_topicalAlignment = require("./actions/checks/topicalAlignment");
29
- var import_configureNodeInputs = require("./helpers/configureNodeInputs");
30
28
  var import_model = require("./helpers/model");
31
29
  const THRESHOLD_OPTION = {
32
30
  displayName: "Threshold",
@@ -61,394 +59,357 @@ const wrapValue = (properties) => ({
61
59
  name: "value",
62
60
  values: properties
63
61
  });
64
- const versionDescription = {
65
- displayName: "Guardrails",
66
- name: "guardrails",
67
- icon: "file:guardrails.svg",
68
- group: ["transform"],
69
- version: 1,
70
- description: "Safeguard AI models from malicious input or prevent them from generating undesirable responses",
71
- defaults: {
72
- name: "Guardrails"
62
+ const propertiesDescription = [
63
+ {
64
+ displayName: "Use guardrails to validate text against a set of policies (e.g. NSFW, prompt injection) or to sanitize it (e.g. personal data, secret keys)",
65
+ name: "guardrailsUsage",
66
+ type: "notice",
67
+ default: ""
73
68
  },
74
- codex: {
75
- alias: ["LangChain", "Guardrails", "PII", "Secret", "Injection", "Sanitize"],
76
- categories: ["AI"],
77
- subcategories: {
78
- AI: ["Agents", "Miscellaneous", "Root Nodes"]
79
- },
80
- resources: {
81
- primaryDocumentation: [
82
- {
83
- url: "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.guardrails/"
84
- }
85
- ]
69
+ {
70
+ displayName: "Operation",
71
+ name: "operation",
72
+ type: "options",
73
+ noDataExpression: true,
74
+ options: [
75
+ {
76
+ name: "Check Text for Violations",
77
+ value: "classify",
78
+ action: "Check text for violations",
79
+ description: "Validate text against a set of policies (e.g. NSFW, prompt injection)"
80
+ },
81
+ {
82
+ name: "Sanitize Text",
83
+ value: "sanitize",
84
+ action: "Sanitize text",
85
+ // eslint-disable-next-line n8n-nodes-base/node-param-description-excess-final-period
86
+ description: "Redact text to mask personal data, secret keys, URLs, etc."
87
+ }
88
+ ],
89
+ default: "classify"
90
+ },
91
+ {
92
+ displayName: "Text To Check",
93
+ name: "text",
94
+ type: "string",
95
+ required: true,
96
+ default: "",
97
+ typeOptions: {
98
+ rows: 1
86
99
  }
87
100
  },
88
- inputs: `={{(${import_configureNodeInputs.configureNodeInputs})($parameter.operation)}}`,
89
- outputs: `={{
90
- ((parameters) => {
91
- const operation = parameters.operation ?? 'classify';
92
-
93
- if (operation === 'classify') {
94
- return [{displayName: "Pass", type: "${import_n8n_workflow.NodeConnectionTypes.Main}"}, {displayName: "Fail", type: "${import_n8n_workflow.NodeConnectionTypes.Main}"}]
95
- }
96
-
97
- return [{ displayName: "", type: "${import_n8n_workflow.NodeConnectionTypes.Main}"}]
98
- })($parameter)
99
- }}`,
100
- properties: [
101
- {
102
- displayName: "Use guardrails to validate text against a set of policies (e.g. NSFW, prompt injection) or to sanitize it (e.g. personal data, secret keys)",
103
- name: "guardrailsUsage",
104
- type: "notice",
105
- default: ""
106
- },
107
- {
108
- displayName: "Operation",
109
- name: "operation",
110
- type: "options",
111
- noDataExpression: true,
112
- options: [
113
- {
114
- name: "Check Text for Violations",
115
- value: "classify",
116
- action: "Check text for violations",
117
- description: "Validate text against a set of policies (e.g. NSFW, prompt injection)"
118
- },
119
- {
120
- name: "Sanitize Text",
121
- value: "sanitize",
122
- action: "Sanitize text",
123
- // eslint-disable-next-line n8n-nodes-base/node-param-description-excess-final-period
124
- description: "Redact text to mask personal data, secret keys, URLs, etc."
125
- }
126
- ],
127
- default: "classify"
128
- },
129
- {
130
- displayName: "Text To Check",
131
- name: "text",
132
- type: "string",
133
- required: true,
134
- default: "",
135
- typeOptions: {
136
- rows: 1
137
- }
138
- },
139
- {
140
- displayName: "Guardrails",
141
- name: "guardrails",
142
- placeholder: "Add Guardrail",
143
- type: "collection",
144
- default: {},
145
- options: [
146
- {
147
- displayName: "Keywords",
148
- name: "keywords",
149
- type: "string",
150
- default: "",
151
- description: "This guardrail checks if specified keywords appear in the input text and can be configured to trigger tripwires based on keyword matches. Multiple keywords can be added separated by comma.",
152
- displayOptions: {
153
- show: {
154
- "/operation": ["classify"]
155
- }
101
+ {
102
+ displayName: "Guardrails",
103
+ name: "guardrails",
104
+ placeholder: "Add Guardrail",
105
+ type: "collection",
106
+ default: {},
107
+ options: [
108
+ {
109
+ displayName: "Keywords",
110
+ name: "keywords",
111
+ type: "string",
112
+ default: "",
113
+ description: "This guardrail checks if specified keywords appear in the input text and can be configured to trigger tripwires based on keyword matches. Multiple keywords can be added separated by comma.",
114
+ displayOptions: {
115
+ show: {
116
+ "/operation": ["classify"]
156
117
  }
157
- },
158
- {
159
- displayName: "Jailbreak",
160
- name: "jailbreak",
161
- type: "fixedCollection",
162
- default: { value: { threshold: 0.7 } },
163
- description: "Detects attempts to jailbreak or bypass AI safety measures",
164
- options: [wrapValue([THRESHOLD_OPTION, ...getPromptOption(import_jailbreak.JAILBREAK_PROMPT)])],
165
- displayOptions: {
166
- show: {
167
- "/operation": ["classify"]
168
- }
118
+ }
119
+ },
120
+ {
121
+ displayName: "Jailbreak",
122
+ name: "jailbreak",
123
+ type: "fixedCollection",
124
+ default: { value: { threshold: 0.7 } },
125
+ description: "Detects attempts to jailbreak or bypass AI safety measures",
126
+ options: [wrapValue([THRESHOLD_OPTION, ...getPromptOption(import_jailbreak.JAILBREAK_PROMPT)])],
127
+ displayOptions: {
128
+ show: {
129
+ "/operation": ["classify"]
169
130
  }
170
- },
171
- {
172
- displayName: "NSFW",
173
- name: "nsfw",
174
- type: "fixedCollection",
175
- default: { value: { threshold: 0.7 } },
176
- description: "Detects attempts to generate NSFW content",
177
- options: [wrapValue([THRESHOLD_OPTION, ...getPromptOption(import_nsfw.NSFW_SYSTEM_PROMPT)])],
178
- displayOptions: {
179
- show: {
180
- "/operation": ["classify"]
181
- }
131
+ }
132
+ },
133
+ {
134
+ displayName: "NSFW",
135
+ name: "nsfw",
136
+ type: "fixedCollection",
137
+ default: { value: { threshold: 0.7 } },
138
+ description: "Detects attempts to generate NSFW content",
139
+ options: [wrapValue([THRESHOLD_OPTION, ...getPromptOption(import_nsfw.NSFW_SYSTEM_PROMPT)])],
140
+ displayOptions: {
141
+ show: {
142
+ "/operation": ["classify"]
182
143
  }
183
- },
184
- {
185
- displayName: "Personal Data (PII)",
186
- name: "pii",
187
- type: "fixedCollection",
188
- default: { value: { type: "all" } },
189
- description: "Detects attempts to use personal data content",
190
- options: [
191
- wrapValue([
192
- {
193
- displayName: "Type",
194
- name: "type",
195
- type: "options",
196
- default: "",
197
- options: [
198
- { name: "All", value: "all" },
199
- { name: "Selected", value: "selected" }
200
- ]
144
+ }
145
+ },
146
+ {
147
+ displayName: "Personal Data (PII)",
148
+ name: "pii",
149
+ type: "fixedCollection",
150
+ default: { value: { type: "all" } },
151
+ description: "Detects attempts to use personal data content",
152
+ options: [
153
+ wrapValue([
154
+ {
155
+ displayName: "Type",
156
+ name: "type",
157
+ type: "options",
158
+ default: "",
159
+ options: [
160
+ { name: "All", value: "all" },
161
+ { name: "Selected", value: "selected" }
162
+ ]
163
+ },
164
+ {
165
+ displayName: "Entities",
166
+ name: "entities",
167
+ type: "multiOptions",
168
+ default: [],
169
+ displayOptions: {
170
+ show: {
171
+ type: ["selected"]
172
+ }
201
173
  },
202
- {
203
- displayName: "Entities",
204
- name: "entities",
205
- type: "multiOptions",
206
- default: [],
207
- displayOptions: {
208
- show: {
209
- type: ["selected"]
210
- }
174
+ options: Object.values(import_pii.PIIEntity).map((entity) => ({
175
+ name: import_pii.PII_NAME_MAP[entity],
176
+ value: entity
177
+ }))
178
+ }
179
+ ])
180
+ ]
181
+ },
182
+ {
183
+ displayName: "Secret Keys",
184
+ name: "secretKeys",
185
+ type: "fixedCollection",
186
+ default: { value: { permissiveness: "balanced" } },
187
+ description: "Detects attempts to use secret keys in the input text. Scans text for common patterns, applies entropy analysis to detect random-looking strings.",
188
+ options: [
189
+ wrapValue([
190
+ {
191
+ displayName: "Permissiveness",
192
+ name: "permissiveness",
193
+ type: "options",
194
+ default: "",
195
+ options: [
196
+ {
197
+ name: "Strict",
198
+ value: "strict",
199
+ description: "Most sensitive, may have more false positives (commonly flag high entropy filenames or code)"
200
+ },
201
+ {
202
+ name: "Balanced",
203
+ value: "balanced",
204
+ description: "Balanced between sensitivity and specificity"
211
205
  },
212
- options: Object.values(import_pii.PIIEntity).map((entity) => ({
213
- name: import_pii.PII_NAME_MAP[entity],
214
- value: entity
215
- }))
206
+ {
207
+ name: "Permissive",
208
+ value: "permissive",
209
+ description: "Least sensitive, may miss some secret keys (but also reduces false positives)"
210
+ }
211
+ ]
212
+ }
213
+ ])
214
+ ]
215
+ },
216
+ {
217
+ displayName: "Topical Alignment",
218
+ name: "topicalAlignment",
219
+ type: "fixedCollection",
220
+ default: { value: { threshold: 0.7 } },
221
+ description: "Detects attempts to stray from the business scope",
222
+ options: [
223
+ wrapValue([
224
+ THRESHOLD_OPTION,
225
+ ...getPromptOption(
226
+ import_topicalAlignment.TOPICAL_ALIGNMENT_SYSTEM_PROMPT,
227
+ false,
228
+ "Make sure you replace the placeholder."
229
+ )
230
+ ])
231
+ ],
232
+ displayOptions: {
233
+ show: {
234
+ "/operation": ["classify"]
235
+ }
236
+ }
237
+ },
238
+ {
239
+ displayName: "URLs",
240
+ name: "urls",
241
+ type: "fixedCollection",
242
+ default: { value: { allowedSchemes: ["https"], allowedUrls: "" } },
243
+ description: "Blocks URLs that are not in the allowed list",
244
+ options: [
245
+ wrapValue([
246
+ {
247
+ displayName: "Block All URLs Except",
248
+ name: "allowedUrls",
249
+ type: "string",
250
+ // keep placeholder to avoid limitation that removes collections with unchanged default values
251
+ default: "PLACEHOLDER",
252
+ description: "Multiple URLs can be added separated by comma. Leave empty to block all URLs."
253
+ },
254
+ {
255
+ displayName: "Allowed Schemes",
256
+ name: "allowedSchemes",
257
+ type: "multiOptions",
258
+ default: ["https"],
259
+ // eslint-disable-next-line n8n-nodes-base/node-param-multi-options-type-unsorted-items
260
+ options: [
261
+ // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
262
+ { name: "https", value: "https" },
263
+ // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
264
+ { name: "http", value: "http" },
265
+ // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
266
+ { name: "ftp", value: "ftp" },
267
+ // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
268
+ { name: "data", value: "data" },
269
+ // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
270
+ { name: "javascript", value: "javascript" },
271
+ // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
272
+ { name: "vbscript", value: "vbscript" },
273
+ // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
274
+ { name: "mailto", value: "mailto" }
275
+ ]
276
+ },
277
+ {
278
+ displayName: "Block Userinfo",
279
+ name: "blockUserinfo",
280
+ type: "boolean",
281
+ default: true,
282
+ description: "Whether to block URLs with userinfo (user:pass@domain) to prevent credential injection",
283
+ displayOptions: {
284
+ show: {
285
+ "/operation": ["classify"]
286
+ }
287
+ }
288
+ },
289
+ {
290
+ displayName: "Sanitize Userinfo",
291
+ name: "blockUserinfo",
292
+ type: "boolean",
293
+ default: true,
294
+ description: "Whether to sanitize URLs with userinfo (user:pass@domain) to prevent credential injection",
295
+ displayOptions: {
296
+ show: {
297
+ "/operation": ["sanitize"]
298
+ }
216
299
  }
217
- ])
218
- ]
300
+ },
301
+ {
302
+ displayName: "Allow Subdomains",
303
+ name: "allowSubdomains",
304
+ type: "boolean",
305
+ default: true,
306
+ description: "Whether to allow subdomains (e.g. sub.domain.com if domain.com is allowed)"
307
+ }
308
+ ])
309
+ ]
310
+ },
311
+ {
312
+ displayName: "Custom",
313
+ name: "custom",
314
+ type: "fixedCollection",
315
+ typeOptions: {
316
+ sortable: true,
317
+ multipleValues: true
219
318
  },
220
- {
221
- displayName: "Secret Keys",
222
- name: "secretKeys",
223
- type: "fixedCollection",
224
- default: { value: { permissiveness: "balanced" } },
225
- description: "Detects attempts to use secret keys in the input text. Scans text for common patterns, applies entropy analysis to detect random-looking strings.",
226
- options: [
227
- wrapValue([
319
+ placeholder: "Add Custom Guardrail",
320
+ default: {
321
+ guardrail: [{ name: "Custom Guardrail" }]
322
+ },
323
+ options: [
324
+ {
325
+ displayName: "Guardrail",
326
+ name: "guardrail",
327
+ values: [
228
328
  {
229
- displayName: "Permissiveness",
230
- name: "permissiveness",
231
- type: "options",
329
+ displayName: "Name",
330
+ name: "name",
331
+ type: "string",
232
332
  default: "",
233
- options: [
234
- {
235
- name: "Strict",
236
- value: "strict",
237
- description: "Most sensitive, may have more false positives (commonly flag high entropy filenames or code)"
238
- },
239
- {
240
- name: "Balanced",
241
- value: "balanced",
242
- description: "Balanced between sensitivity and specificity"
243
- },
244
- {
245
- name: "Permissive",
246
- value: "permissive",
247
- description: "Least sensitive, may miss some secret keys (but also reduces false positives)"
248
- }
249
- ]
250
- }
251
- ])
252
- ]
253
- },
254
- {
255
- displayName: "Topical Alignment",
256
- name: "topicalAlignment",
257
- type: "fixedCollection",
258
- default: { value: { threshold: 0.7 } },
259
- description: "Detects attempts to stray from the business scope",
260
- options: [
261
- wrapValue([
333
+ description: "Name of the custom guardrail"
334
+ },
262
335
  THRESHOLD_OPTION,
263
- ...getPromptOption(
264
- import_topicalAlignment.TOPICAL_ALIGNMENT_SYSTEM_PROMPT,
265
- false,
266
- "Make sure you replace the placeholder."
267
- )
268
- ])
269
- ],
270
- displayOptions: {
271
- show: {
272
- "/operation": ["classify"]
273
- }
336
+ ...getPromptOption("", false)
337
+ ]
338
+ }
339
+ ],
340
+ displayOptions: {
341
+ show: {
342
+ "/operation": ["classify"]
274
343
  }
344
+ }
345
+ },
346
+ {
347
+ displayName: "Custom Regex",
348
+ name: "customRegex",
349
+ type: "fixedCollection",
350
+ typeOptions: {
351
+ sortable: true,
352
+ multipleValues: true
275
353
  },
276
- {
277
- displayName: "URLs",
278
- name: "urls",
279
- type: "fixedCollection",
280
- default: { value: { allowedSchemes: ["https"], allowedUrls: "" } },
281
- description: "Blocks URLs that are not in the allowed list",
282
- options: [
283
- wrapValue([
354
+ placeholder: "Add Custom Regex",
355
+ default: {},
356
+ options: [
357
+ {
358
+ displayName: "Regex",
359
+ name: "regex",
360
+ values: [
284
361
  {
285
- displayName: "Block All URLs Except",
286
- name: "allowedUrls",
362
+ displayName: "Name",
363
+ name: "name",
287
364
  type: "string",
288
- // keep placeholder to avoid limitation that removes collections with unchanged default values
289
- default: "PLACEHOLDER",
290
- description: "Multiple URLs can be added separated by comma. Leave empty to block all URLs."
291
- },
292
- {
293
- displayName: "Allowed Schemes",
294
- name: "allowedSchemes",
295
- type: "multiOptions",
296
- default: ["https"],
297
- // eslint-disable-next-line n8n-nodes-base/node-param-multi-options-type-unsorted-items
298
- options: [
299
- // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
300
- { name: "https", value: "https" },
301
- // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
302
- { name: "http", value: "http" },
303
- // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
304
- { name: "ftp", value: "ftp" },
305
- // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
306
- { name: "data", value: "data" },
307
- // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
308
- { name: "javascript", value: "javascript" },
309
- // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
310
- { name: "vbscript", value: "vbscript" },
311
- // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
312
- { name: "mailto", value: "mailto" }
313
- ]
314
- },
315
- {
316
- displayName: "Block Userinfo",
317
- name: "blockUserinfo",
318
- type: "boolean",
319
- default: true,
320
- description: "Whether to block URLs with userinfo (user:pass@domain) to prevent credential injection",
321
- displayOptions: {
322
- show: {
323
- "/operation": ["classify"]
324
- }
325
- }
326
- },
327
- {
328
- displayName: "Sanitize Userinfo",
329
- name: "blockUserinfo",
330
- type: "boolean",
331
- default: true,
332
- description: "Whether to sanitize URLs with userinfo (user:pass@domain) to prevent credential injection",
333
- displayOptions: {
334
- show: {
335
- "/operation": ["sanitize"]
336
- }
337
- }
365
+ default: "",
366
+ description: "Name of the custom regex. Will be used for replacement when sanitizing."
338
367
  },
339
368
  {
340
- displayName: "Allow Subdomains",
341
- name: "allowSubdomains",
342
- type: "boolean",
343
- default: true,
344
- description: "Whether to allow subdomains (e.g. sub.domain.com if domain.com is allowed)"
369
+ displayName: "Regex",
370
+ name: "value",
371
+ type: "string",
372
+ default: "",
373
+ description: "Regex to match the input text",
374
+ placeholder: "/text/gi"
345
375
  }
346
- ])
347
- ]
348
- },
349
- {
350
- displayName: "Custom",
351
- name: "custom",
352
- type: "fixedCollection",
353
- typeOptions: {
354
- sortable: true,
355
- multipleValues: true
356
- },
357
- placeholder: "Add Custom Guardrail",
358
- default: {
359
- guardrail: [{ name: "Custom Guardrail" }]
360
- },
361
- options: [
362
- {
363
- displayName: "Guardrail",
364
- name: "guardrail",
365
- values: [
366
- {
367
- displayName: "Name",
368
- name: "name",
369
- type: "string",
370
- default: "",
371
- description: "Name of the custom guardrail"
372
- },
373
- THRESHOLD_OPTION,
374
- ...getPromptOption("", false)
375
- ]
376
- }
377
- ],
378
- displayOptions: {
379
- show: {
380
- "/operation": ["classify"]
381
- }
376
+ ]
382
377
  }
383
- },
384
- {
385
- displayName: "Custom Regex",
386
- name: "customRegex",
387
- type: "fixedCollection",
388
- typeOptions: {
389
- sortable: true,
390
- multipleValues: true
391
- },
392
- placeholder: "Add Custom Regex",
393
- default: {},
394
- options: [
395
- {
396
- displayName: "Regex",
397
- name: "regex",
398
- values: [
399
- {
400
- displayName: "Name",
401
- name: "name",
402
- type: "string",
403
- default: "",
404
- description: "Name of the custom regex. Will be used for replacement when sanitizing."
405
- },
406
- {
407
- displayName: "Regex",
408
- name: "value",
409
- type: "string",
410
- default: "",
411
- description: "Regex to match the input text",
412
- placeholder: "/text/gi"
413
- }
414
- ]
415
- }
416
- ]
417
- }
418
- ]
419
- },
420
- {
421
- displayName: "Customize System Message",
422
- name: "customizeSystemMessage",
423
- description: "Whether to customize the system message used by the guardrail to specify the output format",
424
- type: "boolean",
425
- default: false,
426
- displayOptions: {
427
- show: {
428
- "/operation": ["classify"]
429
- }
378
+ ]
379
+ }
380
+ ]
381
+ },
382
+ {
383
+ displayName: "Customize System Message",
384
+ name: "customizeSystemMessage",
385
+ description: "Whether to customize the system message used by the guardrail to specify the output format",
386
+ type: "boolean",
387
+ default: false,
388
+ displayOptions: {
389
+ show: {
390
+ "/operation": ["classify"]
430
391
  }
392
+ }
393
+ },
394
+ {
395
+ displayName: "System Message",
396
+ name: "systemMessage",
397
+ type: "string",
398
+ description: "The system message used by the guardrail to enforce thresholds and JSON output according to schema",
399
+ hint: "This message is appended after prompts defined by guardrails",
400
+ default: import_model.LLM_SYSTEM_RULES,
401
+ typeOptions: {
402
+ rows: 6
431
403
  },
432
- {
433
- displayName: "System Message",
434
- name: "systemMessage",
435
- type: "string",
436
- description: "The system message used by the guardrail to enforce thresholds and JSON output according to schema",
437
- hint: "This message is appended after prompts defined by guardrails",
438
- default: import_model.LLM_SYSTEM_RULES,
439
- typeOptions: {
440
- rows: 6
441
- },
442
- displayOptions: {
443
- show: {
444
- "/customizeSystemMessage": [true]
445
- }
404
+ displayOptions: {
405
+ show: {
406
+ "/customizeSystemMessage": [true]
446
407
  }
447
408
  }
448
- ]
449
- };
409
+ }
410
+ ];
450
411
  // Annotate the CommonJS export names for ESM import in node:
451
412
  0 && (module.exports = {
452
- versionDescription
413
+ propertiesDescription
453
414
  });
454
415
  //# sourceMappingURL=description.js.map