atris 3.82.8 → 3.82.10

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.
@@ -12,6 +12,9 @@
12
12
  // word, an option name or a command substring. The guard matches them
13
13
  // with plain string operations. There is no pattern to compile and
14
14
  // nothing that can stall on long input
15
+ // a command block may add four plain conditions, each read by fixed code
16
+ // in the guard: inline (true or false), needs_secret (true or false),
17
+ // needs_remote (true or false) and unless (a list of literal substrings)
15
18
  //
16
19
  // validateRules() returns a list of plain problems. Empty means valid.
17
20
 
@@ -21,7 +24,9 @@ const MAX_ITEM = 200;
21
24
  const GUARD_KEYS = ['allow_hosts', 'net_tools', 'secret_parts', 'safe_net', 'safe_net_aliases', 'read_only', 'read_only_git', 'db_clients', 'command_blocks'];
22
25
  const AGENT_KEYS = ['override_substrings', 'secret_env_names'];
23
26
  const SAFE_NET_KEYS = ['flags', 'values', 'local_values', 'short_flags', 'short_values', 'items'];
24
- const BLOCK_KEYS = ['id', 'category', 'all', 'programs'];
27
+ const BLOCK_KEYS = ['id', 'category', 'all', 'programs', 'inline', 'needs_secret', 'needs_remote', 'unless'];
28
+ const BLOCK_OPTIONAL = ['programs', 'inline', 'needs_secret', 'needs_remote', 'unless'];
29
+ const BLOCK_FLAGS = ['inline', 'needs_secret', 'needs_remote'];
25
30
 
26
31
  const isObj = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
27
32
 
@@ -85,12 +90,19 @@ function validateRules(rules) {
85
90
  const where = `guard.command_blocks[${i}]`;
86
91
  if (!isObj(b)) { problems.push(`${where} must be an object`); return; }
87
92
  noPatternField(b, where, problems);
88
- exactKeys(b, BLOCK_KEYS, where, problems, ['programs']);
93
+ exactKeys(b, BLOCK_KEYS, where, problems, BLOCK_OPTIONAL);
89
94
  if (typeof b.id !== 'string' || !/^[a-z0-9-]{1,40}$/.test(b.id)) problems.push(`${where}.id must be short lowercase words`);
90
95
  if (!['exfil', 'destroy', 'disarm'].includes(b.category)) problems.push(`${where}.category must be exfil, destroy or disarm`);
96
+ for (const k of BLOCK_FLAGS) if (k in b && typeof b[k] !== 'boolean') problems.push(`${where}.${k} must be true or false`);
91
97
  strList(b.all, `${where}.all`, problems);
92
- if (Array.isArray(b.all) && !b.all.length) problems.push(`${where}.all needs at least one substring`);
98
+ // An empty all is allowed only when a secret or an outside address
99
+ // must also be present, so a block can never fire on a program alone.
100
+ if (Array.isArray(b.all) && !b.all.length && b.needs_secret !== true && b.needs_remote !== true) problems.push(`${where}.all needs at least one substring, unless needs_secret or needs_remote is true`);
93
101
  if ('programs' in b) strList(b.programs, `${where}.programs`, problems, /^[A-Za-z0-9._+-]{1,40}$/);
102
+ if ('unless' in b) {
103
+ strList(b.unless, `${where}.unless`, problems);
104
+ if (Array.isArray(b.unless) && b.unless.length > 30) problems.push(`${where}.unless has more than 30 items`);
105
+ }
94
106
  });
95
107
  }
96
108
  }
@@ -228,7 +228,16 @@
228
228
  "neonctl",
229
229
  "cqlsh"
230
230
  ],
231
- "command_blocks": []
231
+ "command_blocks": [
232
+ {
233
+ "id": "inline-secret-out",
234
+ "category": "exfil",
235
+ "all": [],
236
+ "inline": true,
237
+ "needs_secret": true,
238
+ "needs_remote": true
239
+ }
240
+ ]
232
241
  },
233
242
  "agents": {
234
243
  "override_substrings": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atris",
3
- "version": "3.82.8",
3
+ "version": "3.82.10",
4
4
  "description": "you say what you want in plain words. atris builds it, checks it, and shows you proof. project memory your coding agents share across sessions.",
5
5
  "mcpName": "io.github.atrislabs/atris",
6
6
  "main": "bin/atris.js",