netzilo 4.3.17 → 5.0.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/README.md +0 -2
- package/dist/index.d.ts +0 -8
- package/dist/index.js +6 -25
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -33,7 +33,6 @@ await netzilo.start({
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
netzilo.isRunning(); // -> boolean: true once policy has synced (ready to govern)
|
|
36
|
-
netzilo.mcpGatewayPort(); // -> number: scanner gateway port in use (auto-picked)
|
|
37
36
|
const { allowed, reason } = netzilo.isAllowed("Bash", { command: "rm -rf /" });
|
|
38
37
|
netzilo.reportResult("Bash", "<stdout>"); // post-tool observability
|
|
39
38
|
netzilo.flush(); // force-deliver buffered events to management
|
|
@@ -126,7 +125,6 @@ already sanitized.
|
|
|
126
125
|
| `server` | Your Netzilo management server URL. |
|
|
127
126
|
| `pat` / `setupKey` | Credential used to enroll the agent. |
|
|
128
127
|
| `agentName` | Identifier this agent reports as (used for event attribution). |
|
|
129
|
-
| `mcpGatewayPort` | Optional; defaults to an auto-picked free port. `mcpGatewayPort: 0` disables governance. |
|
|
130
128
|
| `enableAdvancedGovernance` | Optional (default off). Deep inspection of the agent's own outbound traffic with semantic classification. |
|
|
131
129
|
| `logLevel` / `logFile` | Logging verbosity and destination. |
|
|
132
130
|
|
package/dist/index.d.ts
CHANGED
|
@@ -10,8 +10,6 @@ export interface StartOptions {
|
|
|
10
10
|
agentName?: string;
|
|
11
11
|
/** Config file path (default: ~/.netzilo-sdk/config.json). */
|
|
12
12
|
configPath?: string;
|
|
13
|
-
/** Scanner gateway port (default: an auto-picked free port). Set 0 to disable governance. */
|
|
14
|
-
mcpGatewayPort?: number;
|
|
15
13
|
/**
|
|
16
14
|
* Deep inspection of the agent's OWN outbound traffic (beyond framework
|
|
17
15
|
* hooks): full prompt/response and tool-call analysis with semantic
|
|
@@ -30,12 +28,6 @@ export interface StartOptions {
|
|
|
30
28
|
* Returns 0 on launch, 1 if already running, 2 on bad config.
|
|
31
29
|
*/
|
|
32
30
|
export declare function start(opts?: StartOptions): Promise<number>;
|
|
33
|
-
/**
|
|
34
|
-
* Port the in-process scanner (MCP) gateway is listening on. Auto-picked at
|
|
35
|
-
* start() unless one was passed explicitly. Returns 0 if not started or
|
|
36
|
-
* governance is disabled (mcpGatewayPort: 0).
|
|
37
|
-
*/
|
|
38
|
-
export declare function mcpGatewayPort(): number;
|
|
39
31
|
/** Egress port used by advanced governance. Returns 0 if not started. */
|
|
40
32
|
export declare function socks5Port(): number;
|
|
41
33
|
/**
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.DEFAULT_CONFIG_PATH = void 0;
|
|
37
37
|
exports.start = start;
|
|
38
|
-
exports.mcpGatewayPort = mcpGatewayPort;
|
|
39
38
|
exports.socks5Port = socks5Port;
|
|
40
39
|
exports.stop = stop;
|
|
41
40
|
exports.flush = flush;
|
|
@@ -75,8 +74,8 @@ const loader_1 = require("./loader");
|
|
|
75
74
|
// Default config location — callers shouldn't have to specify it.
|
|
76
75
|
exports.DEFAULT_CONFIG_PATH = path.join(os.homedir(), ".netzilo-sdk", "config.json");
|
|
77
76
|
// Ports actually used by the running client, filled in by start(). Exposed via
|
|
78
|
-
//
|
|
79
|
-
const resolvedPorts = {
|
|
77
|
+
// socks5Port() so the host can route traffic / introspect.
|
|
78
|
+
const resolvedPorts = { socks5Port: 0 };
|
|
80
79
|
// Config directory of the running client (dirname of configPath), set by
|
|
81
80
|
// start(). Used by the advanced-governance setup to locate per-install state.
|
|
82
81
|
let configDir = "";
|
|
@@ -130,20 +129,12 @@ async function start(opts = {}) {
|
|
|
130
129
|
cfg.log_level = opts.logLevel;
|
|
131
130
|
if (opts.logFile)
|
|
132
131
|
cfg.log_file = opts.logFile;
|
|
133
|
-
// Auto-pick free
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const needMcp = opts.mcpGatewayPort === undefined;
|
|
138
|
-
const needSocks = opts.socks5Port === undefined;
|
|
139
|
-
if (needMcp || needSocks) {
|
|
140
|
-
const picked = await freePorts((needMcp ? 1 : 0) + (needSocks ? 1 : 0));
|
|
141
|
-
let i = 0;
|
|
142
|
-
cfg.mcp_gateway_port = needMcp ? picked[i++] : opts.mcpGatewayPort;
|
|
143
|
-
cfg.socks5_port = needSocks ? picked[i++] : opts.socks5Port;
|
|
132
|
+
// Auto-pick a free port for the advanced-governance egress when unset, so
|
|
133
|
+
// it never collides with Netzilo.app or a second SDK process.
|
|
134
|
+
if (opts.socks5Port === undefined) {
|
|
135
|
+
cfg.socks5_port = (await freePorts(1))[0];
|
|
144
136
|
}
|
|
145
137
|
else {
|
|
146
|
-
cfg.mcp_gateway_port = opts.mcpGatewayPort;
|
|
147
138
|
cfg.socks5_port = opts.socks5Port;
|
|
148
139
|
}
|
|
149
140
|
// Advanced governance: publish the security-probe socket path BEFORE the
|
|
@@ -158,7 +149,6 @@ async function start(opts = {}) {
|
|
|
158
149
|
const lib = (0, loader_1.load)();
|
|
159
150
|
const rc = lib.Start(JSON.stringify(cfg));
|
|
160
151
|
if (rc === 0) {
|
|
161
|
-
resolvedPorts.mcpGatewayPort = cfg.mcp_gateway_port || 0;
|
|
162
152
|
resolvedPorts.socks5Port = cfg.socks5_port || 0;
|
|
163
153
|
configDir = path.dirname(cfg.config_path);
|
|
164
154
|
if (!exitHookRegistered) {
|
|
@@ -200,14 +190,6 @@ async function enableAdvancedGovernance() {
|
|
|
200
190
|
console.warn("netzilo: advanced governance setup failed:", err);
|
|
201
191
|
}
|
|
202
192
|
}
|
|
203
|
-
/**
|
|
204
|
-
* Port the in-process scanner (MCP) gateway is listening on. Auto-picked at
|
|
205
|
-
* start() unless one was passed explicitly. Returns 0 if not started or
|
|
206
|
-
* governance is disabled (mcpGatewayPort: 0).
|
|
207
|
-
*/
|
|
208
|
-
function mcpGatewayPort() {
|
|
209
|
-
return resolvedPorts.mcpGatewayPort;
|
|
210
|
-
}
|
|
211
193
|
/** Egress port used by advanced governance. Returns 0 if not started. */
|
|
212
194
|
function socks5Port() {
|
|
213
195
|
return resolvedPorts.socks5Port;
|
|
@@ -221,7 +203,6 @@ function socks5Port() {
|
|
|
221
203
|
function stop() {
|
|
222
204
|
const lib = (0, loader_1.load)();
|
|
223
205
|
const rc = lib.Stop();
|
|
224
|
-
resolvedPorts.mcpGatewayPort = 0;
|
|
225
206
|
resolvedPorts.socks5Port = 0;
|
|
226
207
|
// Undo advanced-governance traffic routing so a host process that keeps
|
|
227
208
|
// running after stop() doesn't route to the now-closed egress port.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netzilo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Netzilo AI Detection & Response (AIDR) — governance for Node.js/TypeScript AI agents.",
|
|
5
5
|
"license": "Commercial",
|
|
6
6
|
"author": "Netzilo",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"koffi": "^2.9.0"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"netzilo-darwin-arm64": "
|
|
39
|
-
"netzilo-darwin-x64": "
|
|
40
|
-
"netzilo-linux-arm64": "
|
|
41
|
-
"netzilo-linux-x64": "
|
|
42
|
-
"netzilo-windows-x64": "
|
|
38
|
+
"netzilo-darwin-arm64": "5.0.0",
|
|
39
|
+
"netzilo-darwin-x64": "5.0.0",
|
|
40
|
+
"netzilo-linux-arm64": "5.0.0",
|
|
41
|
+
"netzilo-linux-x64": "5.0.0",
|
|
42
|
+
"netzilo-windows-x64": "5.0.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"undici": "^8.5.0"
|