@aporthq/aport-agent-guardrails 1.0.28 → 1.0.29

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
@@ -96,6 +96,7 @@ npx --yes @aporthq/aport-agent-guardrails claude-code --non-interactive
96
96
 
97
97
  - **I need OpenClaw now:** [docs/QUICKSTART_OPENCLAW_PLUGIN.md](docs/QUICKSTART_OPENCLAW_PLUGIN.md)
98
98
  - **I already have agent_id:** [docs/HOSTED_PASSPORT_SETUP.md](docs/HOSTED_PASSPORT_SETUP.md)
99
+ - **I’m deploying for an IT team:** [docs/ENTERPRISE_DEVICE_DEPLOYMENT.md](docs/ENTERPRISE_DEVICE_DEPLOYMENT.md)
99
100
  - **I need framework setup docs:** [docs/frameworks](docs/frameworks)
100
101
  - **I want Claude marketplace install:** [docs/frameworks/claude-code.md](docs/frameworks/claude-code.md#marketplace-install-claude-plugins)
101
102
 
@@ -118,7 +119,7 @@ The security concern is that agent tools and skills can execute sensitive action
118
119
 
119
120
  **Two ways to use APort:** (1) **Guardrails (CLI/setup)** — run the installer to create your passport and config; (2) **Core (library)** — use the `OAPGuardrailProvider` ([docs/PROVIDER.md](docs/PROVIDER.md)) in your app so each tool call is verified. One provider per language (Python + TypeScript), works with any framework. Framework docs: [OpenClaw](docs/frameworks/openclaw.md), [Cursor](docs/frameworks/cursor.md), [Claude Code](docs/frameworks/claude-code.md), [LangChain](docs/frameworks/langchain.md), [CrewAI](docs/frameworks/crewai.md), [DeerFlow](docs/frameworks/deerflow.md), [n8n](docs/frameworks/n8n.md).
120
121
 
121
- **CLI-supported frameworks:** `openclaw`, `langchain`, `crewai`, `cursor`, `claude-code`, `deerflow`, `n8n`. OpenClaw/Cursor/Claude Code include runtime-specific integration scripts; DeerFlow/LangChain/CrewAI use framework docs plus generic setup output from the CLI. See [Deployment readiness](docs/DEPLOYMENT_READINESS.md).
122
+ **CLI-supported frameworks:** `openclaw`, `langchain`, `crewai`, `cursor`, `claude-code`, `deerflow`, `n8n`. OpenClaw/Cursor/Claude Code include runtime-specific integration scripts; DeerFlow/LangChain/CrewAI use framework docs plus generic setup output from the CLI. For IT-managed device rollout, see [Enterprise device deployment](docs/ENTERPRISE_DEVICE_DEPLOYMENT.md).
122
123
 
123
124
  | Framework | Doc | Integration | Install |
124
125
  |-----------|-----|--------------|--------|
@@ -48,7 +48,11 @@ while [[ ${#remaining_args[@]} -gt 0 ]]; do
48
48
  crewai_integration_mode="${remaining_args[0]}"
49
49
  remaining_args=("${remaining_args[@]:1}")
50
50
  ;;
51
- ap_[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])
51
+ ap_* | apt_* | agt_inst_* | agt_tmpl_*)
52
+ if ! is_aport_hosted_agent_id "$arg"; then
53
+ log_error "Invalid hosted passport ID format: $arg"
54
+ exit 1
55
+ fi
52
56
  hosted_agent_id="$arg"
53
57
  ;;
54
58
  *)
@@ -5,6 +5,10 @@
5
5
 
6
6
  DEFAULT_APORT_API_URL="${DEFAULT_APORT_API_URL:-https://api.aport.io}"
7
7
 
8
+ is_aport_hosted_agent_id() {
9
+ [[ "${1:-}" =~ ^(ap|apt|agt_inst|agt_tmpl)_[A-Za-z0-9_-]+$ ]]
10
+ }
11
+
8
12
  parse_guardrail_mode_args() {
9
13
  APORT_GUARDRAIL_MODE_CLI="${APORT_GUARDRAIL_MODE_CLI:-}"
10
14
  APORT_GUARDRAIL_API_URL_CLI="${APORT_GUARDRAIL_API_URL_CLI:-}"
@@ -66,7 +70,11 @@ parse_guardrail_mode_args() {
66
70
  APORT_ISSUE_URL_CLI="$2"
67
71
  shift
68
72
  ;;
69
- ap_[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])
73
+ ap_* | apt_* | agt_inst_* | agt_tmpl_*)
74
+ if ! is_aport_hosted_agent_id "$1"; then
75
+ echo "[aport] ERROR: Invalid hosted passport ID format: $1" >&2
76
+ return 1
77
+ fi
70
78
  APORT_HOSTED_AGENT_ID_CLI="$1"
71
79
  ;;
72
80
  *)
