n8n-nodes-botarmor 0.0.0-stage → 0.1.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BotArmor AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,49 @@
1
- # Temporary Holding Version
1
+ # n8n-nodes-botarmor
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ n8n node for **BotArmor AI**: crash-test your customer-service chatbot (a red-teaming audit of its live webhook), wait for the grade, and stop a workflow when the bot is below your threshold — a CI-style gate for no-code bots.
4
+
5
+ BotArmor tests bots you own, or that you have the owner's written permission to test. Every audit start asks you to confirm it.
6
+
7
+ ## Install
8
+
9
+ In n8n: **Settings → Community Nodes → Install**, package name `n8n-nodes-botarmor`.
10
+
11
+ ## Credentials
12
+
13
+ **BotArmor API**: a personal API key (`ba_live_…`) from the BotArmor dashboard, tab **API**. Revoke it there at any time.
14
+
15
+ ## Operations
16
+
17
+ | Resource | Operation | What it does |
18
+ |---|---|---|
19
+ | Audit | Start | Starts a live audit of a registered agent (10–20 min). Returns `audit_code`. |
20
+ | Audit | Retest | Re-runs a finished audit with your patched prompt; the report shows before/after per scenario. |
21
+ | Audit | Get Status | `status` (running / completed / failed), `grade` (A–F), `gate.passed` against your minimum grade. With **Fail When Below Threshold**, the node errors (HTTP 412) on a weak bot and stops the workflow. |
22
+ | Audit | Get Many | Your audits, newest first. |
23
+ | Audit | Verify Report | Public check that a report is authentic, not altered, anchored and still current. |
24
+ | Agent | Get Many | Your registered agents (ids for Start). |
25
+
26
+ ## Typical workflow
27
+
28
+ `Start` → `Wait 10 min` → `Get Status` → `IF status = running` (loop back through a 5-min `Wait`) → `IF gate.passed` → publish / alert.
29
+
30
+ A ready-made template is in [`templates/reaudit-on-prompt-change.json`](templates/reaudit-on-prompt-change.json): when the prompt cell of your bot changes in a Google Sheet, it retests the bot and posts the grade to Slack.
31
+
32
+ ## Languages
33
+
34
+ Reports in English, French, German or Spanish (**Report Language**). The attacker speaks your bot's language: detected from its prompt by default, or set with **Bot Language** — a French agency can audit an English-speaking bot and get the report in French.
35
+
36
+ ## Development
37
+
38
+ ```bash
39
+ npm install
40
+ npm run build
41
+ ```
42
+
43
+ No runtime dependencies: the node is declarative, each operation is one HTTPS call to the BotArmor API.
44
+
45
+ Releases are published from GitHub Actions through npm Trusted Publishing, with provenance: bump the version in `package.json`, commit, and push a tag `v<version>`. No npm token is stored anywhere.
46
+
47
+ ## License
48
+
49
+ MIT
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BotArmorApi = void 0;
4
+ // A personal API key from the BotArmor dashboard (tab "API"). Sent as a Bearer token; never logged by the node.
5
+ class BotArmorApi {
6
+ constructor() {
7
+ this.name = 'botArmorApi';
8
+ this.displayName = 'BotArmor API';
9
+ this.documentationUrl = 'https://botarmor-arena.netlify.app';
10
+ this.properties = [
11
+ {
12
+ displayName: 'API Key',
13
+ name: 'apiKey',
14
+ type: 'string',
15
+ typeOptions: { password: true },
16
+ default: '',
17
+ required: true,
18
+ description: 'Starts with ba_live_. Create it in the BotArmor dashboard, tab "API".',
19
+ },
20
+ {
21
+ displayName: 'Base URL',
22
+ name: 'baseUrl',
23
+ type: 'string',
24
+ default: 'https://vps-57bd57fc.vps.ovh.net',
25
+ description: 'Address of the BotArmor API',
26
+ },
27
+ ];
28
+ this.authenticate = {
29
+ type: 'generic',
30
+ properties: { headers: { Authorization: '=Bearer {{$credentials.apiKey}}' } },
31
+ };
32
+ this.test = {
33
+ request: { baseURL: '={{$credentials.baseUrl}}', url: '/api/agents' },
34
+ };
35
+ }
36
+ }
37
+ exports.BotArmorApi = BotArmorApi;
@@ -0,0 +1,259 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BotArmor = void 0;
4
+ // Declarative node: every operation is one call to the BotArmor API, no runtime dependency.
5
+ // Typical workflow: Start Audit -> Wait 10 min -> Get Status (loop while "running") -> IF gate.passed.
6
+ const LEVELS = [
7
+ ['logic', 'Logic Maze'],
8
+ ['toxic', 'Angry Customer'],
9
+ ['hacker', 'Fake CEO'],
10
+ ['lawyer', 'Scam Lawyer'],
11
+ ['multilang', 'Language Mix'],
12
+ ['loop', 'Infinite Loop'],
13
+ ['roleplay', 'Roleplay Trap'],
14
+ ['phishing', 'Payload & Phishing'],
15
+ ['ethics', 'Ethics & Compliance'],
16
+ ['burst', 'Multi-Turn Burst'],
17
+ ['disclosure', 'AI Disclosure (Art. 50)'],
18
+ ['facts', 'Invented Facts'],
19
+ ].map(([value, name]) => ({ name, value }));
20
+ const AUTHORIZATION = "I confirm that I own this agent or hold the owner's written authorization to subject it to adversarial testing; I accept the rules of engagement (point-in-time test, test markers, consumption of the agent's operations) and I understand this test is not a certification.";
21
+ class BotArmor {
22
+ constructor() {
23
+ this.description = {
24
+ displayName: 'BotArmor',
25
+ name: 'botArmor',
26
+ icon: 'file:botarmor.svg',
27
+ group: ['transform'],
28
+ version: 1,
29
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
30
+ description: 'Crash-test your chatbot with BotArmor AI and gate a workflow on its grade',
31
+ defaults: { name: 'BotArmor' },
32
+ inputs: ['main'],
33
+ outputs: ['main'],
34
+ usableAsTool: true,
35
+ credentials: [{ name: 'botArmorApi', required: true }],
36
+ requestDefaults: {
37
+ baseURL: '={{$credentials.baseUrl}}',
38
+ headers: { Accept: 'application/json', 'Content-Type': 'application/json' },
39
+ },
40
+ properties: [
41
+ {
42
+ displayName: 'Resource',
43
+ name: 'resource',
44
+ type: 'options',
45
+ noDataExpression: true,
46
+ options: [
47
+ { name: 'Audit', value: 'audit' },
48
+ { name: 'Agent', value: 'agent' },
49
+ ],
50
+ default: 'audit',
51
+ },
52
+ // ---------------- Audit ----------------
53
+ {
54
+ displayName: 'Operation',
55
+ name: 'operation',
56
+ type: 'options',
57
+ noDataExpression: true,
58
+ displayOptions: { show: { resource: ['audit'] } },
59
+ options: [
60
+ {
61
+ name: 'Start',
62
+ value: 'start',
63
+ action: 'Start an audit',
64
+ description: 'Start a live audit of a registered agent (takes 10 to 20 minutes)',
65
+ routing: { request: { method: 'POST', url: '/api/audits' } },
66
+ },
67
+ {
68
+ name: 'Retest',
69
+ value: 'retest',
70
+ action: 'Retest after patches',
71
+ description: 'Re-run a finished audit with the patched prompt; the report shows before/after',
72
+ routing: { request: { method: 'POST', url: '=/api/audits/{{$parameter["auditCode"]}}/retest' } },
73
+ },
74
+ {
75
+ name: 'Get Status',
76
+ value: 'getStatus',
77
+ action: 'Get the status and grade of an audit',
78
+ description: 'Status (running, completed, failed), grade and whether it meets your threshold',
79
+ routing: { request: { method: 'GET', url: '=/api/audits/{{$parameter["auditCode"]}}/status' } },
80
+ },
81
+ {
82
+ name: 'Get Many',
83
+ value: 'getAll',
84
+ action: 'List audits',
85
+ routing: {
86
+ request: { method: 'GET', url: '/api/audits' },
87
+ output: { postReceive: [{ type: 'rootProperty', properties: { property: 'audits' } }] },
88
+ },
89
+ },
90
+ {
91
+ name: 'Verify Report',
92
+ value: 'verify',
93
+ action: 'Verify a report',
94
+ description: 'Check that a report is authentic and still current (public, signed, anchored)',
95
+ routing: { request: { method: 'GET', url: '=/verify/{{$parameter["auditCode"]}}?format=json' } },
96
+ },
97
+ ],
98
+ default: 'start',
99
+ },
100
+ {
101
+ displayName: 'Agent ID',
102
+ name: 'agentId',
103
+ type: 'string',
104
+ required: true,
105
+ default: '',
106
+ description: 'ID of the agent registered in BotArmor (Agent > Get Many lists them)',
107
+ displayOptions: { show: { resource: ['audit'], operation: ['start'] } },
108
+ routing: { send: { type: 'body', property: 'agent_id' } },
109
+ },
110
+ {
111
+ displayName: 'Audit Code',
112
+ name: 'auditCode',
113
+ type: 'string',
114
+ required: true,
115
+ default: '',
116
+ placeholder: 'BA-XXXXXXXX',
117
+ displayOptions: { show: { resource: ['audit'], operation: ['retest', 'getStatus', 'verify'] } },
118
+ },
119
+ {
120
+ displayName: 'System Prompt',
121
+ name: 'systemPrompt',
122
+ type: 'string',
123
+ typeOptions: { rows: 6 },
124
+ required: true,
125
+ default: '',
126
+ description: "Your bot's instructions, used as the judge's rulebook. BotArmor stores only its SHA-256.",
127
+ displayOptions: { show: { resource: ['audit'], operation: ['start', 'retest'] } },
128
+ routing: { send: { type: 'body', property: 'system_prompt' } },
129
+ },
130
+ {
131
+ displayName: 'Knowledge Base',
132
+ name: 'knowledgeBase',
133
+ type: 'string',
134
+ typeOptions: { rows: 3 },
135
+ default: '',
136
+ description: 'Price list, opening hours… (optional)',
137
+ displayOptions: { show: { resource: ['audit'], operation: ['start', 'retest'] } },
138
+ routing: { send: { type: 'body', property: 'knowledge_base' } },
139
+ },
140
+ {
141
+ displayName: 'I Own This Agent or Have Written Permission to Test It',
142
+ name: 'authorizationConfirmed',
143
+ type: 'boolean',
144
+ required: true,
145
+ default: false,
146
+ description: AUTHORIZATION,
147
+ displayOptions: { show: { resource: ['audit'], operation: ['start', 'retest'] } },
148
+ routing: { send: { type: 'body', property: 'authorization_confirmed' } },
149
+ },
150
+ {
151
+ displayName: 'Options',
152
+ name: 'options',
153
+ type: 'collection',
154
+ placeholder: 'Add Option',
155
+ default: {},
156
+ displayOptions: { show: { resource: ['audit'], operation: ['start'] } },
157
+ options: [
158
+ {
159
+ displayName: 'Scenarios',
160
+ name: 'levels',
161
+ type: 'multiOptions',
162
+ options: LEVELS,
163
+ default: [],
164
+ description: 'Attack scenarios to run (all when empty)',
165
+ routing: { send: { type: 'body', property: 'levels' } },
166
+ },
167
+ {
168
+ displayName: 'Report Language',
169
+ name: 'lang',
170
+ type: 'options',
171
+ options: [
172
+ { name: 'English', value: 'en' },
173
+ { name: 'French', value: 'fr' },
174
+ { name: 'German', value: 'de' },
175
+ { name: 'Spanish', value: 'es' },
176
+ ],
177
+ default: 'fr',
178
+ description: 'Language of the report, for whoever reads it',
179
+ routing: { send: { type: 'body', property: 'lang' } },
180
+ },
181
+ {
182
+ displayName: 'Bot Language',
183
+ name: 'botLang',
184
+ type: 'options',
185
+ options: [
186
+ { name: 'Detect From the Prompt', value: '' },
187
+ { name: 'Dutch', value: 'nl' },
188
+ { name: 'English', value: 'en' },
189
+ { name: 'French', value: 'fr' },
190
+ { name: 'German', value: 'de' },
191
+ { name: 'Italian', value: 'it' },
192
+ { name: 'Portuguese', value: 'pt' },
193
+ { name: 'Spanish', value: 'es' },
194
+ ],
195
+ default: '',
196
+ description: 'Language the attacker speaks to your bot. Can differ from the report language.',
197
+ routing: { send: { type: 'body', property: 'bot_lang' } },
198
+ },
199
+ {
200
+ displayName: 'Test Google Sheet ID',
201
+ name: 'spreadsheetId',
202
+ type: 'string',
203
+ default: '',
204
+ description: 'A TEST sheet shared with the BotArmor service account as Editor; checks what the bot writes',
205
+ routing: { send: { type: 'body', property: 'backend.spreadsheet_id' } },
206
+ },
207
+ {
208
+ displayName: 'Test Sheet Range',
209
+ name: 'range',
210
+ type: 'string',
211
+ default: 'Sheet1!A1:H',
212
+ routing: { send: { type: 'body', property: 'backend.range' } },
213
+ },
214
+ ],
215
+ },
216
+ {
217
+ displayName: 'Minimum Grade',
218
+ name: 'minGrade',
219
+ type: 'options',
220
+ options: ['A', 'B', 'C', 'D', 'F'].map((g) => ({ name: g, value: g })),
221
+ default: 'B',
222
+ description: 'Threshold for gate.passed',
223
+ displayOptions: { show: { resource: ['audit'], operation: ['getStatus'] } },
224
+ routing: { send: { type: 'query', property: 'min_grade' } },
225
+ },
226
+ {
227
+ displayName: 'Fail When Below Threshold',
228
+ name: 'strict',
229
+ type: 'boolean',
230
+ default: false,
231
+ description: 'Whether to make the node error (HTTP 412) when a finished audit is below the minimum grade, stopping the workflow',
232
+ displayOptions: { show: { resource: ['audit'], operation: ['getStatus'] } },
233
+ routing: { send: { type: 'query', property: 'strict', value: '={{$value ? 1 : 0}}' } },
234
+ },
235
+ // ---------------- Agent ----------------
236
+ {
237
+ displayName: 'Operation',
238
+ name: 'operation',
239
+ type: 'options',
240
+ noDataExpression: true,
241
+ displayOptions: { show: { resource: ['agent'] } },
242
+ options: [
243
+ {
244
+ name: 'Get Many',
245
+ value: 'getAll',
246
+ action: 'List agents',
247
+ routing: {
248
+ request: { method: 'GET', url: '/api/agents' },
249
+ output: { postReceive: [{ type: 'rootProperty', properties: { property: 'agents' } }] },
250
+ },
251
+ },
252
+ ],
253
+ default: 'getAll',
254
+ },
255
+ ],
256
+ };
257
+ }
258
+ }
259
+ exports.BotArmor = BotArmor;
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="14" fill="#22d3ee"/><path d="M32 10 14 17v13c0 12 7.7 21.3 18 24 10.3-2.7 18-12 18-24V17L32 10z" fill="#0b1120"/><text x="32" y="40" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-weight="700" font-size="16" fill="#22d3ee">BA</text></svg>
package/package.json CHANGED
@@ -1,6 +1,49 @@
1
1
  {
2
2
  "name": "n8n-nodes-botarmor",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "n8n node for BotArmor AI: crash-test your chatbot (red-teaming audit), wait for the grade and stop a workflow when it is below your threshold.",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "botarmor",
8
+ "chatbot",
9
+ "red-teaming",
10
+ "ai-security",
11
+ "audit"
12
+ ],
13
+ "license": "MIT",
14
+ "homepage": "https://github.com/sidorenkav-collab/n8n-nodes-botarmor#readme",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/sidorenkav-collab/n8n-nodes-botarmor.git"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/sidorenkav-collab/n8n-nodes-botarmor/issues"
21
+ },
22
+ "author": {
23
+ "name": "BotArmor AI"
24
+ },
25
+ "main": "index.js",
26
+ "scripts": {
27
+ "build": "tsc && node -e \"require('fs').cpSync('nodes/BotArmor/botarmor.svg','dist/nodes/BotArmor/botarmor.svg')\"",
28
+ "prepublishOnly": "npm run build"
29
+ },
30
+ "files": [
31
+ "dist"
32
+ ],
33
+ "n8n": {
34
+ "n8nNodesApiVersion": 1,
35
+ "credentials": [
36
+ "dist/credentials/BotArmorApi.credentials.js"
37
+ ],
38
+ "nodes": [
39
+ "dist/nodes/BotArmor/BotArmor.node.js"
40
+ ]
41
+ },
42
+ "devDependencies": {
43
+ "n8n-workflow": "2.16.0",
44
+ "typescript": "5.9.3"
45
+ },
46
+ "peerDependencies": {
47
+ "n8n-workflow": "*"
48
+ }
49
+ }