@erichll/pi-auto-review 0.1.2 → 0.3.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/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ ## 0.3.1 - 2026-07-29
4
+
5
+ - Bind one-shot approval grants to matched policy evidence as well as the
6
+ command, working directory, destination, paths, and other request fields.
7
+ - Prevent a grant issued for one Host-IPC trigger from authorizing a request
8
+ with different trigger evidence.
9
+
10
+ ## 0.3.0 - 2026-07-28
11
+
12
+ - Initial public release.
package/README.md CHANGED
@@ -114,8 +114,8 @@ import {
114
114
  } from "@erichll/pi-auto-review";
115
115
 
116
116
  const request: BoundaryRequest = {
117
- id: "landstrip-query-id",
118
- source: "landstrip",
117
+ id: "sandbox-runtime-query-id",
118
+ source: "sandbox-runtime",
119
119
  surface: "network",
120
120
  operation: "connect",
121
121
  cwd: "/workspace/project",
@@ -158,7 +158,7 @@ may additionally receive only these bounded result classes:
158
158
  a pending deletion target.
159
159
  - `git remote`, branch, status, revision, and remote configuration results for
160
160
  a pending Git push.
161
- - The current structured Landstrip trap.
161
+ - The current structured Sandbox Runtime trap.
162
162
 
163
163
  Unrelated tool results and assistant prose remain excluded. Selected results
164
164
  have a separate `maxRelevantResultTokens` budget, common secret/token forms are
@@ -166,19 +166,18 @@ redacted, and markup characters are escaped before the evidence is sent to the
166
166
  reviewer. Results remain explicitly labeled as untrusted and possibly
167
167
  incomplete.
168
168
 
169
- ## Landstrip status
169
+ ## Sandbox adapter status
170
170
 
171
171
  The broker-facing contract is implemented, but this package does not intercept
172
- Landstrip prompts by itself. A Landstrip adapter must translate its structured
173
- filesystem/network trap into `BoundaryRequest`, consume the exact grant, and
174
- then use a supported Landstrip retry or dynamic-grant mechanism.
175
-
176
- This monorepo also contains `pi-sandbox`, a Linux Landstrip and macOS Seatbelt
177
- integration that owns Bash and process-backed subagent execution, provides
178
- domain-based proxy approval, and consumes this broker service directly. Its
179
- Linux native paths are tested. The macOS implementation has deterministic
180
- orchestration and policy tests, but still awaits native smoke coverage on real
181
- x64/arm64 hosts. Do not load `pi-sandbox` and `pi-landstrip` together.
172
+ OS sandbox events by itself. Adapters translate a concrete boundary into a
173
+ `BoundaryRequest` and must consume the exact grant before allowing the
174
+ operation.
175
+
176
+ This monorepo's `pi-sandbox` uses Anthropic Sandbox Runtime. Filesystem policy
177
+ is static and fails closed; unmatched public network destinations use the
178
+ broker for per-connection approval. Each Bash command or built-in subagent
179
+ session owns an independent Sandbox Runtime broker process. Adapters should use
180
+ the `./sandbox` export.
182
181
 
183
182
  Do not implement the adapter by writing broad permanent rules to
184
183
  `.pi/sandbox.json`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erichll/pi-auto-review",
3
- "version": "0.1.2",
3
+ "version": "0.3.1",
4
4
  "description": "Model-backed boundary approval broker for Pi",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -29,13 +29,14 @@
29
29
  "files": [
30
30
  "src",
31
31
  "config/config.example.json",
32
+ "CHANGELOG.md",
32
33
  "README.md",
33
34
  "LICENSE"
34
35
  ],
35
36
  "exports": {
36
37
  ".": "./src/index.ts",
37
38
  "./broker": "./src/broker/index.ts",
38
- "./landstrip": "./src/integrations/landstrip.ts"
39
+ "./sandbox": "./src/integrations/sandbox.ts"
39
40
  },
40
41
  "pi": {
41
42
  "extensions": [
@@ -27,6 +27,7 @@ export function boundaryRequestHash(request: BoundaryRequest): string {
27
27
  skillName: request.skillName,
28
28
  toolInputPreview: request.toolInputPreview,
29
29
  agentName: request.agentName,
30
+ matchedPolicy: request.matchedPolicy,
30
31
  };
31
32
  return createHash("sha256")
32
33
  .update(JSON.stringify(stableValue(material)))
@@ -9,7 +9,7 @@ export type BoundarySurface =
9
9
 
10
10
  export type BoundarySource =
11
11
  | "permission-system"
12
- | "landstrip"
12
+ | "sandbox-runtime"
13
13
  | (string & {});
14
14
 
15
15
  export type BoundaryRequest = {
package/src/index.ts CHANGED
@@ -38,12 +38,12 @@ import { PermissionUiAutoConfirmer } from "./ui-auto-confirm.ts";
38
38
  export { parseDecision } from "./policy.ts";
39
39
  export * from "./broker/index.ts";
40
40
  export {
41
- landstripTrapToBoundaryRequest,
42
- type LandstripBoundaryTrap,
43
- type LandstripFilesystemTrap,
44
- type LandstripNetworkTrap,
45
- type LandstripRequestContext,
46
- } from "./integrations/landstrip.ts";
41
+ sandboxTrapToBoundaryRequest,
42
+ type SandboxBoundaryTrap,
43
+ type SandboxFilesystemTrap,
44
+ type SandboxNetworkTrap,
45
+ type SandboxRequestContext,
46
+ } from "./integrations/sandbox.ts";
47
47
 
48
48
  type ReasoningLevel =
49
49
  | "off"
@@ -1,13 +1,12 @@
1
1
  import type { BoundaryRequest } from "../broker/types.ts";
2
2
 
3
- export type LandstripFilesystemTrap = {
3
+ export type SandboxFilesystemTrap = {
4
4
  kind: "filesystem";
5
- code: "FILESYSTEM_DENIED";
6
- query_id?: string;
7
5
  operation: "read" | "write";
8
6
  path: string;
9
7
  requested_path?: string;
10
8
  reason?: string;
9
+ query_id?: string;
11
10
  process?: {
12
11
  pid?: number;
13
12
  exe?: string | null;
@@ -15,12 +14,11 @@ export type LandstripFilesystemTrap = {
15
14
  };
16
15
  };
17
16
 
18
- export type LandstripNetworkTrap = {
17
+ export type SandboxNetworkTrap = {
19
18
  kind: "network";
20
- code: "NETWORK_DENIED";
21
- query_id?: string;
22
19
  operation: "connect" | "bind";
23
20
  target: string;
21
+ query_id?: string;
24
22
  process?: {
25
23
  pid?: number;
26
24
  exe?: string | null;
@@ -28,29 +26,29 @@ export type LandstripNetworkTrap = {
28
26
  };
29
27
  };
30
28
 
31
- export type LandstripBoundaryTrap =
32
- | LandstripFilesystemTrap
33
- | LandstripNetworkTrap;
29
+ export type SandboxBoundaryTrap =
30
+ | SandboxFilesystemTrap
31
+ | SandboxNetworkTrap;
34
32
 
35
- export type LandstripRequestContext = {
33
+ export type SandboxRequestContext = {
36
34
  command?: string;
37
35
  cwd: string;
38
36
  agentName?: string;
39
37
  };
40
38
 
41
- export function landstripTrapToBoundaryRequest(
42
- trap: LandstripBoundaryTrap,
43
- context: LandstripRequestContext,
39
+ export function sandboxTrapToBoundaryRequest(
40
+ trap: SandboxBoundaryTrap,
41
+ context: SandboxRequestContext,
44
42
  ): BoundaryRequest {
45
43
  const processSuffix =
46
44
  trap.process?.pid === undefined ? "" : `:${trap.process.pid}`;
47
45
  const id = trap.query_id
48
- ? `landstrip:${trap.query_id}`
49
- : `landstrip:${trap.kind}:${trap.operation}${processSuffix}`;
46
+ ? `sandbox-runtime:${trap.query_id}`
47
+ : `sandbox-runtime:${trap.kind}:${trap.operation}${processSuffix}`;
50
48
  if (trap.kind === "filesystem") {
51
49
  return {
52
50
  id,
53
- source: "landstrip",
51
+ source: "sandbox-runtime",
54
52
  surface:
55
53
  trap.operation === "read"
56
54
  ? "filesystem-read"
@@ -70,7 +68,7 @@ export function landstripTrapToBoundaryRequest(
70
68
  }
71
69
  return {
72
70
  id,
73
- source: "landstrip",
71
+ source: "sandbox-runtime",
74
72
  surface: "network",
75
73
  operation: trap.operation,
76
74
  cwd: trap.process?.cwd || context.cwd,
package/src/policy.ts CHANGED
@@ -582,7 +582,7 @@ function relevantResultEvidence(
582
582
  function sandboxTrapEvidence(
583
583
  request: RelevantBoundaryRequest,
584
584
  ): string | undefined {
585
- if (request.source !== "landstrip") return;
585
+ if (request.source !== "sandbox-runtime") return;
586
586
  return `<sandbox-trap>
587
587
  ${boundedString({
588
588
  surface: request.surface,