package/bin/openclaw CHANGED
@@ -126,12 +126,12 @@ if [ -n "${1:-}" ]; then
126
126
  echo "See: https://github.com/aporthq/aport-agent-guardrails/tree/main/docs"
127
127
  exit 0
128
128
  fi
129
- # Validate agent_id format (ap_ followed by 32 hex chars)
130
- if [[ "$1" =~ ^ap_[a-f0-9]{32}$ ]]; then
129
+ # Validate agent_id format.
130
+ if [[ "$1" =~ ^(ap|apt|agt_inst|agt_tmpl)_[A-Za-z0-9_-]+$ ]]; then
131
131
  HOSTED_AGENT_ID="$1"
132
132
  else
133
133
  echo "❌ Invalid agent_id format: $1"
134
- echo " Expected: ap_[32 hex characters]"
134
+ echo " Expected: ap_..., apt_..., agt_inst_..., or agt_tmpl_..."
135
135
  echo " Example: ap_fa2f6d53bb5b4c98b9af0124285b6e0f"
136
136
  echo ""
137
137
  echo "Run '$0 --help' for usage information."
@@ -0,0 +1,153 @@
1
+ # Enterprise Device Deployment
2
+
3
+ Use this guide when an IT team wants to deploy APort guardrails to one or many developer machines through a device-management tool, remote shell, or manual test run.
4
+
5
+ The deployment scripts are generic. They work for MDM tools, endpoint-management tools, remote shell runners, or a saved script executed by an administrator.
6
+
7
+ ## What Gets Installed
8
+
9
+ The deploy script:
10
+
11
+ 1. Identifies the target device and user.
12
+ 2. Reuses an existing passport instance for that device when one already exists.
13
+ 3. Creates a new instance from the template passport only when needed.
14
+ 4. Mints a narrow runtime setup key for that instance.
15
+ 5. Runs `npx @aporthq/aport-agent-guardrails <framework> <agent_id> --mode=api`.
16
+ 6. Writes the framework hook/config for the target user.
17
+
18
+ The org enrollment key is not stored for runtime. Hooks use the minted runtime key.
19
+
20
+ ## Requirements
21
+
22
+ Each target device needs:
23
+
24
+ - Node.js 18+
25
+ - npm/npx
26
+ - curl
27
+ - The target agent framework installed or available to the developer, for example Claude Code or Cursor
28
+
29
+ APort setup requires:
30
+
31
+ - A template passport in the APort org.
32
+ - An org API key with `issue` scope. Use the narrowest key available; do not use a broad admin key.
33
+ - The framework name, for example `claude-code` or `cursor`.
34
+
35
+ ## Recommended First Test
36
+
37
+ Run the deploy script on one developer test machine first.
38
+
39
+ ```bash
40
+ export APORT_API_KEY="apk_..."
41
+ export APORT_TEMPLATE_ID="ap_..."
42
+ export APORT_FRAMEWORK="claude-code"
43
+
44
+ curl -fsSL "https://api.aport.io/enterprise/scripts/deploy?version=1.0.29" | bash
45
+ ```
46
+
47
+ If the script runs as `root`, set the developer account explicitly:
48
+
49
+ ```bash
50
+ export APORT_TARGET_USER="developer"
51
+ export APORT_TARGET_HOME="/Users/developer"
52
+ ```
53
+
54
+ For Linux, `APORT_TARGET_HOME` is usually `/home/<user>`.
55
+
56
+ ## Script Commands
57
+
58
+ | Command | URL | Purpose |
59
+ | --- | --- | --- |
60
+ | Deploy | `https://api.aport.io/enterprise/scripts/deploy?version=1.0.29` | Initial install or repair |
61
+ | Enforce | `https://api.aport.io/enterprise/scripts/enforce?version=1.0.29` | Validate state and reinstall if the hook/config is missing |
62
+ | Uninstall | `https://api.aport.io/enterprise/scripts/uninstall?version=1.0.29` | Remove APort-owned wiring and local state |
63
+
64
+ Use `deploy` for the first test. Use `enforce` as the recurring compliance script. Use `uninstall` only for approved removal.
65
+
66
+ ## Configuration Variables
67
+
68
+ | Variable | Required | Description |
69
+ | --- | --- | --- |
70
+ | `APORT_API_KEY` | Deploy/enforce | Org enrollment key with `issue` scope |
71
+ | `APORT_TEMPLATE_ID` | Deploy/enforce | Template passport ID to instantiate per device/user |
72
+ | `APORT_FRAMEWORK` | All | `claude-code`, `cursor`, `openclaw`, `langchain`, `crewai`, `deerflow`, or `n8n` |
73
+ | `APORT_API_URL` | No | Defaults to `https://api.aport.io` |
74
+ | `APORT_TARGET_USER` | No | Developer account that runs the agent framework |
75
+ | `APORT_TARGET_HOME` | No | Home/profile directory for the target user |
76
+ | `APORT_DEVICE_ID` | No | Stable device identifier; auto-detected when unset |
77
+ | `APORT_STATE_DIR` | No | Override local system state directory |
78
+ | `DISABLE_DEVICE_INFO` | No | Set to `1` to skip device metadata collection |
79
+
80
+ ## How Device Identity Works
81
+
82
+ The script derives a stable `tenant_ref` from:
83
+
84
+ - device ID
85
+ - target username
86
+ - framework
87
+ - template passport ID
88
+
89
+ This prevents duplicate passport instances when the deploy or enforce script runs again on the same device for the same user/framework/template.
90
+
91
+ Device ID is auto-detected from:
92
+
93
+ - macOS: hardware serial number
94
+ - Linux: machine ID
95
+ - Windows: BIOS serial number
96
+ - fallback: hostname
97
+
98
+ Set `APORT_DEVICE_ID` if the device-management system has a stronger stable identifier.
99
+
100
+ ## Verify The Install
101
+
102
+ After deploy:
103
+
104
+ 1. Open APort and switch to the org context.
105
+ 2. Open the template passport.
106
+ 3. Confirm an instance exists for the test device.
107
+ 4. Ask the developer to run a normal Claude Code or Cursor task.
108
+ 5. Confirm allow/deny decisions appear in APort audit.
109
+
110
+ For a pilot, use a test repository and prompts that exercise both normal developer actions and blocked actions, for example safe repo inspection, test execution, destructive cleanup, privileged commands, and sensitive file reads.
111
+
112
+ ## Enforcement Script
113
+
114
+ Run this as the recurring compliance check:
115
+
116
+ ```bash
117
+ export APORT_API_KEY="apk_..."
118
+ export APORT_TEMPLATE_ID="ap_..."
119
+ export APORT_FRAMEWORK="claude-code"
120
+
121
+ curl -fsSL "https://api.aport.io/enterprise/scripts/enforce?version=1.0.29" | bash
122
+ ```
123
+
124
+ `enforce` reuses existing local state when present. If the framework hook/config is missing, it reinstalls without creating a duplicate passport instance.
125
+
126
+ ## Uninstall
127
+
128
+ Use only for approved removal:
129
+
130
+ ```bash
131
+ export APORT_FRAMEWORK="claude-code"
132
+
133
+ curl -fsSL "https://api.aport.io/enterprise/scripts/uninstall?version=1.0.29" | bash
134
+ ```
135
+
136
+ Uninstall removes APort-owned framework wiring and local APort state for the selected framework. It does not delete the passport or audit records from APort.
137
+
138
+ ## Auditable Download
139
+
140
+ For stricter change-control, fetch the manifest and verify the script hash before execution:
141
+
142
+ ```bash
143
+ curl -fsSL "https://api.aport.io/enterprise/scripts?version=1.0.29"
144
+ curl -fsSL "https://api.aport.io/enterprise/scripts/deploy?version=1.0.29" -o /tmp/aport-deploy.sh
145
+ shasum -a 256 /tmp/aport-deploy.sh
146
+ bash /tmp/aport-deploy.sh
147
+ ```
148
+
149
+ Compare the `shasum` output to the manifest’s `sha256` value.
150
+
151
+ ## More Detail
152
+
153
+ The source scripts and implementation notes are in [`enterprise-scripts/README.md`](../enterprise-scripts/README.md).
package/docs/README.md CHANGED
@@ -7,6 +7,7 @@
7
7
  | [QUICKSTART_OPENCLAW_PLUGIN.md](QUICKSTART_OPENCLAW_PLUGIN.md) | **OpenClaw plugin** — one-command setup, deterministic enforcement (RECOMMENDED) |
