auto-mode 0.18.0 → 0.19.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 +48 -78
- package/dist/cli.js +60 -590
- package/dist/index.d.ts +4536 -219
- package/dist/index.js +2 -2
- package/dist/{render-verdict-lM31QV2u.js → render-verdict-aWHhUzvw.js} +1285 -579
- package/mods/auto-mode/contract/types.ts +1 -1
- package/package.json +10 -9
- package/policy/rules.md +27 -15
package/README.md
CHANGED
|
@@ -6,108 +6,78 @@
|
|
|
6
6
|
</p>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
|
-
**auto-mode**
|
|
10
|
-
Claude Code mod. The mod returns allow, deny, or no verdict before the permission dialog appears.
|
|
11
|
-
Local rules settle read-only actions and build cleanup; Jev evaluates the remaining actions against
|
|
12
|
-
a written policy.
|
|
9
|
+
**auto-mode** tries to mitigate the risk of unattended non-Claude agents inside Claude Code.
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
classifier.
|
|
11
|
+
auto-mode runs as a Claude Code mod, and its operating model is loosely modelled on Anthropic's
|
|
12
|
+
native auto mode. Instead of one model, it pairs a fast decision model (such as Jev) with a
|
|
13
|
+
traditional classifier-judge model (such as Haiku) to cover the first one's shortcomings.
|
|
18
14
|
|
|
19
15
|
## Install
|
|
20
16
|
|
|
17
|
+
auto-mode needs node 24 or later, Claude Code, and a TypeSafe API key for Jev.
|
|
18
|
+
|
|
21
19
|
```sh
|
|
22
20
|
npm i -g auto-mode
|
|
23
21
|
claude --plugin-dir "$(npm root -g)/auto-mode/mods/auto-mode"
|
|
24
22
|
```
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
the
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
and
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
clear Policy Tampering and Audit Tampering. The last direct user message can supply the exact action
|
|
53
|
-
and target that a soft block needs; replies such as “go ahead” cannot supply an unseen proposal.
|
|
54
|
-
|
|
55
|
-
Read [the policy](./policy/rules.md) before you enable the mod.
|
|
56
|
-
[Writing a policy](./docs/guides/policy.md) covers the precedence and the limits of an action-only
|
|
57
|
-
assessment.
|
|
58
|
-
|
|
59
|
-
## Decisions and failures
|
|
60
|
-
|
|
61
|
-
Jev evaluates each named rule with a typed choice between allow and block. auto-mode allows the
|
|
62
|
-
action unless some rule's block probability reaches the threshold, 0.2 by default. Every denial
|
|
63
|
-
names the rule with the highest block probability, the harm, and what clears it, and the agent
|
|
64
|
-
continues on another path. The threshold is configurable and needs evaluation against your actions.
|
|
65
|
-
|
|
66
|
-
A missing key, failed API call, malformed response, or oversized request follows
|
|
67
|
-
`decision.onFailure`. The default `defer` writes no verdict and keeps the prompt; `deny` fails
|
|
68
|
-
closed. Failures write a diagnostic to stderr. auto-mode never truncates a Jev action to make it
|
|
69
|
-
fit.
|
|
70
|
-
|
|
71
|
-
## Commands
|
|
72
|
-
|
|
73
|
-
| Command | Effect |
|
|
74
|
-
| ---------------------------- | ----------------------------------------- |
|
|
75
|
-
| `auto-mode run` | Read a mod request and write a verdict |
|
|
76
|
-
| `auto-mode run --explain` | Write decision details to stderr |
|
|
77
|
-
| `auto-mode run --local-only` | Skip the model tier |
|
|
78
|
-
| `auto-mode run --jev-only` | Require Jev with a 5-second API timeout |
|
|
79
|
-
| `auto-mode print-prompt` | Print the selected provider's base policy |
|
|
80
|
-
|
|
81
|
-
The mod evaluates only ask decisions and preserves existing allow and deny decisions. It runs the
|
|
82
|
-
CLI as a bounded child process with `--jev-only`. The `spark`, `claude`, `glm`, and `messages`
|
|
83
|
-
classifier kinds use the Messages API and serve library callers.
|
|
24
|
+
Export your key as `TYPESAFE_API_KEY`, or point the configuration at a command that prints it.
|
|
25
|
+
[Claude permission mod](./docs/guides/claude-mod.md) covers the mod and a trial session you can
|
|
26
|
+
undo.
|
|
27
|
+
|
|
28
|
+
## Features
|
|
29
|
+
|
|
30
|
+
- **Local rules** allow read-only calls and build-output cleanup without a model call
|
|
31
|
+
([local rules](./docs/architecture/stages/local-rules.md)).
|
|
32
|
+
- **Containment** denies a write outside the task's own worktrees, branches and pull requests
|
|
33
|
+
([containment](./docs/architecture/stages/containment.md)).
|
|
34
|
+
- **The edit bypass** allows an in-scope file edit once a secret scan finds nothing
|
|
35
|
+
([the edit bypass](./docs/architecture/stages/edit-bypass.md)).
|
|
36
|
+
- **Jev** judges the remaining calls against the shipped rules and your own
|
|
37
|
+
([Jev](./docs/architecture/stages/jev.md)).
|
|
38
|
+
- **The judge**, on by default, reviews every Jev deny, and overturns it when your last message
|
|
39
|
+
asked the main agent for exactly this action, or when no rule covers the action
|
|
40
|
+
([the judge](./docs/architecture/stages/judge.md)).
|
|
41
|
+
- **The denial budget** hands a call back to you when an agent keeps getting denied
|
|
42
|
+
([the denial budget](./docs/architecture/stages/denial-budget.md)).
|
|
43
|
+
- **Your own rules** from your Claude settings join the policy as block rules
|
|
44
|
+
([settings and repository facts](./docs/architecture/evidence/settings-and-repository.md)).
|
|
45
|
+
- **Action diagnostics** record how each call was decided, without the command or the prompt
|
|
46
|
+
([action diagnostics](./docs/guides/diagnostics.md)).
|
|
47
|
+
|
|
48
|
+
Read [the rules](./policy/rules.md) before you enable the mod.
|
|
49
|
+
[Writing a policy](./docs/guides/policy.md) covers how the rules clear and how to change them.
|
|
84
50
|
|
|
85
51
|
## Library
|
|
86
52
|
|
|
53
|
+
You can call auto-mode's core APIs from your own code. `parseActionRequest` reads the request the
|
|
54
|
+
mod sends the CLI ([the contract](./docs/architecture/mod.md#the-contract)), and `classifyAction`
|
|
55
|
+
runs it through [the stages](./docs/architecture/overview.md#the-path-of-a-prompted-call) from the
|
|
56
|
+
local rules to the judge. The two options in the example apply the denial budget and write the
|
|
57
|
+
action log, as the CLI does, and `recordScope` adds what a finished Bash call created to the
|
|
58
|
+
session's scope.
|
|
59
|
+
|
|
87
60
|
```ts
|
|
88
61
|
import { classifyAction, loadConfig, parseActionRequest } from 'auto-mode';
|
|
89
62
|
|
|
90
63
|
const request = parseActionRequest(body);
|
|
91
64
|
|
|
92
65
|
if (request !== null) {
|
|
93
|
-
const outcome = await classifyAction(request, await loadConfig()
|
|
66
|
+
const outcome = await classifyAction(request, await loadConfig(), {
|
|
67
|
+
budget: true,
|
|
68
|
+
actionLog: true,
|
|
69
|
+
});
|
|
94
70
|
}
|
|
95
71
|
```
|
|
96
72
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
73
|
+
## Configuration
|
|
74
|
+
|
|
75
|
+
Read the [configuration](./docs/guides/configuration.md) guide, which covers every field and the
|
|
76
|
+
credentials.
|
|
101
77
|
|
|
102
78
|
## Documentation
|
|
103
79
|
|
|
104
|
-
|
|
105
|
-
mod contract.
|
|
106
|
-
- [Configuration](./docs/guides/configuration.md) covers every setting and the imported Claude
|
|
107
|
-
rules.
|
|
108
|
-
- [Claude permission mod](./docs/guides/claude-mod.md) covers the request, the verdict, and the time
|
|
109
|
-
limits.
|
|
110
|
-
- [Writing a policy](./docs/guides/policy.md) covers rule edits and evaluation.
|
|
80
|
+
[docs/](./docs/README.md) covers the architecture and the user guides.
|
|
111
81
|
|
|
112
82
|
## Licence
|
|
113
83
|
|