@beatos/bridge-runner 0.5.0 → 0.5.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 CHANGED
@@ -253,9 +253,10 @@ Always blocked, without any setting:
253
253
  | Read, edit, write | `~/.ssh/**`, `~/.aws/**`, `~/.docker/**`, `~/.npmrc`, `~/.git-credentials` |
254
254
  | Read, edit, write | GitHub CLI login: `~/.config/gh/**` and `AppData/Roaming/GitHub CLI/**` |
255
255
  | Read, edit, write | `~/.beatos-runner/**` (the runner's key and state) |
256
- | Read, edit, write | `.env` files and `.pem` files under `~/projects`, and `.env` files in the work folder |
256
+ | Read, edit, write | `.env*`, `.mcp.json`, `.npmrc`, `.git-credentials`, `.pem` and `.key` files under `~/projects` |
257
+ | Read | the same key and token files (also `.p12`, `.pfx`) in the project folder, wherever it is, and in the work folder |
257
258
  | Edit, write | everything in `~/.claude/**` (Claude Code settings) and the work copy's `.git` folder |
258
- | Shell commands | commands that mention `.env`, credentials, `.ssh`, `.pem`, `.npmrc`, tokens, or `.beatos-runner` |
259
+ | Shell commands | commands that mention `.env`, `.mcp.json`, credentials, `.ssh`, `.pem`, `.npmrc`, tokens, or `.beatos-runner` |
259
260
 
260
261
  How to check it works:
261
262
 
package/dist/runner.js CHANGED
@@ -39,7 +39,7 @@ import { classifyError, retryDelaySeconds, sessionUsage, } from "./claude.js";
39
39
  import { Outbox } from "./outbox.js";
40
40
  import { decideAction } from "./policy.js";
41
41
  import { claudeArgs, sessionSettings, agentEnv } from "./safety.js";
42
- export const RUNNER_VERSION = "0.5.0";
42
+ export const RUNNER_VERSION = "0.5.1";
43
43
  /** A model name from Bridge goes into argv: plain names only. */
44
44
  const MODEL_RE = /^[A-Za-z0-9._-]{1,64}$/;
45
45
  const CLAIM_REFRESH_MS = 5 * 60_000;
package/dist/safety.js CHANGED
@@ -87,6 +87,9 @@ export const ALWAYS_DENY = [
87
87
  "Bash(scoop*)",
88
88
  // secrets in files
89
89
  "Bash(*.env*)",
90
+ "Bash(*.mcp.json*)",
91
+ "Bash(*.npmrc*)",
92
+ "Bash(*.git-credentials*)",
90
93
  "Bash(*credentials*)",
91
94
  "Bash(*CREDENTIALS*)",
92
95
  "Bash(*.ssh*)",
@@ -124,12 +127,32 @@ export const SECRET_PATHS = [
124
127
  ".beatos-runner/**",
125
128
  "projects/**/*.pem",
126
129
  "projects/**/.env*",
130
+ "projects/**/.mcp.json",
131
+ "projects/**/.npmrc",
132
+ "projects/**/*.key",
133
+ "projects/**/.git-credentials",
134
+ ];
135
+ /**
136
+ * Files inside a project folder that often hold keys or tokens: an MCP config
137
+ * with an Authorization header, an .npmrc with an auth token, .env files, key
138
+ * files. The agent may not read them in the project folder (wherever its root
139
+ * is, not only under ~/projects) or in its own git copy.
140
+ */
141
+ export const PROJECT_SECRET_FILES = [
142
+ ".env*",
143
+ ".mcp.json",
144
+ ".npmrc",
145
+ ".git-credentials",
146
+ "*.pem",
147
+ "*.key",
148
+ "*.p12",
149
+ "*.pfx",
127
150
  ];
128
151
  /** Under the home folder. Control plane: no Edit or Write. */
129
152
  export const CONTROL_PATHS = [".claude/**"];
130
153
  /** Relative to the session's working folder: its own clone's .git and Claude settings. */
131
154
  export const LOCAL_DENY = [
132
- "Read(**/.env*)",
155
+ ...PROJECT_SECRET_FILES.map((f) => `Read(**/${f})`),
133
156
  "Edit(**/.git/**)",
134
157
  "Write(**/.git/**)",
135
158
  "Edit(**/.claude/**)",
@@ -145,12 +168,12 @@ export function homeForms(tool, rel, home = homedir()) {
145
168
  rules.push(`${tool}(//${drive[1].toLowerCase()}/${drive[2]}/${rel})`);
146
169
  return rules;
147
170
  }
148
- export function pathForms(tool, path) {
171
+ export function pathForms(tool, path, glob = "**") {
149
172
  const posix = path.replace(/\\/g, "/").replace(/\/+$/, "");
150
- const rules = [`${tool}(${posix}/**)`];
173
+ const rules = [`${tool}(${posix}/${glob})`];
151
174
  const drive = /^([A-Za-z]):\/(.*)$/.exec(posix);
152
175
  if (drive)
153
- rules.push(`${tool}(//${drive[1].toLowerCase()}/${drive[2]}/**)`);
176
+ rules.push(`${tool}(//${drive[1].toLowerCase()}/${drive[2]}/${glob})`);
154
177
  return rules;
155
178
  }
156
179
  export function denyRules(place, home = homedir(), protectPaths = [], stateDir) {
@@ -164,6 +187,8 @@ export function denyRules(place, home = homedir(), protectPaths = [], stateDir)
164
187
  if ((place.mode === "git" || place.mode === "folder") && place.projectPath) {
165
188
  for (const tool of ["Edit", "Write", "MultiEdit", "NotebookEdit"])
166
189
  rules.push(...pathForms(tool, place.projectPath));
190
+ for (const f of PROJECT_SECRET_FILES)
191
+ rules.push(...pathForms("Read", place.projectPath, `**/${f}`));
167
192
  }
168
193
  // The runner's own folder (key, config, outbox) also when BEATOS_RUNNER_HOME moves it.
169
194
  if (stateDir)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beatos/bridge-runner",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "description": "BeatOS Bridge runner: a small program on your own computer that takes BeatOS tasks for your agent and works them with Claude Code. It only dials out to beatos.app.",
6
6
  "license": "MIT",