8
8
  | [**HOSTED_PASSPORT_SETUP.md**](HOSTED_PASSPORT_SETUP.md) | **Use passport from aport.io** — create hosted during setup or pass `npx @aporthq/aport-agent-guardrails openclaw <agent_id>` |
9
9
  | [QUICKSTART.md](QUICKSTART.md) | Interactive setup and step-by-step hosted/local passport options |
10
+ | [ENTERPRISE_DEVICE_DEPLOYMENT.md](ENTERPRISE_DEVICE_DEPLOYMENT.md) | IT-managed deploy, enforce, and uninstall scripts |
10
11
  | [OPENCLAW_LOCAL_INTEGRATION.md](OPENCLAW_LOCAL_INTEGRATION.md) | Full OpenClaw setup: API, passport, policies, Python example |
11
12
  | [OPENCLAW_TOOLS_AND_POLICIES.md](OPENCLAW_TOOLS_AND_POLICIES.md) | exec, allowed_commands, unmapped tools, passport limits |
12
13
  | [TOOL_POLICY_MAPPING.md](TOOL_POLICY_MAPPING.md) | How tool names map to policy packs |
package/docs/RELEASE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Release process and version policy
2
2
 
3
- **Current release:** 1.0.28 (see [CHANGELOG.md](../CHANGELOG.md)).
3
+ **Current release:** 1.0.29 (see [CHANGELOG.md](../CHANGELOG.md)).
4
4
 
