network-ai 5.8.0 → 5.8.2

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.
@@ -564,4 +564,4 @@ Run these before declaring the integration production-ready:
564
564
 
565
565
  ---
566
566
 
567
- *Network-AI v5.8.0 · MIT License · https://github.com/Jovancoding/Network-AI*
567
+ *Network-AI v5.8.2 · MIT License · https://github.com/Jovancoding/Network-AI*
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![Website](https://img.shields.io/badge/website-network--ai.org-4b9df2?style=flat&logo=web&logoColor=white)](https://network-ai.org/)
6
6
  [![CI](https://github.com/Jovancoding/Network-AI/actions/workflows/ci.yml/badge.svg)](https://github.com/Jovancoding/Network-AI/actions/workflows/ci.yml)
7
7
  [![CodeQL](https://github.com/Jovancoding/Network-AI/actions/workflows/codeql.yml/badge.svg)](https://github.com/Jovancoding/Network-AI/actions/workflows/codeql.yml)
8
- [![Release](https://img.shields.io/badge/release-v5.8.0-blue.svg)](https://github.com/Jovancoding/Network-AI/releases)
8
+ [![Release](https://img.shields.io/badge/release-v5.8.2-blue.svg)](https://github.com/Jovancoding/Network-AI/releases)
9
9
  [![npm](https://img.shields.io/npm/dw/network-ai.svg?label=npm%20downloads)](https://www.npmjs.com/package/network-ai)
10
10
  [![Tests](https://img.shields.io/badge/tests-3136%20passing-brightgreen.svg)](#testing)
11
11
  [![Adapters](https://img.shields.io/badge/frameworks-29%20supported-blueviolet.svg)](#adapter-system)
package/SKILL.md CHANGED
@@ -1,12 +1,22 @@
1
1
  ---
2
2
  name: network-ai
3
- description: "Local Python orchestration skill: multi-agent workflows via shared blackboard file, permission gating, token budget scripts, and persistent project context. All bundled scripts run locally with zero network calls and zero third-party dependencies."
3
+ description: "Local Python orchestration skill: multi-agent workflows via shared blackboard file, permission gating, token budget scripts, and persistent project context. All bundled Python scripts run locally with zero network calls. The full npm package (npm install network-ai) additionally ships a TypeScript library, CLI, and an optional operator-started MCP SSE server that binds a TCP port."
4
4
  metadata:
5
5
  openclaw:
6
6
  emoji: "\U0001F41D"
7
7
  homepage: https://network-ai.org
8
- bundle_scope: "Python scripts only (scripts/*.py). All execution is local. Only Python stdlib — no other runtimes, adapters, or CLI tools are included."
9
- network_calls: "nonebundled scripts make zero network calls and spawn no subprocesses."
8
+ capabilities:
9
+ filesystem: "read/writedata/ directory only (blackboard state, audit log, active_grants.json, project-context.json). No access outside the data/ subtree."
10
+ env_vars: "read — NETWORK_AI_ENV (environment routing), NETWORK_AI_MCP_SECRET (MCP bearer auth), NETWORK_AI_MINIMAL (minimal-mode flag). No env vars are written."
11
+ shell_exec: "optional — AgentRuntime (lib/agent-runtime.ts) with SandboxPolicy and ApprovalGate; disabled by default. Never auto-enabled by this skill. auto_approve must NOT be set in production (see auto_approve_warning below)."
12
+ tcp_port: "optional — MCP SSE server (bin/mcp-server.ts) binds 127.0.0.1 only when explicitly started by the operator. Requires a non-empty bearer-token secret. Never auto-started by this skill or any bundled Python script."
13
+ bundle_scope:
14
+ clawhub_python_scripts: "Python stdlib only — scripts/*.py (blackboard.py, check_permission.py, context_manager.py, swarm_guard.py, token_manager.py, check_context.py). Zero network calls, zero subprocesses, zero third-party packages. This is the scope scanned by SkillSpector."
15
+ npm_full_package: "The npm package (npm install network-ai) adds: TypeScript library modules, CLI (bin/cli.ts), and optional MCP SSE server (bin/mcp-server.ts). The MCP SSE server exposes a TCP port and is NOT activated by installing or importing the package — it must be explicitly started by the operator."
16
+ network_calls:
17
+ python_scripts: none
18
+ typescript_library: "none — BYOC (bring your own client); zero outbound calls from library code; all LLM/API clients are injected by the caller"
19
+ mcp_sse_server: "optional — binds 127.0.0.1:<port> when explicitly started by the operator; all connections require a bearer-token secret (NETWORK_AI_MCP_SECRET); never auto-started"
10
20
  inter_agent_comms: "none — this skill does not implement, invoke, or control inter-agent messaging or sessions_send. All coordination is via local file-based blackboard only."
11
21
  sessions_send: "NOT implemented or invoked by this skill. sessions_send is a host-platform built-in entirely outside this skill's control. See data-flow notice below."
12
22
  sessions_ops: "platform-provided — outside this skill's control"
@@ -20,12 +30,13 @@ metadata:
20
30
  path: data/audit_log.jsonl
21
31
  scope: local-only
22
32
  description: "Local append-only JSONL file recording operation metadata. No data leaves the machine."
23
- pii_warning: "Do not include PII, secrets, or credentials in justification fields. Log entries persist on disk."
33
+ pii_warning: "Do not include PII, secrets, or credentials in justification fields. Log entries persist on disk. Grant tokens are masked to a short prefix in all listing outputs; full tokens appear only at issuance time."
24
34
  data_directory:
25
35
  path: data/
26
36
  scope: local-only
27
37
  files: ["audit_log.jsonl", "active_grants.json", "project-context.json"]
28
38
  description: "All persistent state is local-only. No files are transmitted over the network."
39
+ auto_approve_warning: "ApprovalGate.auto_approve (lib/agent-runtime.ts) must NOT be enabled in production or untrusted environments. It is only appropriate in explicitly isolated CI/dev sandboxes where all commands executed by the runtime are known and trusted in advance."
29
40
  ---
30
41
 
31
42
  # Swarm Orchestrator Skill
@@ -713,7 +724,7 @@ The following findings are drawn from the **MAESTRO Agent Security Threat** fram
713
724
 
714
725
  | Control | How Network-AI addresses it |
715
726
  |---|---|
716
- | **Permission manifest** | `metadata.openclaw` in SKILL.md frontmatter explicitly declares `bundle_scope: "Python scripts only"`, `network_calls: none`, `requires.bins: [python3]` — no shell tools, no API credentials, no external services |
727
+ | **Permission manifest** | `metadata.openclaw` in SKILL.md frontmatter explicitly declares `bundle_scope` (Python scripts: local-only; full npm package: includes optional MCP SSE server), `network_calls` (Python scripts: none; MCP SSE server: TCP, operator-started, bearer-token required), `requires.bins: [python3]` — no API credentials, no external services in core |
717
728
  | **Least-privilege resource gating** | `check_permission.py` uses a weighted scoring model (justification 40 %, trust 30 %, risk 30 %); PAYMENTS and FILE_EXPORT require `--confirm-high-risk` acknowledgment before any token is issued; `--scope` limits every grant to minimum required access |
718
729
  | **Abstract resource labels only** | PAYMENTS, DATABASE, EMAIL, FILE_EXPORT are local scoring labels — no external credentials exist in the skill; there is nothing to leak to an external service |
719
730
  | **HMAC-signed grant tokens** | Since v5.5.2, every grant record carries `_sig` (HMAC-SHA256 over canonical fields); `validate_token.py` rejects tampered records — privilege escalation via forged grants is detected at validation time |
@@ -726,7 +737,7 @@ The following findings are drawn from the **MAESTRO Agent Security Threat** fram
726
737
 
727
738
  | Control | How Network-AI addresses it |
728
739
  |---|---|
729
- | **Zero network calls, zero subprocesses** | All bundled Python scripts use Python stdlib only, spawn no subprocesses, and make no network calls — declared in `metadata.openclaw.network_calls: none` and `bundle_scope`; enforceable by platform inspection |
740
+ | **Zero network calls (Python scripts)** | All bundled Python scripts use Python stdlib only, spawn no subprocesses, and make no network calls — declared in `metadata.openclaw.network_calls` and `bundle_scope`. The optional MCP SSE server (`bin/mcp-server.ts`) binds a TCP port only when explicitly started by the operator and requires a non-empty bearer-token secret. |
730
741
  | **AgentRuntime sandbox** | `ShellExecutor` enforces per-command timeout and output-size limits; `SandboxPolicy` allowlist/blocklist prevents unapproved shell commands from running at all |
731
742
  | **Source protection** | `SandboxPolicy.sourceProtection` constrains `FileAccessor.read/write/list` to `data/<env>/` only; any attempt to read outside that boundary throws `SourceProtectionError` — the agent receives `{success: false}`, no path details leak |
732
743
  | **Environment isolation** | `NETWORK_AI_ENV` / `--env` routes all state to `data/<env>/`; dev, staging, and production state are fully separated; live state (`audit_log.jsonl`, `active_grants.json`) never promotes across environments |
@@ -739,7 +750,7 @@ The following findings are drawn from the **MAESTRO Agent Security Threat** fram
739
750
 
740
751
  | Control | How Network-AI addresses it |
741
752
  |---|---|
742
- | **Exact version pinning** | npm `package.json` uses exact `"version": "5.8.0"` — no semver range specifiers; `clawhub install network-ai` pins to a specific published version |
753
+ | **Exact version pinning** | npm `package.json` uses exact `"version": "5.8.2"` — no semver range specifiers; `clawhub install network-ai` pins to a specific published version |
743
754
  | **Zero transitive dependency drift** | All bundled Python scripts use Python stdlib only — `pip install` is never required; there are no third-party packages to drift, be compromised upstream, or introduce CVEs |
744
755
  | **Signed, tagged releases** | Every release is committed with a signed Git tag (`v5.7.x`); commit hash is verifiable against CHANGELOG.md; GitHub releases link tag → diff → changelog entry |
745
756
  | **Supply chain monitoring** | npm package continuously scored by Socket.dev (score A); any new dependency or permission change triggers an alert |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "network-ai",
3
- "version": "5.8.0",
3
+ "version": "5.8.2",
4
4
  "description": "AI agent orchestration framework for TypeScript/Node.js - 29 adapters (LangChain, AutoGen, CrewAI, OpenAI Assistants, LlamaIndex, Semantic Kernel, Haystack, DSPy, Agno, MCP, OpenClaw, A2A, Codex, MiniMax, NemoClaw, APS, Copilot, LangGraph, Anthropic Computer Use, OpenAI Agents SDK, Vertex AI, Pydantic AI, Browser Agent, Hermes, Orchestrator, RLM + streaming variants). Built-in CLI, security, swarm intelligence, real-time streaming, and agentic workflow patterns.",
5
5
  "homepage": "https://network-ai.org",
6
6
  "main": "dist/index.js",
@@ -7,6 +7,12 @@
7
7
  # data[/<env>]/.signing_key (on first run only; chmod 0o600)
8
8
  # Imports used: argparse, json, re, sys, uuid, hmac, hashlib, datetime, pathlib, typing
9
9
  # No imports of: requests, socket, subprocess, urllib, http, ssl, ftplib, smtplib
10
+ #
11
+ # SECURITY: Justification strings supplied via --justification are logged verbatim
12
+ # to data/audit_log.jsonl. Do NOT include PII, credentials, secret names, API keys,
13
+ # or other sensitive business data in justification fields. Treat justifications as
14
+ # permanently visible log entries. Grant tokens are only shown at issuance time;
15
+ # listing commands (--active-grants) always mask tokens to a short prefix.
10
16
  """
11
17
  AuthGuardian Permission Checker
12
18
 
@@ -551,7 +557,6 @@ def list_active_grants(agent_filter: Optional[str] = None, as_json: bool = False
551
557
 
552
558
  active.append({
553
559
  "token": token[:16] + "..." if len(token) > 16 else token,
554
- "token_full": token,
555
560
  "agent_id": grant.get("agent_id", "unknown"),
556
561
  "resource_type": grant.get("resource_type", "unknown"),
557
562
  "scope": grant.get("scope"),
@@ -565,7 +570,7 @@ def list_active_grants(agent_filter: Optional[str] = None, as_json: bool = False
565
570
  active.sort(key=lambda g: g["expires_at"])
566
571
 
567
572
  if as_json:
568
- # In JSON mode, include full tokens
573
+ # Token values are masked (prefix only) — never emit full live tokens in output.
569
574
  output: dict[str, Any] = {
570
575
  "grants": active,
571
576
  "total": len(active),
@@ -21,7 +21,7 @@ THE 3-LAYER MEMORY MODEL
21
21
  Usage:
22
22
  python context_manager.py init --name "MyProject" [--description "..."] [--version "1.0.0"]
23
23
  python context_manager.py show
24
- python context_manager.py inject
24
+ python context_manager.py inject [--force]
25
25
  python context_manager.py update --section decisions --add '{"decision": "...", "rationale": "..."}'
26
26
  python context_manager.py update --section milestones --complete "task name"
27
27
  python context_manager.py update --section milestones --add '{"planned": "task name"}'
@@ -33,7 +33,8 @@ Examples:
33
33
  python context_manager.py init --name "Network-AI" --description "Multi-agent swarm framework" --version "4.5.0"
34
34
  python context_manager.py update --section decisions --add '{"decision": "Use atomic blackboard commits", "rationale": "Prevent race conditions"}'
35
35
  python context_manager.py update --section milestones --complete "v4.4.3 ClawHub clean-scan"
36
- python context_manager.py inject
36
+ python context_manager.py inject # blocked if context has prompt-injection patterns
37
+ python context_manager.py inject --force # override block (trusted/CI environments only)
37
38
  """
38
39
 
39
40
  import argparse
@@ -214,7 +215,7 @@ def cmd_show(args: argparse.Namespace) -> int: # noqa: ARG001
214
215
  return 0
215
216
 
216
217
 
217
- def cmd_inject(args: argparse.Namespace) -> int: # noqa: ARG001
218
+ def cmd_inject(args: argparse.Namespace) -> int:
218
219
  """Print a formatted block suitable for injection into an agent system prompt."""
219
220
  ctx = _load()
220
221
  warnings = _validate_context(ctx)
@@ -222,7 +223,14 @@ def cmd_inject(args: argparse.Namespace) -> int: # noqa: ARG001
222
223
  print("[context_manager] VALIDATION WARNINGS \u2014 context has potential issues:", file=sys.stderr)
223
224
  for w in warnings:
224
225
  print(f" ! {w}", file=sys.stderr)
225
- print("[context_manager] Proceeding with inject, but review warnings above.", file=sys.stderr)
226
+ if not getattr(args, "force", False):
227
+ print(
228
+ "[context_manager] ERROR: Injection blocked. Context contains potential prompt-injection "
229
+ "content. Use --force to override (only in trusted, controlled environments).",
230
+ file=sys.stderr,
231
+ )
232
+ return 1
233
+ print("[context_manager] --force: proceeding with inject despite warnings.", file=sys.stderr)
226
234
  p = ctx.get("project", {})
227
235
 
228
236
  lines: list[str] = []
@@ -390,7 +398,12 @@ def build_parser() -> argparse.ArgumentParser:
390
398
  sub.add_parser("show", help="Print the full context as JSON")
391
399
 
392
400
  # inject
393
- sub.add_parser("inject", help="Print formatted context for agent system-prompt injection")
401
+ p_inject = sub.add_parser("inject", help="Print formatted context for agent system-prompt injection")
402
+ p_inject.add_argument(
403
+ "--force",
404
+ action="store_true",
405
+ help="Proceed with injection even when validation warnings are present (prompt-injection risk — only use in trusted environments)",
406
+ )
394
407
 
395
408
  # update
396
409
  p_update = sub.add_parser("update", help="Update a specific context section")
@@ -1,8 +1,13 @@
1
1
  #!/usr/bin/env python3
2
2
  # SECURITY: This script makes NO network calls and spawns NO subprocesses.
3
- # All I/O is local file operations only:
4
- # READS: data/swarm_budgets.json, data/heartbeats.json, data/audit_log.jsonl
5
- # WRITES: data/swarm_budgets.json, data/heartbeats.json, data/audit_log.jsonl
3
+ # All I/O is local file operations only.
4
+ # Base data directory is data/ (root) or data/<env>/ when NETWORK_AI_ENV or --env is set.
5
+ # READS: <data_dir>/swarm_budgets.json, <data_dir>/heartbeats.json,
6
+ # <data_dir>/audit_log.jsonl, <data_dir>/task_tracking.json,
7
+ # <data_dir>/agent_health.json, <data_dir>/budget_tracking.json
8
+ # WRITES: <data_dir>/swarm_budgets.json, <data_dir>/heartbeats.json,
9
+ # <data_dir>/audit_log.jsonl, <data_dir>/task_tracking.json,
10
+ # <data_dir>/agent_health.json, <data_dir>/budget_tracking.json
6
11
  # Imports used: argparse, json, os, sys, datetime, pathlib, typing
7
12
  # No imports of: requests, socket, subprocess, urllib, http, ssl, ftplib, smtplib
8
13
  """