@phigon/observer 8.0.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/README.md +303 -0
- package/dist/bin/guardian-runner-darwin-amd64 +0 -0
- package/dist/bin/guardian-runner-darwin-arm64 +0 -0
- package/dist/bin/guardian-runner-linux-amd64 +0 -0
- package/dist/bin/guardian-runner-linux-arm64 +0 -0
- package/dist/bin/guardian-runner-windows-amd64.exe +0 -0
- package/dist/bin/guardian-runner-windows-arm64.exe +0 -0
- package/dist/src/action-policy.d.ts +38 -0
- package/dist/src/action-policy.d.ts.map +1 -0
- package/dist/src/action-policy.js +269 -0
- package/dist/src/action-policy.js.map +1 -0
- package/dist/src/activity/adapters/claude.d.ts +3 -0
- package/dist/src/activity/adapters/claude.d.ts.map +1 -0
- package/dist/src/activity/adapters/claude.js +89 -0
- package/dist/src/activity/adapters/claude.js.map +1 -0
- package/dist/src/activity/adapters/codex.d.ts +3 -0
- package/dist/src/activity/adapters/codex.d.ts.map +1 -0
- package/dist/src/activity/adapters/codex.js +277 -0
- package/dist/src/activity/adapters/codex.js.map +1 -0
- package/dist/src/activity/adapters/copilot.d.ts +2 -0
- package/dist/src/activity/adapters/copilot.d.ts.map +1 -0
- package/dist/src/activity/adapters/copilot.js +4 -0
- package/dist/src/activity/adapters/copilot.js.map +1 -0
- package/dist/src/activity/adapters/generic.d.ts +2 -0
- package/dist/src/activity/adapters/generic.d.ts.map +1 -0
- package/dist/src/activity/adapters/generic.js +4 -0
- package/dist/src/activity/adapters/generic.js.map +1 -0
- package/dist/src/activity/adapters/hermes.d.ts +2 -0
- package/dist/src/activity/adapters/hermes.d.ts.map +1 -0
- package/dist/src/activity/adapters/hermes.js +4 -0
- package/dist/src/activity/adapters/hermes.js.map +1 -0
- package/dist/src/activity/adapters/openai-compatible.d.ts +4 -0
- package/dist/src/activity/adapters/openai-compatible.d.ts.map +1 -0
- package/dist/src/activity/adapters/openai-compatible.js +116 -0
- package/dist/src/activity/adapters/openai-compatible.js.map +1 -0
- package/dist/src/activity/adapters/openclaw.d.ts +2 -0
- package/dist/src/activity/adapters/openclaw.d.ts.map +1 -0
- package/dist/src/activity/adapters/openclaw.js +4 -0
- package/dist/src/activity/adapters/openclaw.js.map +1 -0
- package/dist/src/activity/adapters/opencode.d.ts +3 -0
- package/dist/src/activity/adapters/opencode.d.ts.map +1 -0
- package/dist/src/activity/adapters/opencode.js +137 -0
- package/dist/src/activity/adapters/opencode.js.map +1 -0
- package/dist/src/activity/bridges.d.ts +7 -0
- package/dist/src/activity/bridges.d.ts.map +1 -0
- package/dist/src/activity/bridges.js +17 -0
- package/dist/src/activity/bridges.js.map +1 -0
- package/dist/src/activity/collector.d.ts +90 -0
- package/dist/src/activity/collector.d.ts.map +1 -0
- package/dist/src/activity/collector.js +706 -0
- package/dist/src/activity/collector.js.map +1 -0
- package/dist/src/activity/index.d.ts +14 -0
- package/dist/src/activity/index.d.ts.map +1 -0
- package/dist/src/activity/index.js +14 -0
- package/dist/src/activity/index.js.map +1 -0
- package/dist/src/activity/ingest.d.ts +15 -0
- package/dist/src/activity/ingest.d.ts.map +1 -0
- package/dist/src/activity/ingest.js +103 -0
- package/dist/src/activity/ingest.js.map +1 -0
- package/dist/src/activity/native-capabilities.d.ts +14 -0
- package/dist/src/activity/native-capabilities.d.ts.map +1 -0
- package/dist/src/activity/native-capabilities.js +85 -0
- package/dist/src/activity/native-capabilities.js.map +1 -0
- package/dist/src/activity/normalize.d.ts +17 -0
- package/dist/src/activity/normalize.d.ts.map +1 -0
- package/dist/src/activity/normalize.js +416 -0
- package/dist/src/activity/normalize.js.map +1 -0
- package/dist/src/activity/opencode-sqlite-source.d.ts +19 -0
- package/dist/src/activity/opencode-sqlite-source.d.ts.map +1 -0
- package/dist/src/activity/opencode-sqlite-source.js +305 -0
- package/dist/src/activity/opencode-sqlite-source.js.map +1 -0
- package/dist/src/activity/policy.d.ts +48 -0
- package/dist/src/activity/policy.d.ts.map +1 -0
- package/dist/src/activity/policy.js +436 -0
- package/dist/src/activity/policy.js.map +1 -0
- package/dist/src/activity/record.d.ts +7 -0
- package/dist/src/activity/record.d.ts.map +1 -0
- package/dist/src/activity/record.js +61 -0
- package/dist/src/activity/record.js.map +1 -0
- package/dist/src/activity/source-reader.d.ts +46 -0
- package/dist/src/activity/source-reader.d.ts.map +1 -0
- package/dist/src/activity/source-reader.js +594 -0
- package/dist/src/activity/source-reader.js.map +1 -0
- package/dist/src/activity/types.d.ts +21 -0
- package/dist/src/activity/types.d.ts.map +1 -0
- package/dist/src/activity/types.js +2 -0
- package/dist/src/activity/types.js.map +1 -0
- package/dist/src/agent-action-executor.d.ts +21 -0
- package/dist/src/agent-action-executor.d.ts.map +1 -0
- package/dist/src/agent-action-executor.js +248 -0
- package/dist/src/agent-action-executor.js.map +1 -0
- package/dist/src/agentic-guardian.d.ts +50 -0
- package/dist/src/agentic-guardian.d.ts.map +1 -0
- package/dist/src/agentic-guardian.js +220 -0
- package/dist/src/agentic-guardian.js.map +1 -0
- package/dist/src/atomic-replace.d.ts +4 -0
- package/dist/src/atomic-replace.d.ts.map +1 -0
- package/dist/src/atomic-replace.js +18 -0
- package/dist/src/atomic-replace.js.map +1 -0
- package/dist/src/cli.d.ts +11 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +1244 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/config.d.ts +68 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +260 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/credential-store.d.ts +22 -0
- package/dist/src/credential-store.d.ts.map +1 -0
- package/dist/src/credential-store.js +91 -0
- package/dist/src/credential-store.js.map +1 -0
- package/dist/src/custom-agent-registry.d.ts +26 -0
- package/dist/src/custom-agent-registry.d.ts.map +1 -0
- package/dist/src/custom-agent-registry.js +288 -0
- package/dist/src/custom-agent-registry.js.map +1 -0
- package/dist/src/discovery/adapters/claude.d.ts +3 -0
- package/dist/src/discovery/adapters/claude.d.ts.map +1 -0
- package/dist/src/discovery/adapters/claude.js +26 -0
- package/dist/src/discovery/adapters/claude.js.map +1 -0
- package/dist/src/discovery/adapters/codex.d.ts +3 -0
- package/dist/src/discovery/adapters/codex.d.ts.map +1 -0
- package/dist/src/discovery/adapters/codex.js +23 -0
- package/dist/src/discovery/adapters/codex.js.map +1 -0
- package/dist/src/discovery/adapters/custom.d.ts +4 -0
- package/dist/src/discovery/adapters/custom.d.ts.map +1 -0
- package/dist/src/discovery/adapters/custom.js +24 -0
- package/dist/src/discovery/adapters/custom.js.map +1 -0
- package/dist/src/discovery/adapters/generic.d.ts +3 -0
- package/dist/src/discovery/adapters/generic.d.ts.map +1 -0
- package/dist/src/discovery/adapters/generic.js +126 -0
- package/dist/src/discovery/adapters/generic.js.map +1 -0
- package/dist/src/discovery/adapters/hermes.d.ts +3 -0
- package/dist/src/discovery/adapters/hermes.d.ts.map +1 -0
- package/dist/src/discovery/adapters/hermes.js +22 -0
- package/dist/src/discovery/adapters/hermes.js.map +1 -0
- package/dist/src/discovery/adapters/openclaw.d.ts +3 -0
- package/dist/src/discovery/adapters/openclaw.d.ts.map +1 -0
- package/dist/src/discovery/adapters/openclaw.js +22 -0
- package/dist/src/discovery/adapters/openclaw.js.map +1 -0
- package/dist/src/discovery/engine.d.ts +17 -0
- package/dist/src/discovery/engine.d.ts.map +1 -0
- package/dist/src/discovery/engine.js +164 -0
- package/dist/src/discovery/engine.js.map +1 -0
- package/dist/src/discovery/evidence.d.ts +29 -0
- package/dist/src/discovery/evidence.d.ts.map +1 -0
- package/dist/src/discovery/evidence.js +2 -0
- package/dist/src/discovery/evidence.js.map +1 -0
- package/dist/src/discovery/index.d.ts +11 -0
- package/dist/src/discovery/index.d.ts.map +1 -0
- package/dist/src/discovery/index.js +11 -0
- package/dist/src/discovery/index.js.map +1 -0
- package/dist/src/discovery/known-agent.d.ts +17 -0
- package/dist/src/discovery/known-agent.d.ts.map +1 -0
- package/dist/src/discovery/known-agent.js +193 -0
- package/dist/src/discovery/known-agent.js.map +1 -0
- package/dist/src/discovery/process-identity.d.ts +19 -0
- package/dist/src/discovery/process-identity.d.ts.map +1 -0
- package/dist/src/discovery/process-identity.js +73 -0
- package/dist/src/discovery/process-identity.js.map +1 -0
- package/dist/src/discovery/system-evidence.d.ts +9 -0
- package/dist/src/discovery/system-evidence.d.ts.map +1 -0
- package/dist/src/discovery/system-evidence.js +270 -0
- package/dist/src/discovery/system-evidence.js.map +1 -0
- package/dist/src/discovery/types.d.ts +21 -0
- package/dist/src/discovery/types.d.ts.map +1 -0
- package/dist/src/discovery/types.js +2 -0
- package/dist/src/discovery/types.js.map +1 -0
- package/dist/src/event-queue.d.ts +32 -0
- package/dist/src/event-queue.d.ts.map +1 -0
- package/dist/src/event-queue.js +125 -0
- package/dist/src/event-queue.js.map +1 -0
- package/dist/src/event-spool.d.ts +19 -0
- package/dist/src/event-spool.d.ts.map +1 -0
- package/dist/src/event-spool.js +350 -0
- package/dist/src/event-spool.js.map +1 -0
- package/dist/src/generated/phigon/v1/action_pb.d.ts +223 -0
- package/dist/src/generated/phigon/v1/action_pb.d.ts.map +1 -0
- package/dist/src/generated/phigon/v1/action_pb.js +96 -0
- package/dist/src/generated/phigon/v1/action_pb.js.map +1 -0
- package/dist/src/generated/phigon/v1/common_pb.d.ts +255 -0
- package/dist/src/generated/phigon/v1/common_pb.d.ts.map +1 -0
- package/dist/src/generated/phigon/v1/common_pb.js +242 -0
- package/dist/src/generated/phigon/v1/common_pb.js.map +1 -0
- package/dist/src/generated/phigon/v1/history_sync_pb.d.ts +119 -0
- package/dist/src/generated/phigon/v1/history_sync_pb.d.ts.map +1 -0
- package/dist/src/generated/phigon/v1/history_sync_pb.js +46 -0
- package/dist/src/generated/phigon/v1/history_sync_pb.js.map +1 -0
- package/dist/src/generated/phigon/v1/identity_pb.d.ts +235 -0
- package/dist/src/generated/phigon/v1/identity_pb.d.ts.map +1 -0
- package/dist/src/generated/phigon/v1/identity_pb.js +31 -0
- package/dist/src/generated/phigon/v1/identity_pb.js.map +1 -0
- package/dist/src/generated/phigon/v1/observer_service_pb.d.ts +362 -0
- package/dist/src/generated/phigon/v1/observer_service_pb.d.ts.map +1 -0
- package/dist/src/generated/phigon/v1/observer_service_pb.js +120 -0
- package/dist/src/generated/phigon/v1/observer_service_pb.js.map +1 -0
- package/dist/src/generated/phigon/v1/policy_pb.d.ts +456 -0
- package/dist/src/generated/phigon/v1/policy_pb.d.ts.map +1 -0
- package/dist/src/generated/phigon/v1/policy_pb.js +161 -0
- package/dist/src/generated/phigon/v1/policy_pb.js.map +1 -0
- package/dist/src/generated/phigon/v1/supervision_pb.d.ts +849 -0
- package/dist/src/generated/phigon/v1/supervision_pb.d.ts.map +1 -0
- package/dist/src/generated/phigon/v1/supervision_pb.js +384 -0
- package/dist/src/generated/phigon/v1/supervision_pb.js.map +1 -0
- package/dist/src/generated/phigon/v1/telemetry_pb.d.ts +761 -0
- package/dist/src/generated/phigon/v1/telemetry_pb.d.ts.map +1 -0
- package/dist/src/generated/phigon/v1/telemetry_pb.js +309 -0
- package/dist/src/generated/phigon/v1/telemetry_pb.js.map +1 -0
- package/dist/src/guardian-containment.d.ts +30 -0
- package/dist/src/guardian-containment.d.ts.map +1 -0
- package/dist/src/guardian-containment.js +113 -0
- package/dist/src/guardian-containment.js.map +1 -0
- package/dist/src/guardian-decision-journal.d.ts +29 -0
- package/dist/src/guardian-decision-journal.d.ts.map +1 -0
- package/dist/src/guardian-decision-journal.js +55 -0
- package/dist/src/guardian-decision-journal.js.map +1 -0
- package/dist/src/guardian-execution-manifest.d.ts +29 -0
- package/dist/src/guardian-execution-manifest.d.ts.map +1 -0
- package/dist/src/guardian-execution-manifest.js +95 -0
- package/dist/src/guardian-execution-manifest.js.map +1 -0
- package/dist/src/guardian-hosted-client.d.ts +10 -0
- package/dist/src/guardian-hosted-client.d.ts.map +1 -0
- package/dist/src/guardian-hosted-client.js +45 -0
- package/dist/src/guardian-hosted-client.js.map +1 -0
- package/dist/src/guardian-managed-exec.d.ts +21 -0
- package/dist/src/guardian-managed-exec.d.ts.map +1 -0
- package/dist/src/guardian-managed-exec.js +249 -0
- package/dist/src/guardian-managed-exec.js.map +1 -0
- package/dist/src/guardian-model-bridge.d.ts +13 -0
- package/dist/src/guardian-model-bridge.d.ts.map +1 -0
- package/dist/src/guardian-model-bridge.js +87 -0
- package/dist/src/guardian-model-bridge.js.map +1 -0
- package/dist/src/guardian-native.d.ts +3 -0
- package/dist/src/guardian-native.d.ts.map +1 -0
- package/dist/src/guardian-native.js +13 -0
- package/dist/src/guardian-native.js.map +1 -0
- package/dist/src/guardian-process-monitor.d.ts +20 -0
- package/dist/src/guardian-process-monitor.d.ts.map +1 -0
- package/dist/src/guardian-process-monitor.js +98 -0
- package/dist/src/guardian-process-monitor.js.map +1 -0
- package/dist/src/health.d.ts +35 -0
- package/dist/src/health.d.ts.map +1 -0
- package/dist/src/health.js +41 -0
- package/dist/src/health.js.map +1 -0
- package/dist/src/historical-identity-store.d.ts +20 -0
- package/dist/src/historical-identity-store.d.ts.map +1 -0
- package/dist/src/historical-identity-store.js +391 -0
- package/dist/src/historical-identity-store.js.map +1 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +14 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/installation.d.ts +2 -0
- package/dist/src/installation.d.ts.map +1 -0
- package/dist/src/installation.js +44 -0
- package/dist/src/installation.js.map +1 -0
- package/dist/src/machine-command-executor.d.ts +28 -0
- package/dist/src/machine-command-executor.d.ts.map +1 -0
- package/dist/src/machine-command-executor.js +166 -0
- package/dist/src/machine-command-executor.js.map +1 -0
- package/dist/src/pair.d.ts +21 -0
- package/dist/src/pair.d.ts.map +1 -0
- package/dist/src/pair.js +125 -0
- package/dist/src/pair.js.map +1 -0
- package/dist/src/remove-machine.d.ts +15 -0
- package/dist/src/remove-machine.d.ts.map +1 -0
- package/dist/src/remove-machine.js +77 -0
- package/dist/src/remove-machine.js.map +1 -0
- package/dist/src/stream-client.d.ts +42 -0
- package/dist/src/stream-client.d.ts.map +1 -0
- package/dist/src/stream-client.js +867 -0
- package/dist/src/stream-client.js.map +1 -0
- package/dist/src/stream-state.d.ts +13 -0
- package/dist/src/stream-state.d.ts.map +1 -0
- package/dist/src/stream-state.js +128 -0
- package/dist/src/stream-state.js.map +1 -0
- package/dist/src/windows-process.d.ts +7 -0
- package/dist/src/windows-process.d.ts.map +1 -0
- package/dist/src/windows-process.js +17 -0
- package/dist/src/windows-process.js.map +1 -0
- package/package.json +78 -0
- package/scripts/install.mjs +308 -0
- package/scripts/managed-service.mjs +132 -0
- package/scripts/verify-guardian-release.mjs +42 -0
- package/scripts/windows-app-control.mjs +117 -0
package/README.md
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://phigon.online">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://phigon.online/brand/phigon-white.svg" />
|
|
5
|
+
<img src="https://phigon.online/brand/phigon-black.svg" alt="Phigon" width="72" />
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
# Phigon Observer
|
|
11
|
+
|
|
12
|
+
Connect your AI coding agents to [Phigon](https://phigon.online), the
|
|
13
|
+
consent-based supervision workspace for authorized AI activity.
|
|
14
|
+
|
|
15
|
+
Phigon helps you see:
|
|
16
|
+
|
|
17
|
+
- which approved machines are connected;
|
|
18
|
+
- which AI agents are installed or running;
|
|
19
|
+
- current activity and agent health;
|
|
20
|
+
- saved agent threads and history when sharing is approved.
|
|
21
|
+
|
|
22
|
+
Phigon is consent-based. The observer starts with privacy-safe metadata only,
|
|
23
|
+
and sensitive activity remains protected unless the machine owner approves it.
|
|
24
|
+
|
|
25
|
+
## Install and connect
|
|
26
|
+
|
|
27
|
+
Requires **Node.js 24 or newer** with npm. Releases include Guardian runners for
|
|
28
|
+
Windows, macOS, and Linux on x64 and ARM64. Go is not required to install.
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npm install --global @phigon/observer
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
1. Sign in to [Phigon](https://phigon.online) and select **Connect machine**.
|
|
35
|
+
2. Choose **Metadata** or **Full activity**, then generate a one-time code.
|
|
36
|
+
3. Run the pairing and monitoring commands shown in the connection dialog on
|
|
37
|
+
the machine you administer. The machine owner reviews and accepts the scope.
|
|
38
|
+
|
|
39
|
+
For metadata-only monitoring:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
phigon-observer pair --code YOUR-CODE --consent-profile metadata
|
|
43
|
+
phigon-observer run --profile metadata
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
For supported conversations, commands, outputs, and past-history import, select
|
|
47
|
+
Full activity in Phigon and use the matching profile:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
phigon-observer pair --code YOUR-CODE --consent-profile full
|
|
51
|
+
phigon-observer run --profile full
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`YOUR-CODE` is the one-time code from your workspace. Keep the observer process
|
|
55
|
+
running for live collection. Closing the dashboard does not stop capture;
|
|
56
|
+
stopping the observer does. Full activity still requires matching workspace
|
|
57
|
+
policy and local consent, and secrets are redacted before delivery.
|
|
58
|
+
|
|
59
|
+
Check installation and connection health with:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
phigon-observer doctor --json
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Upgrade from the previous npm package
|
|
66
|
+
|
|
67
|
+
The maintained package is now **`@phigon/observer`**, published under the
|
|
68
|
+
`phigon` npm account. The executable is still **`phigon-observer`**.
|
|
69
|
+
The old unscoped package will not automatically switch to the new package.
|
|
70
|
+
|
|
71
|
+
Stop your observer process or managed service, then run:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
npm uninstall --global phigon-observer
|
|
75
|
+
npm install --global @phigon/observer
|
|
76
|
+
phigon-observer doctor --json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Restart with the same collection profile and environment as before. Keep your
|
|
80
|
+
existing Phigon data directory: npm package replacement does not require a new
|
|
81
|
+
pairing or removal of machine credentials. Managed-service installations may
|
|
82
|
+
need their executable path updated to the new global install location. To
|
|
83
|
+
update future releases, run `npm install --global @phigon/observer@latest`.
|
|
84
|
+
|
|
85
|
+
To monitor an agent that does not have a built-in adapter, register its local
|
|
86
|
+
signals once. Definitions are reloaded on every discovery and activity scan:
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
phigon-observer agent add \
|
|
90
|
+
--id release-bot \
|
|
91
|
+
--name "Release Bot" \
|
|
92
|
+
--executable release-bot \
|
|
93
|
+
--process release-bot-worker \
|
|
94
|
+
--config-path ~/.release-bot \
|
|
95
|
+
--activity-dir ~/.release-bot/sessions
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Use `phigon-observer agent list` to inspect the active definitions and
|
|
99
|
+
`phigon-observer agent remove --id release-bot` to stop using one. Custom
|
|
100
|
+
activity remains visibly source-isolated unless independent process-lifetime
|
|
101
|
+
evidence proves one exact match. Activity directories accept bounded JSONL and
|
|
102
|
+
expand `~/` against the current user's home directory. Paths must be absolute
|
|
103
|
+
or home-relative, activity roots must be narrowly scoped, and overlapping
|
|
104
|
+
identity or activity signals are rejected instead of guessed.
|
|
105
|
+
|
|
106
|
+
To disconnect and unregister the paired machine from that machine itself:
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
phigon-observer remove-machine
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The command requires local confirmation, revokes the machine credential, and
|
|
113
|
+
clears it only after the control plane confirms removal. Workspace retention
|
|
114
|
+
and administrator-managed historical data deletion remain separate controls.
|
|
115
|
+
|
|
116
|
+
Return to [Phigon](https://phigon.online) to view the machine, grouped AI
|
|
117
|
+
agents, live status, health, and available history.
|
|
118
|
+
|
|
119
|
+
## Past conversations and live capture
|
|
120
|
+
|
|
121
|
+
When a machine owner pairs with Full activity consent and runs with `--profile
|
|
122
|
+
full`, the observer automatically imports supported past conversations. It
|
|
123
|
+
resumes that import after a restart. Past chats appear directly in Conversations;
|
|
124
|
+
new prompts, replies, and tool activity are captured independently in real time.
|
|
125
|
+
Administrators can request another archive scan through the authenticated
|
|
126
|
+
`POST /v1/machines/{id}/history-syncs` API. A manual scan reports success only
|
|
127
|
+
after the server acknowledges its final event. Only permitted, locally redacted
|
|
128
|
+
source content is collected; private provider-encrypted reasoning is not decoded.
|
|
129
|
+
|
|
130
|
+
The dashboard does not need to stay open. Normal live monitoring and queued
|
|
131
|
+
history jobs are driven by the observer process. Local state is limited to
|
|
132
|
+
source checkpoints and an encrypted delivery spool; hosted history remains on
|
|
133
|
+
the server and duplicate source records are suppressed across retries.
|
|
134
|
+
|
|
135
|
+
## Optional agent actions
|
|
136
|
+
|
|
137
|
+
Remote agent actions are disabled on every machine by default. A machine owner
|
|
138
|
+
may opt in to the typed Action Center executor before starting the observer:
|
|
139
|
+
|
|
140
|
+
```sh
|
|
141
|
+
PHIGON_REMOTE_ACTIONS_ENABLED=true phigon-observer run
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
This capability accepts graceful stop and force stop for one exact reported
|
|
145
|
+
agent process lifetime. An operator proposal and separate administrator
|
|
146
|
+
confirmation are required, commands expire quickly, the observer refreshes
|
|
147
|
+
local discovery before signaling, and it persists an idempotent terminal
|
|
148
|
+
receipt. This setting does not enable shell commands, file access, screen or
|
|
149
|
+
camera capture, or general remote control. Windows graceful stop uses
|
|
150
|
+
`taskkill.exe /PID` without the force flag and never silently escalates;
|
|
151
|
+
Unix-like systems use `SIGTERM`. Force stop remains a separately approved
|
|
152
|
+
capability on every supported platform.
|
|
153
|
+
|
|
154
|
+
To additionally enroll this machine for administrator-reviewed system operations,
|
|
155
|
+
set `PHIGON_REMOTE_COMMANDS_ENABLED=true` before starting the observer. This
|
|
156
|
+
separate capability enables executable/argument commands, current system
|
|
157
|
+
inspection, and scheduled shutdown/restart through Actions and Cortex. Commands
|
|
158
|
+
run as the observer account, require an exact administrator review, expire before
|
|
159
|
+
dispatch, have a 1–120 second limit, and return at most 32 KB of redacted output.
|
|
160
|
+
A durable execution journal prevents retrying a previously claimed command after
|
|
161
|
+
a crash. A power receipt means a one-minute change was scheduled, not that the
|
|
162
|
+
machine already powered off. See [the administration guide](https://github.com/imthegoodboy/Phigon/blob/imp/docs/admin-controls-upgrade.md).
|
|
163
|
+
|
|
164
|
+
Managed agent integrations can request the hosted fail-closed Guardian decision
|
|
165
|
+
before performing an action:
|
|
166
|
+
|
|
167
|
+
```sh
|
|
168
|
+
phigon-observer authorize-action \
|
|
169
|
+
--agent codex:worker-1 \
|
|
170
|
+
--action command.execute \
|
|
171
|
+
--resource "git status" \
|
|
172
|
+
--context-file ./phigon-action-context.json \
|
|
173
|
+
--json
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
The optional context file is bounded JSON with `task_id`, `proposal_id`,
|
|
177
|
+
`plan_step_id`, `user_prompt`, `agent_plan`, `justification`,
|
|
178
|
+
`expected_effect`, and `recent_activity` fields. These are explicit integration
|
|
179
|
+
evidence, not private model chain-of-thought. The gateway
|
|
180
|
+
returns exit code 0 only for an allow. A deny, approval requirement, or
|
|
181
|
+
unavailable semantic decision returns exit code 77, together with a message
|
|
182
|
+
for the agent. A deny or approval also carries the exact authoritative
|
|
183
|
+
administrator contract returned by the control plane. Every decision is appended
|
|
184
|
+
to the observer's generic activity bridge so normal background telemetry can
|
|
185
|
+
store it even when the dashboard is closed.
|
|
186
|
+
|
|
187
|
+
For a running agent, integrations should also pass the discovered
|
|
188
|
+
`--process-id` and `--process-started-at` together. The control plane binds that
|
|
189
|
+
pair to fresh machine inventory before honoring agent-specific scope. Without
|
|
190
|
+
that proof it evaluates conservatively across all potentially relevant
|
|
191
|
+
agent-scoped contracts; a caller-supplied agent label cannot remove a policy.
|
|
192
|
+
|
|
193
|
+
When a semantic contract requires approval, the hosted control plane creates a
|
|
194
|
+
durable request bound to the exact policy digest, action, resource, contract,
|
|
195
|
+
and evidence envelope. An administrator can approve or reject it in Guardian.
|
|
196
|
+
Retrying the unchanged proposal after approval consumes a single-use grant;
|
|
197
|
+
another execution requires a new `proposal_id`.
|
|
198
|
+
|
|
199
|
+
For CLI agents, run commands through the managed execution boundary so the
|
|
200
|
+
same pre-action decision is mandatory and command input, streamed output, and
|
|
201
|
+
the final exit are captured by the normal background telemetry pipeline:
|
|
202
|
+
|
|
203
|
+
```sh
|
|
204
|
+
phigon-observer guardian exec \
|
|
205
|
+
--agent codex:worker-1 \
|
|
206
|
+
--context-file ./phigon-action-context.json \
|
|
207
|
+
-- npm test
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
To govern the agent product and model before it starts, use the managed agent
|
|
211
|
+
launcher:
|
|
212
|
+
|
|
213
|
+
```sh
|
|
214
|
+
phigon-observer guardian launch \
|
|
215
|
+
--agent claude-code:worker-1 \
|
|
216
|
+
--model anthropic:claude-sonnet-4-5 \
|
|
217
|
+
--context-file ./phigon-action-context.json \
|
|
218
|
+
-- claude
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
The launcher requires an explicit model claim and obtains one short-lived,
|
|
222
|
+
single-use grant covering `agent.start`, `model.use`, and `command.execute`.
|
|
223
|
+
The grant binds the executable and input file hashes, arguments, working
|
|
224
|
+
directory, environment, and current company policy. The native supervisor
|
|
225
|
+
contains the managed process tree and stops it if its online lease cannot renew.
|
|
226
|
+
It renews directly with the control plane, so an observer event-loop stall does
|
|
227
|
+
not disable policy revocation. Its private credential bootstrap is removed before
|
|
228
|
+
the workload starts and is excluded from command arguments and activity journals.
|
|
229
|
+
Pending administrator approval holds the complete launch; any denied or
|
|
230
|
+
unavailable check prevents it from starting.
|
|
231
|
+
`guardian exec` also checks `agent.start` when no model is declared. Before either
|
|
232
|
+
launch mode creates its manifest, it retrieves the company's assigned OS profiles.
|
|
233
|
+
Linux profiles enforce filesystem permissions and optional denial of all sockets
|
|
234
|
+
through Landlock/seccomp; unsupported assigned protections block launch. Profiles
|
|
235
|
+
also support Windows/Linux memory, CPU and process limits, runtime deadlines,
|
|
236
|
+
and Linux workload UID/GID separation when the required protected launcher and
|
|
237
|
+
cgroup are provisioned. macOS currently accepts runtime deadlines only. Profiles
|
|
238
|
+
are checked again during grant consumption and online lease renewal. An all-socket
|
|
239
|
+
deny profile also blocks the loopback model gateway.
|
|
240
|
+
|
|
241
|
+
Compatible agents receive a temporary loopback model gateway credential and
|
|
242
|
+
provider base URLs. The hosted gateway checks every forwarded model request,
|
|
243
|
+
maps only administrator-approved models, and keeps company provider keys on
|
|
244
|
+
the server. Direct provider traffic requires company network controls.
|
|
245
|
+
|
|
246
|
+
The executable is launched directly without a shell. A held or blocked action
|
|
247
|
+
never starts and returns exit code 77; an allowed command returns its own exit
|
|
248
|
+
code. Programs launched outside this managed boundary still require their own
|
|
249
|
+
Phigon integration or an operating-system application-control policy. A
|
|
250
|
+
business that must prevent direct executable or API bypass also needs OS/MDM
|
|
251
|
+
application control and a controlled model-provider proxy.
|
|
252
|
+
|
|
253
|
+
Guardian is centrally managed. `phigon-observer guardian status` reports the
|
|
254
|
+
management authority. Local on/off and containment switches have been removed;
|
|
255
|
+
old `guardian-control.json` files are ignored. Administrator policies alone
|
|
256
|
+
specify the allowed intervention, and the executor verifies the exact process
|
|
257
|
+
lifetime before stopping it.
|
|
258
|
+
|
|
259
|
+
While `phigon-observer run` is active, discovered running process instances are
|
|
260
|
+
also submitted for periodic central review, including agents started outside
|
|
261
|
+
`guardian launch`. A policy-authorized stop or force-stop is dispatched against
|
|
262
|
+
that exact instance and its receipt enters hosted telemetry. Discovery is
|
|
263
|
+
post-launch detection: it cannot undo activity before discovery or contain
|
|
264
|
+
undetected agents. Block-only policies never become background process kills.
|
|
265
|
+
|
|
266
|
+
For exact model/agent lists, central decision auditing, and enterprise rollout
|
|
267
|
+
boundaries, see [Guardian runtime](https://github.com/imthegoodboy/Phigon/blob/imp/docs/guardian-runtime.md), the
|
|
268
|
+
[business policy catalog](https://github.com/imthegoodboy/Phigon/blob/imp/docs/enterprise-guard-policies.md), and
|
|
269
|
+
[deployment requirements](https://github.com/imthegoodboy/Phigon/blob/imp/docs/guardian-deployment.md).
|
|
270
|
+
Deployment guidance includes the central Linux profile format and generated
|
|
271
|
+
Windows AppLocker build/review/apply/verify/rollback package. Saving a plain-language
|
|
272
|
+
rule does not automatically install machine-wide application controls.
|
|
273
|
+
|
|
274
|
+
Building from source requires Node 24+ and Go 1.26. `npm run build` produces the
|
|
275
|
+
current platform's native runner. `npm run build:platforms` adds Windows, Linux,
|
|
276
|
+
and macOS x64/ARM64 binaries before release packaging. Installed releases include
|
|
277
|
+
the runner; endpoint users do not need Go.
|
|
278
|
+
|
|
279
|
+
Phigon includes optimized support for Codex, Claude Code, Cursor, GitHub
|
|
280
|
+
Copilot, OpenCode, Gemini CLI, and more, while the dynamic registry and custom
|
|
281
|
+
NDJSON bridge support locally authorized custom agents without a code change.
|
|
282
|
+
|
|
283
|
+
## Troubleshooting
|
|
284
|
+
|
|
285
|
+
- **Command not found:** ensure npm's global executable directory is on `PATH`,
|
|
286
|
+
then reopen your terminal.
|
|
287
|
+
- **Expired pairing code:** generate another code in Connect machine and retry.
|
|
288
|
+
- **No conversations:** metadata excludes content. Check the accepted profile,
|
|
289
|
+
workspace policy, and adapter coverage with `doctor --profile full --json`.
|
|
290
|
+
- **Disconnected machine:** keep the observer running and allow its configured
|
|
291
|
+
HTTPS and telemetry endpoints. Already delivered history stays on the server;
|
|
292
|
+
queued permitted activity is retried when connectivity returns.
|
|
293
|
+
- **Unsupported source:** Phigon shows missing or limited evidence. It does not
|
|
294
|
+
fabricate conversations or decrypt provider-private reasoning.
|
|
295
|
+
|
|
296
|
+
[Setup guide](https://phigon.online/docs/get-started) ·
|
|
297
|
+
[Documentation](https://phigon.online/docs) ·
|
|
298
|
+
[Report an issue](https://github.com/imthegoodboy/Phigon/issues)
|
|
299
|
+
|
|
300
|
+
## License
|
|
301
|
+
|
|
302
|
+
This package is proprietary (`UNLICENSED`). Public npm availability does not
|
|
303
|
+
grant an open-source license.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ManagedAction, type ActionGuardrailPolicy } from "./generated/phigon/v1/policy_pb.js";
|
|
2
|
+
export declare const managedActionNames: readonly ["file.read", "file.write", "file.delete", "command.execute", "process.launch", "network.connect", "browser.navigate", "credential.access", "agent.start", "model.use"];
|
|
3
|
+
export type ManagedActionName = typeof managedActionNames[number];
|
|
4
|
+
export type GuardianIntervention = "block_action" | "stop_agent" | "kill_agent";
|
|
5
|
+
export type StoredActionRule = Readonly<{
|
|
6
|
+
ruleId: string;
|
|
7
|
+
action: ManagedActionName;
|
|
8
|
+
effect: "deny" | "require_approval";
|
|
9
|
+
intervention: GuardianIntervention;
|
|
10
|
+
resourcePattern: string;
|
|
11
|
+
agentPattern: string;
|
|
12
|
+
reason: string;
|
|
13
|
+
sourceText: string;
|
|
14
|
+
}>;
|
|
15
|
+
export type StoredActionPolicy = Readonly<{
|
|
16
|
+
machineId: string;
|
|
17
|
+
policyDigest: string;
|
|
18
|
+
defaultEffect: "allow";
|
|
19
|
+
rules: readonly StoredActionRule[];
|
|
20
|
+
receivedAt: string;
|
|
21
|
+
}>;
|
|
22
|
+
export interface ActionPolicyPersistence {
|
|
23
|
+
invalidate(machineId: string): number;
|
|
24
|
+
save(machineId: string, policy: ActionGuardrailPolicy, generation?: number): Promise<StoredActionPolicy>;
|
|
25
|
+
load(machineId: string): Promise<StoredActionPolicy | null>;
|
|
26
|
+
}
|
|
27
|
+
export declare class ActionPolicySupersededError extends Error {
|
|
28
|
+
}
|
|
29
|
+
export declare class FileActionPolicyStore implements ActionPolicyPersistence {
|
|
30
|
+
#private;
|
|
31
|
+
constructor(dataDirectory: string);
|
|
32
|
+
save(machineId: string, policy: ActionGuardrailPolicy, generation?: number): Promise<StoredActionPolicy>;
|
|
33
|
+
invalidate(machineId: string): number;
|
|
34
|
+
load(machineId: string): Promise<StoredActionPolicy | null>;
|
|
35
|
+
}
|
|
36
|
+
export declare function policyForStorage(machineId: string, policy: ActionGuardrailPolicy): StoredActionPolicy;
|
|
37
|
+
export declare function actionName(action: ManagedAction): ManagedActionName;
|
|
38
|
+
//# sourceMappingURL=action-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-policy.d.ts","sourceRoot":"","sources":["../../src/action-policy.ts"],"names":[],"mappings":"AAWA,OAAO,EAGL,aAAa,EACb,KAAK,qBAAqB,EAC3B,MAAM,oCAAoC,CAAC;AAE5C,eAAO,MAAM,kBAAkB,kLAWpB,CAAC;AAIZ,MAAM,MAAM,iBAAiB,GAAG,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AAClE,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,YAAY,GAAG,YAAY,CAAC;AAEhF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,kBAAkB,CAAC;IACpC,YAAY,EAAE,oBAAoB,CAAC;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IACtC,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,qBAAqB,EAC7B,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC/B,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;CAC7D;AAED,qBAAa,2BAA4B,SAAQ,KAAK;CAAG;AAEzD,qBAAa,qBAAsB,YAAW,uBAAuB;;gBAKvD,aAAa,EAAE,MAAM;IAK3B,IAAI,CACR,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,qBAAqB,EAC7B,UAAU,SAAmB,GAC5B,OAAO,CAAC,kBAAkB,CAAC;IA6B9B,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAW/B,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;CAqBlE;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,qBAAqB,GAC5B,kBAAkB,CAoDpB;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,iBAAiB,CAgBnE"}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { unlinkSync } from "node:fs";
|
|
3
|
+
import { chmod, mkdir, readFile, rename, unlink, writeFile, } from "node:fs/promises";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { GuardrailEffect, GuardrailIntervention, ManagedAction, } from "./generated/phigon/v1/policy_pb.js";
|
|
6
|
+
export const managedActionNames = Object.freeze([
|
|
7
|
+
"file.read",
|
|
8
|
+
"file.write",
|
|
9
|
+
"file.delete",
|
|
10
|
+
"command.execute",
|
|
11
|
+
"process.launch",
|
|
12
|
+
"network.connect",
|
|
13
|
+
"browser.navigate",
|
|
14
|
+
"credential.access",
|
|
15
|
+
"agent.start",
|
|
16
|
+
"model.use",
|
|
17
|
+
]);
|
|
18
|
+
const maxPolicyRules = 256;
|
|
19
|
+
export class ActionPolicySupersededError extends Error {
|
|
20
|
+
}
|
|
21
|
+
export class FileActionPolicyStore {
|
|
22
|
+
#dataDirectory;
|
|
23
|
+
#path;
|
|
24
|
+
#generation = 0;
|
|
25
|
+
constructor(dataDirectory) {
|
|
26
|
+
this.#dataDirectory = dataDirectory;
|
|
27
|
+
this.#path = join(dataDirectory, "action-policy.json");
|
|
28
|
+
}
|
|
29
|
+
async save(machineId, policy, generation = this.#generation) {
|
|
30
|
+
const value = policyForStorage(machineId, policy);
|
|
31
|
+
this.#requireCurrentGeneration(generation);
|
|
32
|
+
await mkdir(this.#dataDirectory, { recursive: true, mode: 0o700 });
|
|
33
|
+
await chmod(this.#dataDirectory, 0o700);
|
|
34
|
+
const temporaryPath = `${this.#path}.${process.pid}.${randomUUID()}.tmp`;
|
|
35
|
+
let promoted = false;
|
|
36
|
+
try {
|
|
37
|
+
await writeFile(temporaryPath, `${JSON.stringify(value)}\n`, { encoding: "utf8", flag: "wx", mode: 0o600 });
|
|
38
|
+
this.#requireCurrentGeneration(generation);
|
|
39
|
+
await rename(temporaryPath, this.#path);
|
|
40
|
+
promoted = true;
|
|
41
|
+
this.#requireCurrentGeneration(generation);
|
|
42
|
+
await chmod(this.#path, 0o600);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
try {
|
|
46
|
+
await unlink(promoted ? this.#path : temporaryPath);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// The temporary file may not exist or invalidation may have removed it.
|
|
50
|
+
}
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
invalidate(machineId) {
|
|
56
|
+
validateMachineId(machineId);
|
|
57
|
+
this.#generation += 1;
|
|
58
|
+
try {
|
|
59
|
+
unlinkSync(this.#path);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
if (!isNodeError(error) || error.code !== "ENOENT")
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
return this.#generation;
|
|
66
|
+
}
|
|
67
|
+
async load(machineId) {
|
|
68
|
+
let raw;
|
|
69
|
+
try {
|
|
70
|
+
raw = await readFile(this.#path, "utf8");
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
if (isNodeError(error) && error.code === "ENOENT")
|
|
74
|
+
return null;
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
const value = JSON.parse(raw);
|
|
78
|
+
upgradeStoredPolicy(value);
|
|
79
|
+
validateStoredPolicy(value, machineId);
|
|
80
|
+
return value;
|
|
81
|
+
}
|
|
82
|
+
#requireCurrentGeneration(generation) {
|
|
83
|
+
if (generation !== this.#generation) {
|
|
84
|
+
throw new ActionPolicySupersededError("Action policy was superseded before persistence completed.");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export function policyForStorage(machineId, policy) {
|
|
89
|
+
validateMachineId(machineId);
|
|
90
|
+
if (!/^[a-f0-9]{64}$/u.test(policy.policyDigest)) {
|
|
91
|
+
throw new Error("Action policy digest is invalid.");
|
|
92
|
+
}
|
|
93
|
+
if (policy.defaultEffect !== "allow") {
|
|
94
|
+
throw new Error("Action policy default effect is invalid.");
|
|
95
|
+
}
|
|
96
|
+
if (policy.rules.length > maxPolicyRules) {
|
|
97
|
+
throw new Error("Action policy contains too many rules.");
|
|
98
|
+
}
|
|
99
|
+
const seen = new Set();
|
|
100
|
+
const rules = policy.rules.map((rule) => {
|
|
101
|
+
if (!validRuleId(rule.ruleId) || seen.has(rule.ruleId)) {
|
|
102
|
+
throw new Error("Action policy rule identity is invalid.");
|
|
103
|
+
}
|
|
104
|
+
seen.add(rule.ruleId);
|
|
105
|
+
const action = actionName(rule.action);
|
|
106
|
+
const effect = effectName(rule.effect);
|
|
107
|
+
const intervention = interventionName(rule.intervention);
|
|
108
|
+
if (effect === "require_approval" && intervention !== "block_action") {
|
|
109
|
+
throw new Error("Action policy approval rule cannot terminate an agent.");
|
|
110
|
+
}
|
|
111
|
+
if (rule.resourcePattern.length < 1 ||
|
|
112
|
+
Buffer.byteLength(rule.resourcePattern, "utf8") > 512 ||
|
|
113
|
+
Buffer.byteLength(rule.agentPattern.trim(), "utf8") > 128 ||
|
|
114
|
+
rule.reason.trim().length < 1 ||
|
|
115
|
+
Buffer.byteLength(rule.reason, "utf8") > 256 ||
|
|
116
|
+
Buffer.byteLength(rule.sourceText.trim(), "utf8") > 2_000) {
|
|
117
|
+
throw new Error("Action policy rule bounds are invalid.");
|
|
118
|
+
}
|
|
119
|
+
compileGlob(rule.resourcePattern);
|
|
120
|
+
return Object.freeze({
|
|
121
|
+
ruleId: rule.ruleId,
|
|
122
|
+
action,
|
|
123
|
+
effect,
|
|
124
|
+
intervention,
|
|
125
|
+
resourcePattern: rule.resourcePattern,
|
|
126
|
+
agentPattern: rule.agentPattern.trim(),
|
|
127
|
+
reason: rule.reason.trim(),
|
|
128
|
+
sourceText: rule.sourceText.trim(),
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
return Object.freeze({
|
|
132
|
+
machineId,
|
|
133
|
+
policyDigest: policy.policyDigest,
|
|
134
|
+
defaultEffect: "allow",
|
|
135
|
+
rules: Object.freeze(rules),
|
|
136
|
+
receivedAt: new Date().toISOString(),
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
export function actionName(action) {
|
|
140
|
+
const values = {
|
|
141
|
+
[ManagedAction.FILE_READ]: "file.read",
|
|
142
|
+
[ManagedAction.FILE_WRITE]: "file.write",
|
|
143
|
+
[ManagedAction.FILE_DELETE]: "file.delete",
|
|
144
|
+
[ManagedAction.COMMAND_EXECUTE]: "command.execute",
|
|
145
|
+
[ManagedAction.PROCESS_LAUNCH]: "process.launch",
|
|
146
|
+
[ManagedAction.NETWORK_CONNECT]: "network.connect",
|
|
147
|
+
[ManagedAction.BROWSER_NAVIGATE]: "browser.navigate",
|
|
148
|
+
[ManagedAction.CREDENTIAL_ACCESS]: "credential.access",
|
|
149
|
+
[ManagedAction.AGENT_START]: "agent.start",
|
|
150
|
+
[ManagedAction.MODEL_USE]: "model.use",
|
|
151
|
+
};
|
|
152
|
+
const value = values[action];
|
|
153
|
+
if (value === undefined)
|
|
154
|
+
throw new Error("Action policy action is invalid.");
|
|
155
|
+
return value;
|
|
156
|
+
}
|
|
157
|
+
function effectName(effect) {
|
|
158
|
+
if (effect === GuardrailEffect.DENY)
|
|
159
|
+
return "deny";
|
|
160
|
+
if (effect === GuardrailEffect.REQUIRE_APPROVAL)
|
|
161
|
+
return "require_approval";
|
|
162
|
+
throw new Error("Action policy effect is invalid.");
|
|
163
|
+
}
|
|
164
|
+
function validateStoredPolicy(value, machineId) {
|
|
165
|
+
if (typeof value !== "object" || value === null ||
|
|
166
|
+
!("machineId" in value) || value.machineId !== machineId ||
|
|
167
|
+
!("policyDigest" in value) || typeof value.policyDigest !== "string" ||
|
|
168
|
+
!/^[a-f0-9]{64}$/u.test(value.policyDigest) ||
|
|
169
|
+
!("defaultEffect" in value) || value.defaultEffect !== "allow" ||
|
|
170
|
+
!("receivedAt" in value) || typeof value.receivedAt !== "string" ||
|
|
171
|
+
!Number.isFinite(Date.parse(value.receivedAt)) ||
|
|
172
|
+
!("rules" in value) || !Array.isArray(value.rules) || value.rules.length > maxPolicyRules) {
|
|
173
|
+
throw new Error("Stored action policy is invalid.");
|
|
174
|
+
}
|
|
175
|
+
const seen = new Set();
|
|
176
|
+
for (const rule of value.rules) {
|
|
177
|
+
if (typeof rule !== "object" || rule === null ||
|
|
178
|
+
!("ruleId" in rule) || typeof rule.ruleId !== "string" ||
|
|
179
|
+
!validRuleId(rule.ruleId) || seen.has(rule.ruleId) ||
|
|
180
|
+
!("action" in rule) || typeof rule.action !== "string" ||
|
|
181
|
+
!managedActionNames.includes(rule.action) ||
|
|
182
|
+
!("effect" in rule) ||
|
|
183
|
+
(rule.effect !== "deny" && rule.effect !== "require_approval") ||
|
|
184
|
+
!("intervention" in rule) ||
|
|
185
|
+
(rule.intervention !== "block_action" &&
|
|
186
|
+
rule.intervention !== "stop_agent" &&
|
|
187
|
+
rule.intervention !== "kill_agent") ||
|
|
188
|
+
!("resourcePattern" in rule) || typeof rule.resourcePattern !== "string" ||
|
|
189
|
+
rule.resourcePattern.length < 1 || Buffer.byteLength(rule.resourcePattern, "utf8") > 512 ||
|
|
190
|
+
!("agentPattern" in rule) || typeof rule.agentPattern !== "string" ||
|
|
191
|
+
Buffer.byteLength(rule.agentPattern, "utf8") > 128 ||
|
|
192
|
+
!("reason" in rule) || typeof rule.reason !== "string" ||
|
|
193
|
+
rule.reason.trim().length < 1 || Buffer.byteLength(rule.reason, "utf8") > 256 ||
|
|
194
|
+
!("sourceText" in rule) || typeof rule.sourceText !== "string" ||
|
|
195
|
+
Buffer.byteLength(rule.sourceText, "utf8") > 2_000) {
|
|
196
|
+
throw new Error("Stored action policy rule is invalid.");
|
|
197
|
+
}
|
|
198
|
+
if (rule.effect === "require_approval" && rule.intervention !== "block_action") {
|
|
199
|
+
throw new Error("Stored action policy approval rule cannot terminate an agent.");
|
|
200
|
+
}
|
|
201
|
+
compileGlob(rule.resourcePattern);
|
|
202
|
+
if (rule.agentPattern.trim() !== "")
|
|
203
|
+
compileGlob(rule.agentPattern.trim());
|
|
204
|
+
if (rule.agentPattern !== "")
|
|
205
|
+
compileGlob(rule.agentPattern);
|
|
206
|
+
seen.add(rule.ruleId);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function interventionName(intervention) {
|
|
210
|
+
if (intervention === GuardrailIntervention.STOP_AGENT)
|
|
211
|
+
return "stop_agent";
|
|
212
|
+
if (intervention === GuardrailIntervention.KILL_AGENT)
|
|
213
|
+
return "kill_agent";
|
|
214
|
+
if (intervention === GuardrailIntervention.BLOCK_ACTION ||
|
|
215
|
+
intervention === GuardrailIntervention.UNSPECIFIED)
|
|
216
|
+
return "block_action";
|
|
217
|
+
throw new Error("Action policy intervention is invalid.");
|
|
218
|
+
}
|
|
219
|
+
function upgradeStoredPolicy(value) {
|
|
220
|
+
if (typeof value !== "object" || value === null || !("rules" in value) ||
|
|
221
|
+
!Array.isArray(value.rules))
|
|
222
|
+
return;
|
|
223
|
+
for (const item of value.rules) {
|
|
224
|
+
if (typeof item === "object" && item !== null && !("agentPattern" in item)) {
|
|
225
|
+
item["agentPattern"] = "";
|
|
226
|
+
}
|
|
227
|
+
if (typeof item === "object" && item !== null && !("sourceText" in item)) {
|
|
228
|
+
item["sourceText"] = "";
|
|
229
|
+
}
|
|
230
|
+
if (typeof item === "object" && item !== null && !("intervention" in item)) {
|
|
231
|
+
item["intervention"] = "block_action";
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function compileGlob(pattern) {
|
|
236
|
+
let expression = "^";
|
|
237
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
238
|
+
const character = pattern[index];
|
|
239
|
+
if (character === "*" && pattern[index + 1] === "*") {
|
|
240
|
+
expression += ".*";
|
|
241
|
+
index++;
|
|
242
|
+
}
|
|
243
|
+
else if (character === "*") {
|
|
244
|
+
expression += "[^/]*";
|
|
245
|
+
}
|
|
246
|
+
else if (character === "?") {
|
|
247
|
+
expression += "[^/]";
|
|
248
|
+
}
|
|
249
|
+
else if (character === "[") {
|
|
250
|
+
throw new Error("Character classes are not supported in action policy globs.");
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
expression += character.replace(/[\\^$+?.()|{}]/gu, "\\$&");
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return new RegExp(`${expression}$`, "u");
|
|
257
|
+
}
|
|
258
|
+
function validRuleId(value) {
|
|
259
|
+
return /^[a-f0-9]{8}-[a-f0-9]{4}-[1-8][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/iu.test(value);
|
|
260
|
+
}
|
|
261
|
+
function validateMachineId(value) {
|
|
262
|
+
if (value.length < 1 || value.length > 128 || !/^[A-Za-z0-9._:-]+$/u.test(value)) {
|
|
263
|
+
throw new Error("Machine ID is invalid.");
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
function isNodeError(error) {
|
|
267
|
+
return error instanceof Error && "code" in error;
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=action-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-policy.js","sourceRoot":"","sources":["../../src/action-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,KAAK,EACL,KAAK,EACL,QAAQ,EACR,MAAM,EACN,MAAM,EACN,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,aAAa,GAEd,MAAM,oCAAoC,CAAC;AAE5C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9C,WAAW;IACX,YAAY;IACZ,aAAa;IACb,iBAAiB;IACjB,gBAAgB;IAChB,iBAAiB;IACjB,kBAAkB;IAClB,mBAAmB;IACnB,aAAa;IACb,WAAW;CACH,CAAC,CAAC;AAEZ,MAAM,cAAc,GAAG,GAAG,CAAC;AAkC3B,MAAM,OAAO,2BAA4B,SAAQ,KAAK;CAAG;AAEzD,MAAM,OAAO,qBAAqB;IACvB,cAAc,CAAS;IACvB,KAAK,CAAS;IACvB,WAAW,GAAG,CAAC,CAAC;IAEhB,YAAY,aAAqB;QAC/B,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,IAAI,C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