5
5
  We keep **one version number** across all published packages (Node core, Python core, and every framework adapter). That avoids “core is 1.2 but CLI is 0.9” and keeps the story simple for users and support.
6
6
 
@@ -1,5 +1,7 @@
1
1
  # Changelog - APort OpenClaw Plugin
2
2
 
3
+ ## 1.0.29
4
+
3
5
  ## 1.0.28
4
6
 
5
7
  ## 1.0.27
@@ -2,7 +2,7 @@
2
2
  "id": "openclaw-aport",
3
3
  "name": "APort Guardrails",
4
4
  "description": "Deterministic pre-action authorization via APort policy enforcement. Registers before_tool_call to block disallowed tools.",
5
- "version": "1.0.28",
5
+ "version": "1.0.29",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "additionalProperties": false,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@aporthq/openclaw-aport",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@aporthq/openclaw-aport",
9
- "version": "1.0.28",
9
+ "version": "1.0.29",
10
10
  "license": "Apache-2.0",
11
11
  "devDependencies": {
12
12
  "@types/node": "^18.0.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aporthq/openclaw-aport",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "OpenClaw plugin for deterministic pre-action authorization via APort guardrails",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aporthq/aport-agent-guardrails",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "Policy enforcement guardrails for OpenClaw-compatible agent frameworks",
5
5
  "workspaces": [
6
6
  "packages/*",