@stratusagent/permissions 0.12.5 → 0.13.0
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/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +17 -0
- package/dist/commands.js.map +1 -1
- package/dist/compound.d.ts +167 -0
- package/dist/compound.d.ts.map +1 -0
- package/dist/compound.js +899 -0
- package/dist/compound.js.map +1 -0
- package/dist/index.d.ts +78 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +258 -35
- package/dist/index.js.map +1 -1
- package/dist/whitelist.d.ts +17 -2
- package/dist/whitelist.d.ts.map +1 -1
- package/dist/whitelist.js +28 -4
- package/dist/whitelist.js.map +1 -1
- package/dist/workspace.d.ts +16 -0
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +3 -3
- package/dist/workspace.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compound.js","sourceRoot":"","sources":["../src/compound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,EAA2C,MAAM,eAAe,CAAC;AAChI,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAyD3D,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,MAAc,EAAmB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;AAEhI,iEAAiE;AACjE,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IAClD,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE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,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAClE,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,MAAM,GAAG,GAA8B,CAAC;IAC9C,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3E,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,SAAS,EAAE,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;QAC9F,GAAG,CAAC,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChH,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,12 +10,14 @@ import { type CommandScope } from './commands.ts';
|
|
|
10
10
|
import { type OriginScope } from './origins.ts';
|
|
11
11
|
import { type ToolGrant } from './grants.ts';
|
|
12
12
|
import { type DestinationGrant } from './destinations.ts';
|
|
13
|
-
import { type
|
|
13
|
+
import { type CommandNameGrant } from './compound.ts';
|
|
14
|
+
import { type CommandNameStore, type CommandWhitelistStore, type DestinationWhitelistStore, type OriginWhitelistStore, type ToolGrantStore } from './whitelist.ts';
|
|
14
15
|
export { analyzeCommand, commandScopeFromPrefix, describeCommandScope, findCoveringScopes, findMatchingScope, matchesScope, normalizeCommandScope, NUMERIC_FLAG, parseCommandScope, sameScope, SAFE_COMMAND_SCOPES, type CommandAnalysis, type CommandScope, } from './commands.ts';
|
|
15
16
|
export { describeOriginScope, findMatchingOriginScope, matchesOriginScope, originScopeFor, parseOriginScope, sameOriginScope, normalizeTrustedDomain, SHARED_SUFFIXES, trustedDomainProblem, trustedDomainOf, type OriginScope, } from './origins.ts';
|
|
16
17
|
export { describeToolGrant, findMatchingToolGrant, matchesToolGrant, parseToolGrant, sameToolGrant, type ToolGrant, } from './grants.ts';
|
|
17
18
|
export { describeDestinationGrant, findMatchingDestinationGrant, matchesDestinationGrant, parseDestinationGrant, sameDestinationGrant, type DestinationGrant, } from './destinations.ts';
|
|
18
|
-
export { createFileCommandWhitelist, describeAgentGrants, whitelistPathFor, LEGACY_WHITELIST_SUFFIX, legacyWhitelistPathFor, resolveWhitelistPath, WhitelistUnreadableError, type AgentGrants, type AgentGrantsListing, type AgentGrantStore, type CommandWhitelistStore, type DestinationWhitelistStore, type OriginWhitelistStore, type ToolGrantStore, } from './whitelist.ts';
|
|
19
|
+
export { createFileCommandWhitelist, describeAgentGrants, whitelistPathFor, LEGACY_WHITELIST_SUFFIX, legacyWhitelistPathFor, resolveWhitelistPath, WhitelistUnreadableError, type AgentGrants, type AgentGrantsListing, type AgentGrantStore, type CommandNameStore, type CommandWhitelistStore, type DestinationWhitelistStore, type OriginWhitelistStore, type ToolGrantStore, } from './whitelist.ts';
|
|
20
|
+
export { analyzeCompound, GRANTABLE_BY_NAME, grantableByName, judgeCompound, NOT_GRANTABLE_BY_NAME, parseCommandNameGrant, SUBCOMMAND_COMMANDS, type CommandNameGrant, type CompoundCommand, type CompoundJudgement, type CompoundStage, type Redirect, } from './compound.ts';
|
|
19
21
|
/**
|
|
20
22
|
* How a policy reaches a human — or admits that it cannot.
|
|
21
23
|
*
|
|
@@ -223,6 +225,14 @@ export interface PermissionPolicyOptions {
|
|
|
223
225
|
* Everything else asks, and `headless` refuses.
|
|
224
226
|
*/
|
|
225
227
|
gateExternalContent?: (agentId: string) => boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Whether this agent's gated calls run without asking: the operator's
|
|
230
|
+
* `approvals.posture: "open"`, read per call like the gate above. A
|
|
231
|
+
* `dangerous` call still asks, and a conversation the gate above has
|
|
232
|
+
* closed (it read external content with `gate` on) goes back to the
|
|
233
|
+
* scope-and-grant path. Omitted, or answering false, nothing changes.
|
|
234
|
+
*/
|
|
235
|
+
openFor?: (agentId: string) => boolean;
|
|
226
236
|
}
|
|
227
237
|
export interface ToolGrantOptions {
|
|
228
238
|
/** Where "always allow" persists a tool grant, and where one is read back. */
|
|
@@ -283,7 +293,53 @@ export interface DestinationScopeOptions {
|
|
|
283
293
|
agentId: string;
|
|
284
294
|
grant: DestinationGrant;
|
|
285
295
|
}) => void;
|
|
296
|
+
/**
|
|
297
|
+
* The operator's standing channel authorization for this agent
|
|
298
|
+
* (`approvals.channels`): destinations where `message.read` and
|
|
299
|
+
* `message.send` run without asking: `channel:<workspace>/<id>`
|
|
300
|
+
* (`slack:T0123ABCD/C0123ABCD`), `channel:<workspace>/*`, or `channel:*`
|
|
301
|
+
* for every channel of that kind the agent's app can reach. Read per
|
|
302
|
+
* call. See `matchesStandingChannel`.
|
|
303
|
+
*/
|
|
304
|
+
standingChannelsFor?(agentId: string): readonly string[];
|
|
305
|
+
/**
|
|
306
|
+
* What kind of conversation a destination is, asked of the agent's own
|
|
307
|
+
* channel app: `channel` for a public or private channel, `direct` for a
|
|
308
|
+
* DM or group DM. Undefined when the channel cannot say (not connected,
|
|
309
|
+
* not visible to the app, a lookup that failed). The standing channel
|
|
310
|
+
* authorization covers `channel` only, so a DM, and anything unknown,
|
|
311
|
+
* still asks.
|
|
312
|
+
*/
|
|
313
|
+
conversationKindFor?(agentId: string, destination: string): ConversationKind | undefined | Promise<ConversationKind | undefined>;
|
|
286
314
|
}
|
|
315
|
+
/** See `DestinationScopeOptions.conversationKindFor`. */
|
|
316
|
+
export type ConversationKind = 'channel' | 'direct';
|
|
317
|
+
/**
|
|
318
|
+
* The tools an operator's standing channel authorization covers. Kernel
|
|
319
|
+
* tools only: a plugin tool registered under the same name is a different
|
|
320
|
+
* tool and is judged the usual way.
|
|
321
|
+
*/
|
|
322
|
+
export declare const STANDING_CHANNEL_TOOLS: readonly string[];
|
|
323
|
+
/**
|
|
324
|
+
* Whether a configured `approvals.channels` entry covers a destination in
|
|
325
|
+
* the workspace the agent's app is connected to right now (`account`, see
|
|
326
|
+
* `DestinationScopeOptions.accountFor`):
|
|
327
|
+
*
|
|
328
|
+
* - `channel:*`: every conversation of that kind the app can reach, in
|
|
329
|
+
* whatever workspace it is in.
|
|
330
|
+
* - `channel:<workspace>/<id>`: that conversation, only while the app is in
|
|
331
|
+
* that workspace. A conversation id is unique only within its workspace,
|
|
332
|
+
* so an id is bound to one, the same way an Always-allow grant is.
|
|
333
|
+
* - `channel:<workspace>/*`: every conversation of that kind in that
|
|
334
|
+
* workspace.
|
|
335
|
+
*
|
|
336
|
+
* A bare `channel:<id>` names no workspace and covers nothing; the daemon
|
|
337
|
+
* says so at startup (`unboundStandingChannels`). The kind check (channels
|
|
338
|
+
* yes, DMs no) is the caller's.
|
|
339
|
+
*/
|
|
340
|
+
export declare const matchesStandingChannel: (destination: string, account: string | undefined, entries: readonly string[]) => boolean;
|
|
341
|
+
/** Entries that name a conversation without its workspace, which `matchesStandingChannel` never matches. */
|
|
342
|
+
export declare const unboundStandingChannels: (entries: readonly string[]) => string[];
|
|
287
343
|
export interface CommandScopeOptions {
|
|
288
344
|
/**
|
|
289
345
|
* Scopes that run unattended. Defaults to `SAFE_COMMAND_SCOPES`; pass a
|
|
@@ -292,6 +348,21 @@ export interface CommandScopeOptions {
|
|
|
292
348
|
safeScopes?: readonly CommandScope[];
|
|
293
349
|
/** Where "always allow" persists a scope, and where one is read back. */
|
|
294
350
|
whitelist?: CommandWhitelistStore;
|
|
351
|
+
/**
|
|
352
|
+
* Where "always allow" persists a grant on a command by name (`grep`),
|
|
353
|
+
* and where one is read back. Omitted, such a grant lasts for this
|
|
354
|
+
* process. Only used with `grantRootFor`, since a by-name grant means
|
|
355
|
+
* nothing without a workspace to keep it in.
|
|
356
|
+
*/
|
|
357
|
+
names?: CommandNameStore;
|
|
358
|
+
/**
|
|
359
|
+
* The agent's workspace, whether or not autonomy is on for it: where a
|
|
360
|
+
* by-name grant may point, where a compound command may redirect output,
|
|
361
|
+
* and where `cat`, `head`, `tail` and `ls` read without asking. Undefined
|
|
362
|
+
* for an agent turns all of that off, and "always" stores the narrower
|
|
363
|
+
* scope it did before.
|
|
364
|
+
*/
|
|
365
|
+
grantRootFor?(agentId: string): string | undefined;
|
|
295
366
|
/**
|
|
296
367
|
* Workspace autonomy. Answers the directory an agent may read in without
|
|
297
368
|
* asking, or undefined when autonomy is off for it. With an answer, a
|
|
@@ -316,6 +387,11 @@ export interface CommandScopeOptions {
|
|
|
316
387
|
agentId: string;
|
|
317
388
|
scope: CommandScope;
|
|
318
389
|
}) => void;
|
|
390
|
+
/** Called when a command is granted by name, for the same reason. */
|
|
391
|
+
onCommandNameRemembered?: (event: {
|
|
392
|
+
agentId: string;
|
|
393
|
+
grant: CommandNameGrant;
|
|
394
|
+
}) => void;
|
|
319
395
|
}
|
|
320
396
|
export interface OriginScopeOptions {
|
|
321
397
|
/**
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EAEd,eAAe,EACf,cAAc,EAGd,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,QAAQ,EACT,MAAM,oBAAoB,CAAC;AAG5B;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3H,OAAO,EAQL,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,KAAK,WAAW,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,KAAK,SAAS,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,gBAAgB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings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AE,oBAAoB,CAAC;IACjC,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7E;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,CAAC;IAC3D,gEAAgE;IAChE,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAoQD,eAAO,MAAM,sBAAsB,GAAI,SAAS,uBAAuB,KAAG,cAw6BzE,CAAC;AAEF,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,6BAA6B,EAC7B,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -11,12 +11,67 @@ import { analyzeCommand, describeCommandScope, findCoveringScopes, findMatchingS
|
|
|
11
11
|
import { describeOriginScope, findMatchingOriginScope, originScopeFor, trustedDomainOf, } from "./origins.js";
|
|
12
12
|
import { describeToolGrant, findMatchingToolGrant, } from "./grants.js";
|
|
13
13
|
import { describeDestinationGrant, findMatchingDestinationGrant, } from "./destinations.js";
|
|
14
|
+
import { analyzeCompound, compoundCommandNames, grantableByName, judgeCompound, NOT_GRANTABLE_BY_NAME, } from "./compound.js";
|
|
14
15
|
import { WhitelistUnreadableError, } from "./whitelist.js";
|
|
15
16
|
export { analyzeCommand, commandScopeFromPrefix, describeCommandScope, findCoveringScopes, findMatchingScope, matchesScope, normalizeCommandScope, NUMERIC_FLAG, parseCommandScope, sameScope, SAFE_COMMAND_SCOPES, } from "./commands.js";
|
|
16
17
|
export { describeOriginScope, findMatchingOriginScope, matchesOriginScope, originScopeFor, parseOriginScope, sameOriginScope, normalizeTrustedDomain, SHARED_SUFFIXES, trustedDomainProblem, trustedDomainOf, } from "./origins.js";
|
|
17
18
|
export { describeToolGrant, findMatchingToolGrant, matchesToolGrant, parseToolGrant, sameToolGrant, } from "./grants.js";
|
|
18
19
|
export { describeDestinationGrant, findMatchingDestinationGrant, matchesDestinationGrant, parseDestinationGrant, sameDestinationGrant, } from "./destinations.js";
|
|
19
20
|
export { createFileCommandWhitelist, describeAgentGrants, whitelistPathFor, LEGACY_WHITELIST_SUFFIX, legacyWhitelistPathFor, resolveWhitelistPath, WhitelistUnreadableError, } from "./whitelist.js";
|
|
21
|
+
export { analyzeCompound, GRANTABLE_BY_NAME, grantableByName, judgeCompound, NOT_GRANTABLE_BY_NAME, parseCommandNameGrant, SUBCOMMAND_COMMANDS, } from "./compound.js";
|
|
22
|
+
/**
|
|
23
|
+
* The tools an operator's standing channel authorization covers. Kernel
|
|
24
|
+
* tools only: a plugin tool registered under the same name is a different
|
|
25
|
+
* tool and is judged the usual way.
|
|
26
|
+
*/
|
|
27
|
+
export const STANDING_CHANNEL_TOOLS = ['message.read', 'message.send'];
|
|
28
|
+
/**
|
|
29
|
+
* Whether a configured `approvals.channels` entry covers a destination in
|
|
30
|
+
* the workspace the agent's app is connected to right now (`account`, see
|
|
31
|
+
* `DestinationScopeOptions.accountFor`):
|
|
32
|
+
*
|
|
33
|
+
* - `channel:*`: every conversation of that kind the app can reach, in
|
|
34
|
+
* whatever workspace it is in.
|
|
35
|
+
* - `channel:<workspace>/<id>`: that conversation, only while the app is in
|
|
36
|
+
* that workspace. A conversation id is unique only within its workspace,
|
|
37
|
+
* so an id is bound to one, the same way an Always-allow grant is.
|
|
38
|
+
* - `channel:<workspace>/*`: every conversation of that kind in that
|
|
39
|
+
* workspace.
|
|
40
|
+
*
|
|
41
|
+
* A bare `channel:<id>` names no workspace and covers nothing; the daemon
|
|
42
|
+
* says so at startup (`unboundStandingChannels`). The kind check (channels
|
|
43
|
+
* yes, DMs no) is the caller's.
|
|
44
|
+
*/
|
|
45
|
+
export const matchesStandingChannel = (destination, account, entries) => {
|
|
46
|
+
const separator = destination.indexOf(':');
|
|
47
|
+
if (separator <= 0 || separator === destination.length - 1) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
const kind = destination.slice(0, separator);
|
|
51
|
+
const to = destination.slice(separator + 1);
|
|
52
|
+
return entries.some((entry) => {
|
|
53
|
+
if (entry === `${kind}:*`) {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
if (!entry.startsWith(`${kind}:`) || account === undefined || account.length === 0) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
const scoped = entry.slice(kind.length + 1);
|
|
60
|
+
const slash = scoped.indexOf('/');
|
|
61
|
+
if (slash <= 0) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
const workspace = scoped.slice(0, slash);
|
|
65
|
+
const id = scoped.slice(slash + 1);
|
|
66
|
+
return workspace === account && (id === '*' || id === to);
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
/** Entries that name a conversation without its workspace, which `matchesStandingChannel` never matches. */
|
|
70
|
+
export const unboundStandingChannels = (entries) => entries.filter((entry) => {
|
|
71
|
+
const separator = entry.indexOf(':');
|
|
72
|
+
const rest = entry.slice(separator + 1);
|
|
73
|
+
return separator > 0 && rest !== '*' && !rest.includes('/');
|
|
74
|
+
});
|
|
20
75
|
/** The tool whose origin grants also cover a plain download of that site. */
|
|
21
76
|
const READ_ORIGIN_TOOL = 'web.fetch';
|
|
22
77
|
const YES = new Set(['y', 'yes', 'always', 'a']);
|
|
@@ -243,7 +298,7 @@ const commandNames = (analysis) => {
|
|
|
243
298
|
return analysis.base;
|
|
244
299
|
};
|
|
245
300
|
export const createPermissionPolicy = (options) => {
|
|
246
|
-
const { mode, ask, request, onDecision, commands, destinations, origins, grants, gateExternalContent } = options;
|
|
301
|
+
const { mode, ask, request, onDecision, commands, destinations, origins, grants, gateExternalContent, openFor } = options;
|
|
247
302
|
if (mode === 'interactive' && !ask) {
|
|
248
303
|
throw new Error('interactive permission mode needs an `ask` function to reach a human.');
|
|
249
304
|
}
|
|
@@ -263,6 +318,8 @@ export const createPermissionPolicy = (options) => {
|
|
|
263
318
|
// grant lives, so revoking it there is the next call's answer, rather
|
|
264
319
|
// than a promise the daemon keeps only until its next restart.
|
|
265
320
|
const sessionScopes = new Map();
|
|
321
|
+
/** The same tier for commands granted by name. */
|
|
322
|
+
const sessionNames = new Map();
|
|
266
323
|
/** The same tier for origins, and for the same reason. */
|
|
267
324
|
const sessionOrigins = new Map();
|
|
268
325
|
/** And for standing tool grants. */
|
|
@@ -306,6 +363,12 @@ export const createPermissionPolicy = (options) => {
|
|
|
306
363
|
if (risk === 'safe') {
|
|
307
364
|
return report(context, true, `${call.toolName} is safe and runs without approval`);
|
|
308
365
|
}
|
|
366
|
+
if (risk === 'gated' && openFor?.(session.agent.id) === true) {
|
|
367
|
+
const closedByContent = sessionTrustOf(session) === 'external' && gateExternalContent?.(session.agent.id) === true;
|
|
368
|
+
if (!closedByContent) {
|
|
369
|
+
return report(context, true, `${call.toolName} runs without asking (approvals.posture is open)`);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
309
372
|
// What this *invocation* would run, for a tool whose danger lives in
|
|
310
373
|
// its arguments. Resolved before anything else so that the tool-wide
|
|
311
374
|
// "always" below can never apply to it: one yes to `git status` must
|
|
@@ -366,6 +429,35 @@ export const createPermissionPolicy = (options) => {
|
|
|
366
429
|
// exists to refuse before the turn starts.
|
|
367
430
|
const externalGate = sessionTrustOf(session) === 'external'
|
|
368
431
|
&& gateExternalContent?.(session.agent.id) === true;
|
|
432
|
+
/**
|
|
433
|
+
* Workspace autonomy for one command in one directory: a read inside
|
|
434
|
+
* it, local git, a plain download from a readable site, or a push of
|
|
435
|
+
* the agent's own branch. Shared by the single-command path and the
|
|
436
|
+
* compound one, so the two cannot drift.
|
|
437
|
+
*/
|
|
438
|
+
const autonomousStage = async (stage, cwd, workspace) => {
|
|
439
|
+
if (await readsInsideWorkspace(stage, cwd, workspace)) {
|
|
440
|
+
return true;
|
|
441
|
+
}
|
|
442
|
+
// Local git changes things, so it's a grant like any other
|
|
443
|
+
// to a conversation the external-content gate has closed.
|
|
444
|
+
if (!externalGate && await gitInsideWorkspace(stage, cwd, workspace)) {
|
|
445
|
+
return true;
|
|
446
|
+
}
|
|
447
|
+
// A plain download from a site the agent may already read:
|
|
448
|
+
// a trusted domain, or one approved for `web.fetch`. Granted
|
|
449
|
+
// trust, so not to a conversation the gate has closed.
|
|
450
|
+
// And not for an agent the gate is on for at all: the shell
|
|
451
|
+
// marks its output `unknown`, not `external`, so a page read
|
|
452
|
+
// this way would never close the gate it exists to close.
|
|
453
|
+
const gated = gateExternalContent?.(session.agent.id) === true;
|
|
454
|
+
const site = gated ? undefined : await downloadInsideWorkspace(stage, cwd, workspace);
|
|
455
|
+
if (site !== undefined && await readableSite(session.agent.id, site)) {
|
|
456
|
+
return true;
|
|
457
|
+
}
|
|
458
|
+
const prefixes = commands?.workspace?.branchPrefixesFor?.(session.agent.id) ?? [`${session.agent.id}/`];
|
|
459
|
+
return !externalGate && await gitPushInsideWorkspace(stage, cwd, workspace, prefixes);
|
|
460
|
+
};
|
|
369
461
|
const command = risk === 'gated' && singlyScoped
|
|
370
462
|
? context.tool.commandFor?.(call.input)
|
|
371
463
|
: undefined;
|
|
@@ -415,15 +507,14 @@ export const createPermissionPolicy = (options) => {
|
|
|
415
507
|
const destination = risk === 'gated' && singlyScoped
|
|
416
508
|
? context.tool.destinationFor?.(call.input)
|
|
417
509
|
: undefined;
|
|
510
|
+
// The agent's workspace for by-name grants and compound commands, and
|
|
511
|
+
// how a compound reading of this command was judged. Kept for the
|
|
512
|
+
// question below: what "always" would grant depends on which of its
|
|
513
|
+
// commands nothing covered.
|
|
514
|
+
const grantRoot = analysis ? commands?.grantRootFor?.(session.agent.id) : undefined;
|
|
515
|
+
let judgement;
|
|
418
516
|
if (analysis) {
|
|
419
|
-
if (analysis.disqualifiedBy) {
|
|
420
|
-
// Never auto-approved, whatever the base command is: a safe scope
|
|
421
|
-
// in front of a pipe is the exact shape this rule exists for.
|
|
422
|
-
if (mode === 'headless') {
|
|
423
|
-
return report(context, false, `${call.toolName} cannot run unattended: ${analysis.disqualifiedBy}`, command);
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
else {
|
|
517
|
+
if (!analysis.disqualifiedBy) {
|
|
427
518
|
// The built-in safe scopes survive the gate and granted ones do
|
|
428
519
|
// not: `git status` was judged safe for any caller, while a
|
|
429
520
|
// granted `git push` was judged for an agent nobody else was
|
|
@@ -469,30 +560,7 @@ export const createPermissionPolicy = (options) => {
|
|
|
469
560
|
if (findMatchingScope(stage, intrinsic)) {
|
|
470
561
|
continue;
|
|
471
562
|
}
|
|
472
|
-
if (await
|
|
473
|
-
read = true;
|
|
474
|
-
continue;
|
|
475
|
-
}
|
|
476
|
-
// Local git changes things, so it's a grant like any other
|
|
477
|
-
// to a conversation the external-content gate has closed.
|
|
478
|
-
if (!externalGate && await gitInsideWorkspace(stage, cwd, workspace)) {
|
|
479
|
-
read = true;
|
|
480
|
-
continue;
|
|
481
|
-
}
|
|
482
|
-
// A plain download from a site the agent may already read:
|
|
483
|
-
// a trusted domain, or one approved for `web.fetch`. Granted
|
|
484
|
-
// trust, so not to a conversation the gate has closed.
|
|
485
|
-
// And not for an agent the gate is on for at all: the shell
|
|
486
|
-
// marks its output `unknown`, not `external`, so a page read
|
|
487
|
-
// this way would never close the gate it exists to close.
|
|
488
|
-
const gated = gateExternalContent?.(session.agent.id) === true;
|
|
489
|
-
const site = gated ? undefined : await downloadInsideWorkspace(stage, cwd, workspace);
|
|
490
|
-
if (site !== undefined && await readableSite(session.agent.id, site)) {
|
|
491
|
-
read = true;
|
|
492
|
-
continue;
|
|
493
|
-
}
|
|
494
|
-
const prefixes = commands?.workspace?.branchPrefixesFor?.(session.agent.id) ?? [`${session.agent.id}/`];
|
|
495
|
-
if (!externalGate && await gitPushInsideWorkspace(stage, cwd, workspace, prefixes)) {
|
|
563
|
+
if (await autonomousStage(stage, cwd, workspace)) {
|
|
496
564
|
read = true;
|
|
497
565
|
continue;
|
|
498
566
|
}
|
|
@@ -504,6 +572,53 @@ export const createPermissionPolicy = (options) => {
|
|
|
504
572
|
}
|
|
505
573
|
}
|
|
506
574
|
}
|
|
575
|
+
// A compound reading: a chain, redirections, a command granted by
|
|
576
|
+
// name. Every command must run on its own terms; see `compound.ts`.
|
|
577
|
+
const compound = analyzeCompound(command);
|
|
578
|
+
if (!compound.disqualifiedBy) {
|
|
579
|
+
const intrinsic = commands?.safeScopes === undefined
|
|
580
|
+
? SAFE_COMMAND_SCOPES
|
|
581
|
+
: commands.safeScopes.filter((scope) => SAFE_COMMAND_SCOPES.includes(scope));
|
|
582
|
+
// A host's additions to the safe list survive the gate, as they do
|
|
583
|
+
// above, but compose like a grant: alone, or among scopes.
|
|
584
|
+
const hostScopes = (commands?.safeScopes ?? []).filter((scope) => !SAFE_COMMAND_SCOPES.includes(scope));
|
|
585
|
+
const autonomy = commands?.workspace?.directoryFor(session.agent.id);
|
|
586
|
+
judgement = await judgeCompound(compound, {
|
|
587
|
+
cwd: context.tool.cwdFor?.(session),
|
|
588
|
+
root: grantRoot,
|
|
589
|
+
safeScopes: intrinsic,
|
|
590
|
+
scopes: [
|
|
591
|
+
...(externalGate
|
|
592
|
+
? []
|
|
593
|
+
: [
|
|
594
|
+
...(sessionScopes.get(session.agent.id) ?? []),
|
|
595
|
+
...(commands?.whitelist ? await commands.whitelist.scopesFor(session.agent.id) : []),
|
|
596
|
+
]),
|
|
597
|
+
...hostScopes,
|
|
598
|
+
],
|
|
599
|
+
// Granted, so withdrawn by the gate like any other grant.
|
|
600
|
+
names: externalGate || grantRoot === undefined
|
|
601
|
+
? []
|
|
602
|
+
: [
|
|
603
|
+
...(sessionNames.get(session.agent.id) ?? []),
|
|
604
|
+
...(commands?.names ? await commands.names.commandNamesFor(session.agent.id) : []),
|
|
605
|
+
].map((grant) => grant.command),
|
|
606
|
+
...(autonomy !== undefined
|
|
607
|
+
? { autonomous: (stage, cwd) => autonomousStage(stage, cwd, autonomy) }
|
|
608
|
+
: {}),
|
|
609
|
+
reads: readsInsideWorkspace,
|
|
610
|
+
});
|
|
611
|
+
if (judgement.covered) {
|
|
612
|
+
const names = compoundCommandNames(compound.pipelines.flat());
|
|
613
|
+
return report(context, true, `${call.toolName} ran ${names.join(', ')}, each inside what ${session.agent.id} may run unattended`, command);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
else if (analysis.disqualifiedBy && mode === 'headless') {
|
|
617
|
+
// Never auto-approved, whatever the base command is: a safe scope
|
|
618
|
+
// in front of a backgrounding `&` is the exact shape this rule
|
|
619
|
+
// exists for.
|
|
620
|
+
return report(context, false, `${call.toolName} cannot run unattended: ${analysis.disqualifiedBy}`, command);
|
|
621
|
+
}
|
|
507
622
|
}
|
|
508
623
|
else if (risk === 'gated' && unscoped && !externalGate) {
|
|
509
624
|
// The standing grant: this process's answers first, then the file.
|
|
@@ -540,6 +655,23 @@ export const createPermissionPolicy = (options) => {
|
|
|
540
655
|
return report(context, true, `${call.toolName} to ${destination} ran under a standing grant for ${session.agent.id}`, undefined, destination, undefined, undefined, standing);
|
|
541
656
|
}
|
|
542
657
|
}
|
|
658
|
+
// The operator's standing channel authorization (`approvals.channels`):
|
|
659
|
+
// a read or a post in a channel the config names runs without asking,
|
|
660
|
+
// in every session, interactive, scheduled, or delegated. Only a
|
|
661
|
+
// conversation the agent's own app reports as a channel: a DM or group
|
|
662
|
+
// DM, or one it cannot describe, falls through and asks as before.
|
|
663
|
+
// Membership and scopes are still the channel's to enforce when the
|
|
664
|
+
// tool runs. Withdrawn by the external-content gate like every other
|
|
665
|
+
// standing yes, so a page the conversation read cannot steer a post.
|
|
666
|
+
if (destination !== undefined
|
|
667
|
+
&& !externalGate
|
|
668
|
+
&& contributor === undefined
|
|
669
|
+
&& context.tool.name === call.toolName
|
|
670
|
+
&& STANDING_CHANNEL_TOOLS.includes(call.toolName)
|
|
671
|
+
&& matchesStandingChannel(destination, account, destinations?.standingChannelsFor?.(session.agent.id) ?? [])
|
|
672
|
+
&& await destinations?.conversationKindFor?.(session.agent.id, destination) === 'channel') {
|
|
673
|
+
return report(context, true, `${call.toolName} to ${destination} ran under the operator's standing channel authorization (approvals.channels)`, undefined, destination);
|
|
674
|
+
}
|
|
543
675
|
if (origin !== undefined) {
|
|
544
676
|
const granted = findMatchingOriginScope(origin, grantedOrigins, call.toolName);
|
|
545
677
|
if (granted) {
|
|
@@ -617,6 +749,41 @@ export const createPermissionPolicy = (options) => {
|
|
|
617
749
|
// after the answer so the question can say so; it is a pure function
|
|
618
750
|
// of the analysis, and the branch below reuses this exact value.
|
|
619
751
|
const commandScope = analysis ? normalizeCommandScope(analysis) : undefined;
|
|
752
|
+
// With a workspace to hold them, "always" grants what this line was
|
|
753
|
+
// missing instead: each command nothing covered, by name where that
|
|
754
|
+
// is safe (`grep`) and as the narrower scope where it is not (`git
|
|
755
|
+
// push`). Nothing, when one of them cannot be granted either way or
|
|
756
|
+
// what blocked the line was not a command — output sent outside the
|
|
757
|
+
// workspace, a directory this reader could not follow — since a grant
|
|
758
|
+
// that would not make the line run is not one to offer.
|
|
759
|
+
const plan = (() => {
|
|
760
|
+
if (judgement === undefined || grantRoot === undefined || judgement.unfixable || judgement.uncovered.length === 0) {
|
|
761
|
+
return undefined;
|
|
762
|
+
}
|
|
763
|
+
const names = [];
|
|
764
|
+
const scopes = [];
|
|
765
|
+
// A command alone keeps the narrower scope it always could (`python3
|
|
766
|
+
// scripts/check.py`). In a line with others, a shell, interpreter or
|
|
767
|
+
// wrapper gets nothing: `… | sh` is the shape a grant must not learn.
|
|
768
|
+
const alone = analyzeCompound(command).pipelines.flat().length === 1;
|
|
769
|
+
for (const stage of judgement.uncovered) {
|
|
770
|
+
const base = stage.analysis.base;
|
|
771
|
+
if (base !== undefined && grantableByName(base)) {
|
|
772
|
+
names.push(base);
|
|
773
|
+
continue;
|
|
774
|
+
}
|
|
775
|
+
if (!alone && base !== undefined && NOT_GRANTABLE_BY_NAME.has(base)) {
|
|
776
|
+
return undefined;
|
|
777
|
+
}
|
|
778
|
+
const scope = normalizeCommandScope(stage.analysis);
|
|
779
|
+
if (scope === undefined) {
|
|
780
|
+
return undefined;
|
|
781
|
+
}
|
|
782
|
+
scopes.push(scope);
|
|
783
|
+
}
|
|
784
|
+
return { names: [...new Set(names)], scopes };
|
|
785
|
+
})();
|
|
786
|
+
const usePlan = judgement !== undefined && grantRoot !== undefined;
|
|
620
787
|
// A gated conversation cannot mint a grant either: the request in
|
|
621
788
|
// front of the approver was composed after a page had its say, and
|
|
622
789
|
// "always" there would let the page talk a person into exactly the
|
|
@@ -625,7 +792,7 @@ export const createPermissionPolicy = (options) => {
|
|
|
625
792
|
|| externalGate
|
|
626
793
|
|| multiplyScoped
|
|
627
794
|
|| (scopedByOrigin && origin === undefined)
|
|
628
|
-
|| (analysis !== undefined && commandScope === undefined);
|
|
795
|
+
|| (analysis !== undefined && (usePlan ? plan === undefined : commandScope === undefined));
|
|
629
796
|
// Which kind of grant `always` creates, as data for the transport and
|
|
630
797
|
// as words for the prompt — the same decision, made once, so the two
|
|
631
798
|
// surfaces cannot promise different lifetimes for the same answer.
|
|
@@ -651,7 +818,10 @@ export const createPermissionPolicy = (options) => {
|
|
|
651
818
|
? 'not remembered — this command cannot be reduced to a scope'
|
|
652
819
|
: 'not remembered — there is no page to grant'
|
|
653
820
|
: always === 'scope'
|
|
654
|
-
?
|
|
821
|
+
? usePlan && plan !== undefined
|
|
822
|
+
? `always ${[...plan.names, ...plan.scopes.map(describeCommandScope)].join(', ')} for ${session.agent.name}`
|
|
823
|
+
+ `${plan.names.length > 0 ? ', inside its workspace' : ''}, until revoked`
|
|
824
|
+
: 'always this scope'
|
|
655
825
|
: always === 'origin'
|
|
656
826
|
? 'always this site'
|
|
657
827
|
: always === 'tool'
|
|
@@ -750,6 +920,59 @@ export const createPermissionPolicy = (options) => {
|
|
|
750
920
|
}
|
|
751
921
|
return allowUnlessMoved(`${call.toolName} was approved, and ${describeOriginScope(grant)} is now acted on without asking`);
|
|
752
922
|
}
|
|
923
|
+
if (usePlan) {
|
|
924
|
+
if (plan === undefined) {
|
|
925
|
+
return allowUnlessMoved(`${call.toolName} was approved once; it cannot be reduced to grants, so it will ask again`, command);
|
|
926
|
+
}
|
|
927
|
+
const agentId = session.agent.id;
|
|
928
|
+
const saved = [];
|
|
929
|
+
let unsaved;
|
|
930
|
+
for (const name of plan.names) {
|
|
931
|
+
const grant = {
|
|
932
|
+
command: name,
|
|
933
|
+
grantedAt: new Date().toISOString(),
|
|
934
|
+
...(actor !== undefined ? { grantedBy: actor } : {}),
|
|
935
|
+
};
|
|
936
|
+
if (commands?.names && unsaved === undefined) {
|
|
937
|
+
try {
|
|
938
|
+
await commands.names.rememberCommandName(agentId, grant);
|
|
939
|
+
commands.onCommandNameRemembered?.({ agentId, grant });
|
|
940
|
+
saved.push(name);
|
|
941
|
+
continue;
|
|
942
|
+
}
|
|
943
|
+
catch (error) {
|
|
944
|
+
if (!(error instanceof WhitelistUnreadableError)) {
|
|
945
|
+
throw error;
|
|
946
|
+
}
|
|
947
|
+
unsaved = error.message;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
rememberForProcess(sessionNames, agentId, grant);
|
|
951
|
+
saved.push(name);
|
|
952
|
+
}
|
|
953
|
+
for (const scope of plan.scopes) {
|
|
954
|
+
if (commands?.whitelist && unsaved === undefined) {
|
|
955
|
+
try {
|
|
956
|
+
await commands.whitelist.remember(agentId, scope);
|
|
957
|
+
commands.onScopeRemembered?.({ agentId, scope });
|
|
958
|
+
saved.push(describeCommandScope(scope));
|
|
959
|
+
continue;
|
|
960
|
+
}
|
|
961
|
+
catch (error) {
|
|
962
|
+
if (!(error instanceof WhitelistUnreadableError)) {
|
|
963
|
+
throw error;
|
|
964
|
+
}
|
|
965
|
+
unsaved = error.message;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
rememberForProcess(sessionScopes, agentId, scope);
|
|
969
|
+
saved.push(describeCommandScope(scope));
|
|
970
|
+
}
|
|
971
|
+
const list = saved.map((entry) => `"${entry}"`).join(', ');
|
|
972
|
+
return allowUnlessMoved(unsaved === undefined
|
|
973
|
+
? `${call.toolName} was approved, and ${list} now run${saved.length === 1 ? 's' : ''} without asking`
|
|
974
|
+
: `${call.toolName} was approved, and ${list} run without asking for ${agentId} until the daemon restarts — not saved: ${unsaved}`, command);
|
|
975
|
+
}
|
|
753
976
|
const scope = commandScope;
|
|
754
977
|
if (analysis && !scope) {
|
|
755
978
|
// A command this parser could not reduce to a scope — a pipe, a
|