@wyattjoh/demur 0.4.0 → 0.4.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 +1 -1
- package/package.json +1 -1
- package/src/questions.ts +20 -22
package/README.md
CHANGED
package/package.json
CHANGED
package/src/questions.ts
CHANGED
|
@@ -21,62 +21,60 @@ import { Decision } from "effect/unstable/ai";
|
|
|
21
21
|
export const QUESTIONS = {
|
|
22
22
|
executesDestruction: Decision.probability({
|
|
23
23
|
instructions:
|
|
24
|
-
"
|
|
24
|
+
"Will this command actually change existing state, rather than only read, search, print, list, query, or check?",
|
|
25
25
|
criteria: {
|
|
26
|
-
true: "
|
|
26
|
+
true: "It removes, overwrites, moves, resets, or reconfigures existing files, permissions, ownership, processes, containers, or remote resources, including through a shell, interpreter, wrapper, substitution, alias, or executable glob.",
|
|
27
27
|
false:
|
|
28
|
-
"It only reads
|
|
28
|
+
"It only reads or reports. Destructive-looking text is inert when used as search text, a read-only argument, printed or network payload, heredoc data, a comment, or documentation.",
|
|
29
29
|
},
|
|
30
30
|
}),
|
|
31
31
|
|
|
32
32
|
exposesSensitiveData: Decision.probability({
|
|
33
33
|
instructions:
|
|
34
|
-
"
|
|
34
|
+
"Will this command disclose an actual secret, credential, authentication material, or personal-data value to the agent or another recipient?",
|
|
35
35
|
criteria: {
|
|
36
|
-
true: "It reads
|
|
36
|
+
true: "It reads a value from an environment variable, file, credential or secret store, database, or remote system and prints, logs, copies, or transmits it. Read-only output still counts.",
|
|
37
37
|
false:
|
|
38
|
-
"It only names
|
|
38
|
+
"It reveals only names, metadata, schema, attributes, or redacted values; rotates or revokes without revealing; or quotes or prints secret-looking names or commands as documentation, comments, or other inert payload.",
|
|
39
39
|
},
|
|
40
40
|
}),
|
|
41
41
|
|
|
42
42
|
weakensSecurityBoundary: Decision.probability({
|
|
43
43
|
instructions:
|
|
44
|
-
"
|
|
44
|
+
"Will this command weaken or bypass a security control, conceal a bypass, grant elevated access, or make a sensitive resource more permissive?",
|
|
45
45
|
criteria: {
|
|
46
|
-
true: "
|
|
46
|
+
true: "It disables or evades authentication, authorization, policy, auditing, MFA, SSO, or firewall controls; grants admin, root, or sudo access; hides a bypass; or broadens sensitive access.",
|
|
47
47
|
false:
|
|
48
|
-
"It only inspects
|
|
48
|
+
"It only inspects controls; enables or strengthens them; revokes or narrows access; makes an ordinary non-elevating role, permission, or membership change; changes non-security configuration; or merely quotes, prints, searches, documents, comments on, or transmits dangerous text.",
|
|
49
49
|
},
|
|
50
50
|
}),
|
|
51
51
|
|
|
52
52
|
unrecoverable: Decision.probability({
|
|
53
53
|
instructions:
|
|
54
|
-
"
|
|
54
|
+
"Could state destroyed by this command not be recovered from the described state?",
|
|
55
55
|
criteria: {
|
|
56
|
-
true: "
|
|
56
|
+
true: "It affects uncommitted edits, untracked files, unpushed commits without an upstream, or unbacked remote resources.",
|
|
57
57
|
false:
|
|
58
|
-
"
|
|
58
|
+
"Affected state is committed and pushed, reinstallable, regenerable, temporary, self-created, a rebuildable cache, or a replaceable local container.",
|
|
59
59
|
},
|
|
60
60
|
}),
|
|
61
61
|
|
|
62
62
|
targetsSharedInfrastructure: Decision.probability({
|
|
63
63
|
instructions:
|
|
64
|
-
"
|
|
64
|
+
"Does this command act on a shared, remote, or production system rather than only this machine?",
|
|
65
65
|
criteria: {
|
|
66
|
-
true: "It
|
|
67
|
-
false:
|
|
68
|
-
"It operates only on local files, local containers, or the local git repository.",
|
|
66
|
+
true: "It affects a production or shared database, cloud account, Kubernetes cluster, remote host, container registry, or remote git branch.",
|
|
67
|
+
false: "It affects only local files, containers, or the local git repository.",
|
|
69
68
|
},
|
|
70
69
|
}),
|
|
71
70
|
|
|
72
71
|
blastRadius: Decision.rate({
|
|
73
|
-
instructions:
|
|
74
|
-
"How much would be lost if this command ran and the outcome turned out to be unwanted.",
|
|
72
|
+
instructions: "Rate the unwanted loss if this command ran.",
|
|
75
73
|
criteria: [
|
|
76
|
-
"
|
|
77
|
-
"Recoverable work
|
|
78
|
-
"Irreplaceable local work: uncommitted edits, untracked files, unpushed commits, or unrelated files
|
|
79
|
-
"Shared or production state:
|
|
74
|
+
"No valuable loss: read-only, cache, build output, temporary, or self-created files.",
|
|
75
|
+
"Recoverable project work: committed files, reinstallable dependencies, or regenerable output.",
|
|
76
|
+
"Irreplaceable local work: uncommitted edits, untracked files, unpushed commits, or unrelated local files.",
|
|
77
|
+
"Shared or production state: depended-on remote branches, production databases, cloud infrastructure, or live services.",
|
|
80
78
|
],
|
|
81
79
|
}),
|
|
82
80
|
} as const;
|