@atbash/cli 0.5.15 → 0.6.1-dev.2
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 +389 -2
- package/dist/bin/atbash.js +39 -4
- package/dist/bin/atbash.js.map +1 -1
- package/dist/commands/config-cmd.js +15 -15
- package/dist/commands/config-cmd.js.map +1 -1
- package/dist/commands/connect.d.ts +115 -1
- package/dist/commands/connect.js +292 -73
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/github-scan.d.ts +104 -0
- package/dist/commands/github-scan.js +1054 -0
- package/dist/commands/github-scan.js.map +1 -0
- package/dist/commands/held.js +7 -2
- package/dist/commands/held.js.map +1 -1
- package/dist/commands/history.js +4 -1
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/judge-options.d.ts +21 -0
- package/dist/commands/judge-options.js +24 -0
- package/dist/commands/judge-options.js.map +1 -0
- package/dist/commands/judge.js +5 -2
- package/dist/commands/judge.js.map +1 -1
- package/dist/commands/mcp-cmd.d.ts +13 -0
- package/dist/commands/mcp-cmd.js +216 -0
- package/dist/commands/mcp-cmd.js.map +1 -0
- package/dist/commands/policy.js +4 -1
- package/dist/commands/policy.js.map +1 -1
- package/dist/commands/scan.d.ts +45 -0
- package/dist/commands/scan.js +301 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/commands/setup.d.ts +533 -0
- package/dist/commands/setup.js +2653 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/stats.js +3 -1
- package/dist/commands/stats.js.map +1 -1
- package/dist/commands/status.js +4 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/tier.js +4 -1
- package/dist/commands/tier.js.map +1 -1
- package/dist/commands/tools.js +11 -4
- package/dist/commands/tools.js.map +1 -1
- package/dist/commands/whoami.js +4 -1
- package/dist/commands/whoami.js.map +1 -1
- package/dist/lib/grade-llm.d.ts +38 -0
- package/dist/lib/grade-llm.js +64 -0
- package/dist/lib/grade-llm.js.map +1 -0
- package/dist/lib/llm.d.ts +34 -0
- package/dist/lib/llm.js +101 -0
- package/dist/lib/llm.js.map +1 -0
- package/dist/lib/policy.d.ts +40 -0
- package/dist/lib/policy.js +94 -0
- package/dist/lib/policy.js.map +1 -0
- package/dist/lib/risk.d.ts +112 -0
- package/dist/lib/risk.js +288 -0
- package/dist/lib/risk.js.map +1 -0
- package/dist/lib/threats-llm.d.ts +39 -0
- package/dist/lib/threats-llm.js +72 -0
- package/dist/lib/threats-llm.js.map +1 -0
- package/dist/shared/atbash-targets.d.ts +49 -0
- package/dist/shared/atbash-targets.js +63 -0
- package/dist/shared/atbash-targets.js.map +1 -0
- package/dist/shared/openclaw-runtime.d.ts +221 -0
- package/dist/shared/openclaw-runtime.js +476 -0
- package/dist/shared/openclaw-runtime.js.map +1 -0
- package/dist/shared/win-exec.d.ts +63 -0
- package/dist/shared/win-exec.js +147 -0
- package/dist/shared/win-exec.js.map +1 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -139,6 +139,168 @@ atbash judge 'grant admin access to CI service account'
|
|
|
139
139
|
The agent cannot retry or self-unjail. An operator must review and release at [https://atbash.ai/](https://atbash.ai/).
|
|
140
140
|
|
|
141
141
|
|
|
142
|
+
## Local scan
|
|
143
|
+
|
|
144
|
+
`atbash scan` reports what is installed on this machine. It needs no account, no pairing code and no dashboard. The report is printed in your terminal and is never uploaded.
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# What is installed here
|
|
148
|
+
atbash scan
|
|
149
|
+
|
|
150
|
+
# Ask each MCP server what tools it actually has
|
|
151
|
+
atbash scan --introspect
|
|
152
|
+
|
|
153
|
+
# Add a draft boundary: red lines and actions that need approval
|
|
154
|
+
atbash scan --introspect --policy
|
|
155
|
+
|
|
156
|
+
# Machine-readable output
|
|
157
|
+
atbash scan --introspect --json
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Output:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
Atbash local scan
|
|
164
|
+
────────────────────────────
|
|
165
|
+
Machine : my-laptop
|
|
166
|
+
Found : 1 runtime
|
|
167
|
+
|
|
168
|
+
OpenClaw — 5 skills / plugins
|
|
169
|
+
• delete-customer-records
|
|
170
|
+
• export-crm-contacts
|
|
171
|
+
• issue-refund
|
|
172
|
+
• list-tickets
|
|
173
|
+
• send-email
|
|
174
|
+
|
|
175
|
+
Risk
|
|
176
|
+
────────────────────────────
|
|
177
|
+
Level : High (92/100)
|
|
178
|
+
Method : deterministic
|
|
179
|
+
5 authorized action paths (3 high-severity).
|
|
180
|
+
|
|
181
|
+
high delete-customer-records — destructive action
|
|
182
|
+
irreversible data/infrastructure loss
|
|
183
|
+
high export-crm-contacts — data access / egress
|
|
184
|
+
data leakage / privacy breach
|
|
185
|
+
high issue-refund — financial
|
|
186
|
+
direct financial loss
|
|
187
|
+
medium send-email — external communication
|
|
188
|
+
external message sent on the owner's behalf (monitored)
|
|
189
|
+
low list-tickets — read / research
|
|
190
|
+
low-consequence information access
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
With `--policy` it also prints a draft boundary you can edit and enforce:
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
Recommended boundary
|
|
197
|
+
────────────────────────────
|
|
198
|
+
Red lines (auto-deny)
|
|
199
|
+
• Never perform destructive action autonomously (e.g. delete-customer-records).
|
|
200
|
+
• Never perform data access / egress autonomously (e.g. export-crm-contacts).
|
|
201
|
+
• Never modify its own mandate, red lines, or authority.
|
|
202
|
+
|
|
203
|
+
Needs approval
|
|
204
|
+
• Require human approval before financial (e.g. issue-refund).
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### What leaves your machine
|
|
208
|
+
|
|
209
|
+
Nothing, unless you ask for it.
|
|
210
|
+
|
|
211
|
+
| Command | Requests sent |
|
|
212
|
+
| --- | --- |
|
|
213
|
+
| `atbash scan` | none |
|
|
214
|
+
| `--introspect` | one per MCP server configured with an `http` URL, sent to that URL |
|
|
215
|
+
| `--api-key` | one, to your LLM provider |
|
|
216
|
+
| `--threats` | one, to your LLM provider |
|
|
217
|
+
|
|
218
|
+
Nothing is ever sent to Atbash. `--json` reports the actual count as `networkRequests`, so you can check it.
|
|
219
|
+
|
|
220
|
+
Credentials found in your config files are removed before anything is printed or sent. That covers `env` values, `headers`, tokens, and secrets embedded in command paths.
|
|
221
|
+
|
|
222
|
+
### Using your own LLM key
|
|
223
|
+
|
|
224
|
+
The built-in rules classify tools by name and description. Some tools match no rule. Supply your own [OpenRouter](https://openrouter.ai) key and the CLI will grade those as well. With `--threats` it also looks for risks that only appear when tools are combined, such as reading customer data and sending mail.
|
|
225
|
+
|
|
226
|
+
The key is read from the first of these that is set:
|
|
227
|
+
|
|
228
|
+
1. `--api-key <key>`
|
|
229
|
+
2. `ATBASH_SCAN_API_KEY`
|
|
230
|
+
3. `OPENROUTER_API_KEY`
|
|
231
|
+
|
|
232
|
+
On a shared machine, use an environment variable rather than `--api-key`. Command arguments are visible to other users through `ps`.
|
|
233
|
+
|
|
234
|
+
First get a key from [openrouter.ai/settings/keys](https://openrouter.ai/settings/keys). It looks like `sk-or-v1-` followed by 64 hex characters.
|
|
235
|
+
|
|
236
|
+
**macOS keychain.** The keychain stores every secret under the name "password", so the prompt says `password data for new item:`. That is where the API key goes. Do not type a login password.
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
security add-generic-password -a "$USER" -s atbash-openrouter -U -w
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
It prompts twice:
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
password data for new item: <- paste the sk-or-v1-... key
|
|
246
|
+
retype password for new item: <- paste it again
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Nothing is echoed as you paste, and the two entries must match or it fails with `passwords don't match`. Check what actually got stored:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
v=$(security find-generic-password -a "$USER" -s atbash-openrouter -w); echo "${#v} chars, starts ${v:0:9}"
|
|
253
|
+
# expect: 73 chars, starts sk-or-v1-
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
If that prints anything else, the wrong value was stored. Run the `add` command again; `-U` overwrites it.
|
|
257
|
+
|
|
258
|
+
Then use it:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
export ATBASH_SCAN_API_KEY="$(security find-generic-password -a "$USER" -s atbash-openrouter -w)"
|
|
262
|
+
atbash scan --introspect --threats --policy
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Linux, or anywhere without a keychain.** Use a file only you can read:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
mkdir -p ~/.config/atbash && chmod 700 ~/.config/atbash
|
|
269
|
+
(umask 077; touch ~/.config/atbash/openrouter.key)
|
|
270
|
+
$EDITOR ~/.config/atbash/openrouter.key # paste the key, save
|
|
271
|
+
|
|
272
|
+
export ATBASH_SCAN_API_KEY="$(cat ~/.config/atbash/openrouter.key)"
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**CI.** Store the key as a repository secret and map it to the environment variable. Never put it in a file in the repo.
|
|
276
|
+
|
|
277
|
+
```yaml
|
|
278
|
+
- run: atbash scan --introspect --fail-on high
|
|
279
|
+
env:
|
|
280
|
+
ATBASH_SCAN_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Pick a different model with `--model <id>`. The default is `z-ai/glm-5.3-flash`.
|
|
284
|
+
|
|
285
|
+
If the key is missing, wrong, or the provider is down, the scan still finishes using the built-in grading and tells you what failed. You never lose the report.
|
|
286
|
+
|
|
287
|
+
### Use in CI
|
|
288
|
+
|
|
289
|
+
`--fail-on` turns the risk level into an exit code.
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
atbash scan --introspect --fail-on high
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
| Exit code | Meaning |
|
|
296
|
+
| --- | --- |
|
|
297
|
+
| 0 | risk level is below the threshold |
|
|
298
|
+
| 1 | risk level reached the threshold |
|
|
299
|
+
| 2 | the `--fail-on` value was not `low`, `elevated` or `high` |
|
|
300
|
+
|
|
301
|
+
Run the gate without an API key. Built-in grading returns the same answer every time. Model grading varies between runs, which would make the gate flaky.
|
|
302
|
+
|
|
303
|
+
|
|
142
304
|
## End-to-end example: guarding a production deploy
|
|
143
305
|
|
|
144
306
|
A CI agent is about to apply a database migration to production. The operator policy holds all production applies for review before execution.
|
|
@@ -331,6 +493,29 @@ If any check fails — an integrity value that does not match the deployment's m
|
|
|
331
493
|
|
|
332
494
|
## Command reference
|
|
333
495
|
|
|
496
|
+
### `atbash scan`
|
|
497
|
+
|
|
498
|
+
Scan this machine and print the report here. No account and no pairing code. See [Local scan](#local-scan) for the full walkthrough.
|
|
499
|
+
|
|
500
|
+
```bash
|
|
501
|
+
npx --yes @atbash/cli scan --introspect --policy
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
| Flag | Description |
|
|
505
|
+
|------|-------------|
|
|
506
|
+
| `--introspect` | Ask each configured MCP server what tools it advertises. Starts stdio servers locally and contacts `http` servers at their own URL. No tool is ever called |
|
|
507
|
+
| `--policy` | Also print a draft boundary: red lines and actions that need approval |
|
|
508
|
+
| `--threats` | Also list risks that come from tools used in combination. Needs an API key |
|
|
509
|
+
| `--api-key <key>` | Your own LLM provider key. Also read from `ATBASH_SCAN_API_KEY` or `OPENROUTER_API_KEY` |
|
|
510
|
+
| `--model <id>` | Model used for grading. Default `z-ai/glm-5.3-flash` |
|
|
511
|
+
| `--fail-on <level>` | Exit 1 when the risk level reaches `low`, `elevated` or `high` |
|
|
512
|
+
| `--json` | Machine-readable output |
|
|
513
|
+
| `--home <dir>` | Home directory to scan (for testing) |
|
|
514
|
+
|
|
515
|
+
Without a key the report is produced entirely on this machine. `--threats` and
|
|
516
|
+
`--api-key` send tool names and descriptions to the provider you chose, never to
|
|
517
|
+
Atbash.
|
|
518
|
+
|
|
334
519
|
### `atbash connect <code>`
|
|
335
520
|
|
|
336
521
|
Link a machine to a hosted Atbash onboarding session. A browser can't read your disk and the Atbash server only sees its own, so this runs on the machine you want to govern, enumerates the agents / MCP tools configured there (read-only), and relays their *surface* to your onboarding session via the one-time pairing code shown in the browser.
|
|
@@ -357,6 +542,111 @@ configured MCP server processes, so it is not purely read-only even though Atbas
|
|
|
357
542
|
never invokes their tools. See [Verifying this CLI](#verifying-this-cli-before-you-run-it-humans--ai-agents)
|
|
358
543
|
and the [release checklist](RELEASE_CHECKLIST.md).
|
|
359
544
|
|
|
545
|
+
### `atbash setup`
|
|
546
|
+
|
|
547
|
+
Wire this machine's runtime to an agent you already onboarded. `connect` is the read-only half of onboarding; this is the half that **writes**. It places the agent key where every integration looks for it, installs the OpenClaw plugin, and *merges* the plugin block into your existing `~/.openclaw/openclaw.json` — the step that is easy to get wrong by hand, and whose failure mode is an agent that looks governed while enforcing nothing.
|
|
548
|
+
|
|
549
|
+
```bash
|
|
550
|
+
# Preview everything first — prints the exact file diffs, writes nothing:
|
|
551
|
+
npx --yes @atbash/cli setup --dry-run
|
|
552
|
+
|
|
553
|
+
# Point it at the key file onboarding downloaded for you:
|
|
554
|
+
npx --yes @atbash/cli setup --keys-dir ~/Downloads
|
|
555
|
+
|
|
556
|
+
# Or paste the key at a hidden prompt (nothing lands in your shell history):
|
|
557
|
+
npx --yes @atbash/cli setup
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
| Flag | Description |
|
|
561
|
+
|------|-------------|
|
|
562
|
+
| `-k, --key <privkey>` | Agent private key inline. Convenient, but it lands in your shell history — prefer the prompt or `--key-file` |
|
|
563
|
+
| `--key-file <path>` | Read the key from a file (`agent-keys-*.txt` from onboarding, or an existing `guard-client-key`) |
|
|
564
|
+
| `--keys-dir <dir>` | Directory holding the key file, e.g. `~/Downloads` |
|
|
565
|
+
| `--host <url>` | Deployment to check the agent's registration against |
|
|
566
|
+
| `--runtime <ids...>` | Only configure these runtimes (currently: `openclaw`) |
|
|
567
|
+
| `--dry-run` | Show which files would change, and the diffs, then exit WITHOUT writing |
|
|
568
|
+
| `-y, --yes` | Do not ask for confirmation before writing (does **not** consent to replacing the agent — see `--replace-key`) |
|
|
569
|
+
| `--replace-key` | Consent to changing which agent this machine signs as, when the key supplied names a different agent than the one already here. Needed only for non-interactive runs |
|
|
570
|
+
| `--no-install` | Write the key file and configs only; install no packages |
|
|
571
|
+
| `--skip-verify` | Make no network calls at all |
|
|
572
|
+
| `--allow-unrecognized-host` | Permit a `--host` outside the built-in Atbash allowlist |
|
|
573
|
+
| `--home <dir>` | Home directory to configure (for testing) |
|
|
574
|
+
|
|
575
|
+
**Onboarding a different agent on a machine that already has one.**
|
|
576
|
+
|
|
577
|
+
Supply the new agent's key and setup will offer to switch. This is the one change
|
|
578
|
+
it makes that is a *substitution* rather than an addition: afterwards every
|
|
579
|
+
integration reading `~/.config/atbash/guard-client-key` signs as the new agent, so
|
|
580
|
+
tool calls are attributed to it. So it is asked on its own:
|
|
581
|
+
|
|
582
|
+
```
|
|
583
|
+
This machine is about to change which agent it signs as.
|
|
584
|
+
now: 0237722e87b6636d67ee495f57e27eae0e2624a382d0603c3b3a396643f230bf94
|
|
585
|
+
new: 02b95c249d84f417e3e395a127425428b540671cc15881eb828c17b722a53fc599
|
|
586
|
+
Every integration on this machine reading ~/.config/atbash/guard-client-key
|
|
587
|
+
will switch to the new agent. The current key is archived first, to
|
|
588
|
+
~/.config/atbash/keys/0237722e….key, so the old agent stays recoverable.
|
|
589
|
+
|
|
590
|
+
Replace the agent this machine signs as? [y/N]
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
Answer **no** and nothing is changed at all — the run stops rather than configuring
|
|
594
|
+
a runtime for an agent whose key was never installed, which would leave the machine
|
|
595
|
+
signing as one agent while the dashboard shows another.
|
|
596
|
+
|
|
597
|
+
`-y/--yes` deliberately does **not** answer this question: agreeing to write files
|
|
598
|
+
is not the same as agreeing to become a different agent. A script that means it
|
|
599
|
+
passes `--replace-key`. A fresh machine, or a re-run with the same agent, never sees
|
|
600
|
+
the prompt.
|
|
601
|
+
|
|
602
|
+
If no key is supplied, setup looks in order at `--key`, `--key-file`, `--keys-dir`,
|
|
603
|
+
`ATBASH_AGENT_KEY`, the existing `~/.config/atbash/guard-client-key`, your
|
|
604
|
+
`atbash config`, and finally a hidden prompt that accepts **either** a key or a path.
|
|
605
|
+
Wherever it comes from, the key is written once to
|
|
606
|
+
`~/.config/atbash/guard-client-key` at `0600`, and every config setup writes
|
|
607
|
+
*references that path* rather than embedding the secret again.
|
|
608
|
+
|
|
609
|
+
**What it will not do.**
|
|
610
|
+
|
|
611
|
+
- It never transmits the private key. The only network call is a registration
|
|
612
|
+
check, and that sends the **public** key.
|
|
613
|
+
- It never writes the private key into an MCP client config. The entry it writes
|
|
614
|
+
points at `atbash mcp`, which reads the key from `guard-client-key` and hands it
|
|
615
|
+
to the server through the child process environment — so the config file carries
|
|
616
|
+
no credential, and an entry you previously hand-wired with one has the key
|
|
617
|
+
removed.
|
|
618
|
+
- It never edits your application source. Code-level integrations (LangChain,
|
|
619
|
+
LangGraph, AutoGen, Eliza, the SDK boundary) stay yours to write.
|
|
620
|
+
- It never rewrites a config that uses comments or trailing commas — reserializing
|
|
621
|
+
JSONC as JSON would delete your comments, so those become a printed snippet.
|
|
622
|
+
- It refuses to wire a runtime to an agent that is not registered. A machine that
|
|
623
|
+
looks governed with a plugin that can never get a verdict is the worst available
|
|
624
|
+
outcome.
|
|
625
|
+
|
|
626
|
+
Every file it changes is copied to a `.atbash-bak` alongside it first, and repeat
|
|
627
|
+
runs are idempotent.
|
|
628
|
+
|
|
629
|
+
### `atbash mcp`
|
|
630
|
+
|
|
631
|
+
Runs the Atbash MCP server, reading the agent key from `~/.config/atbash/guard-client-key` instead of from a config file. You do not normally run this by hand — it is what `atbash setup` puts in your MCP client's server list:
|
|
632
|
+
|
|
633
|
+
```json
|
|
634
|
+
{ "mcpServers": { "atbash": { "command": "npx", "args": ["--yes", "@atbash/cli", "mcp"] } } }
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
| Flag | Description |
|
|
638
|
+
|------|-------------|
|
|
639
|
+
| `--key-file <path>` | Agent key file to read (default: `~/.config/atbash/guard-client-key`) |
|
|
640
|
+
| `--endpoint <url>` | Atbash endpoint the server should use |
|
|
641
|
+
|
|
642
|
+
**Why this exists.** `@atbash/mcp` reads its identity from `ATBASH_AGENT_PRIVKEY` and has no key-file fallback, so the wiring in its own docs puts a raw private key inside `claude_desktop_config.json` — a file people sync between machines and paste into help requests. This launcher keeps the key in the 0600 file and passes it to the server through the child process environment, so nothing secret is written to a config file.
|
|
643
|
+
|
|
644
|
+
An `ATBASH_AGENT_PRIVKEY` already present in the environment still wins, so if you deliberately inject the key at launch time nothing changes for you.
|
|
645
|
+
|
|
646
|
+
**Known issue it works around.** Every published `@atbash/mcp` (0.1.0–0.1.3) fails to start: they import `getOrgTierInfo` as a named export from `@atbash/sdk`, and `@atbash/sdk@0.3.24` removed it, so their `^0.3.19` range resolves to a version that cannot satisfy the import. This launcher installs the compatible pair together (`@atbash/mcp@0.1.3` with `@atbash/sdk@0.3.23`). That pinned SDK is itself deprecated — the real fix is republishing `@atbash/mcp` against `@atbash/sdk@^0.7`.
|
|
647
|
+
|
|
648
|
+
First launch takes ~10–15s while npx caches the packages, then about a second. A client with a short startup timeout may fail once and succeed on retry.
|
|
649
|
+
|
|
360
650
|
### `atbash judge <action>`
|
|
361
651
|
|
|
362
652
|
Submit a pending action for judgment. The action string is the exact operation the agent is about to execute — a transfer, a command, a mutation.
|
|
@@ -476,6 +766,97 @@ Tool Call Details
|
|
|
476
766
|
Latency: 2340ms
|
|
477
767
|
```
|
|
478
768
|
|
|
769
|
+
### `atbash github-scan`
|
|
770
|
+
|
|
771
|
+
Read-only GitHub inventory and change-risk triage. The scanner calls GitHub's REST
|
|
772
|
+
API directly; it does not invoke the `gh` CLI and it never makes a mutating API
|
|
773
|
+
request.
|
|
774
|
+
|
|
775
|
+
```bash
|
|
776
|
+
# Use a classic/fine-grained user token or GitHub App installation token with
|
|
777
|
+
# read access to every repository and organization that should be inventoried.
|
|
778
|
+
# Set GITHUB_TOKEN or GH_TOKEN in the process environment; tokens are never
|
|
779
|
+
# accepted as command-line arguments.
|
|
780
|
+
|
|
781
|
+
atbash github-scan --owner Atbash-Ai --expect-repos 13 --since 2026-08-01 --json
|
|
782
|
+
atbash github-scan --repo Atbash-Ai/atbash-cli --branch main
|
|
783
|
+
```
|
|
784
|
+
|
|
785
|
+
`--owner` and `--repo` are repeatable. `--branch` limits branch inventory,
|
|
786
|
+
commits, and merged-PR base branch. `--since` accepts an ISO-8601 date or
|
|
787
|
+
timestamp and defaults to 30 days. Bots are excluded unless `--include-bots` is
|
|
788
|
+
set. Use `--owner` for scheduled organization audits: without it, `/user/repos`
|
|
789
|
+
intentionally inventories every owner visible to the token, which may include
|
|
790
|
+
private personal or unrelated organization repositories. `--expect-repos`
|
|
791
|
+
makes a known inventory size an exact fail-closed assertion.
|
|
792
|
+
|
|
793
|
+
The command verifies the authenticated user or GitHub App installation, records
|
|
794
|
+
OAuth scopes when GitHub supplies the `X-OAuth-Scopes` header, verifies
|
|
795
|
+
repository metadata permissions and organization visibility, and validates REST
|
|
796
|
+
pagination. A full page without a `Link` header is not accepted as terminal:
|
|
797
|
+
the scanner probes explicit sequential page numbers until a short/empty page or
|
|
798
|
+
a terminal `Link` relation is verified. Duplicate pages/items, changed filters,
|
|
799
|
+
cycles, non-sequential links, and the 1,000-page hard ceiling fail the scan.
|
|
800
|
+
This establishes completeness for the authenticated API view and selected
|
|
801
|
+
filters; it cannot prove that the token was granted access to repositories
|
|
802
|
+
GitHub never exposes to it. GitHub REST pagination is not snapshot-isolated:
|
|
803
|
+
concurrent repository changes can move items between pages. Duplicate/cycle
|
|
804
|
+
checks fail on detectable drift, but the `completeness.snapshotConsistency`
|
|
805
|
+
field explicitly records that snapshot consistency is not guaranteed; rerun a
|
|
806
|
+
scheduled audit if the organization changed during collection.
|
|
807
|
+
|
|
808
|
+
The network contract is GET-only: identity (`/user` or `/installation`),
|
|
809
|
+
repository inventory (`/user/repos` or `/installation/repositories`),
|
|
810
|
+
organization metadata, branches, closed pull requests, PR file metadata,
|
|
811
|
+
commits, commit file metadata, and commit-to-PR associations. Tests reject any
|
|
812
|
+
non-GET request across these paths.
|
|
813
|
+
|
|
814
|
+
JSON output is sorted and schema-versioned. It includes a `completeness` object,
|
|
815
|
+
rate-limit status, public/private counts, branches, recent merged PR metadata,
|
|
816
|
+
commit metadata, changed filenames, and deterministic risk flags.
|
|
817
|
+
|
|
818
|
+
Bound controls fail rather than truncate:
|
|
819
|
+
|
|
820
|
+
- `--max-repos` (default 1,000)
|
|
821
|
+
- `--max-branches` per repository (default 1,000)
|
|
822
|
+
- `--max-prs` recent closed PRs inspected per repository (default 1,000)
|
|
823
|
+
- `--max-commits` per branch (default 1,000)
|
|
824
|
+
- `--max-files` per PR or commit (default 3,000)
|
|
825
|
+
|
|
826
|
+
Lower these for tightly bounded scheduled jobs. Raise them deliberately for a
|
|
827
|
+
larger organization; exceeding any bound exits nonzero without output or state
|
|
828
|
+
advancement.
|
|
829
|
+
|
|
830
|
+
Security and limits:
|
|
831
|
+
|
|
832
|
+
- Set exactly one of `GITHUB_TOKEN` or `GH_TOKEN`; if both differ, the command
|
|
833
|
+
fails. Tokens are held in memory, sent only in the GitHub authorization
|
|
834
|
+
header, and redacted from errors.
|
|
835
|
+
- The scanner never fetches blobs, trees, patches, diffs, or private file
|
|
836
|
+
contents. It reads repository/change metadata and changed filenames. Private
|
|
837
|
+
repository names and filenames still remain sensitive; protect JSON output.
|
|
838
|
+
- Human output exposes authenticated identity, repository names/visibility,
|
|
839
|
+
aggregate counts, and risk-category names. JSON additionally exposes branch
|
|
840
|
+
names, PR titles/authors/timestamps, commit subjects/authors/timestamps, URLs,
|
|
841
|
+
changed filenames, and permission metadata. Treat either output as sensitive;
|
|
842
|
+
redirect JSON only to an access-controlled destination.
|
|
843
|
+
- The complete result is buffered before anything is printed. Authentication,
|
|
844
|
+
permission, malformed response, pagination, REST, or rate-limit failure exits
|
|
845
|
+
nonzero and emits no partial scan. The scanner writes no cursor or checkpoint,
|
|
846
|
+
so a failed run cannot advance state.
|
|
847
|
+
- Risk flags are deterministic path-based triage for Rell/contracts,
|
|
848
|
+
encryption/keys/auth, decision semantics, SDK/plugin APIs,
|
|
849
|
+
workflows/releases/dependencies, and direct commits detected on protected
|
|
850
|
+
branches. They are not semantic code analysis and are explicitly **not a full
|
|
851
|
+
SAST assessment**.
|
|
852
|
+
- Direct-commit detection asks GitHub whether a protected-branch commit belongs
|
|
853
|
+
to a merged PR. Branch rules, merge queues, force pushes, and GitHub's
|
|
854
|
+
commit-to-PR association can limit that inference.
|
|
855
|
+
- Fine-grained tokens and GitHub App installations should receive read-only
|
|
856
|
+
metadata, contents, pull-request, and organization access as applicable.
|
|
857
|
+
GitHub may not report named scopes for these token types; successful endpoint
|
|
858
|
+
access is the permission check.
|
|
859
|
+
|
|
479
860
|
### `atbash whoami` / `atbash policy show` / `atbash tier`
|
|
480
861
|
|
|
481
862
|
Inspect the current agent's identity, assigned policy, and org tier.
|
|
@@ -549,7 +930,7 @@ atbash set org-name my-org
|
|
|
549
930
|
atbash set provider openai
|
|
550
931
|
atbash set model gpt-4o
|
|
551
932
|
atbash set endpoint https://custom-endpoint.example.com
|
|
552
|
-
atbash set
|
|
933
|
+
atbash set network public # or "private" — pins the fleet-wide chain
|
|
553
934
|
|
|
554
935
|
# Remove a single value (reverts to default)
|
|
555
936
|
atbash unset provider
|
|
@@ -561,7 +942,13 @@ atbash unset endpoint
|
|
|
561
942
|
| Agent key | `--agent-key` | `ATBASH_AGENT_KEY` | `atbash set agent-key <hex>` |
|
|
562
943
|
| Org name | `--org` | `ATBASH_ORG_NAME` | `atbash set org-name <name>` |
|
|
563
944
|
| API endpoint | `--endpoint` | `ATBASH_ENDPOINT` | `atbash set endpoint <url>` |
|
|
564
|
-
|
|
|
945
|
+
| Self-hosted judge signing key | `--verify-pubkey` (judge) | `ATBASH_JUDGE_VERIFY_PUBKEY` | config key `judgeVerifyPubKey` |
|
|
946
|
+
| Default chain network | — | `ATBASH_DEFAULT_CHAIN_NETWORK` | `atbash set network public\|private` |
|
|
947
|
+
|
|
948
|
+
> **Self-hosted judge:** the SDK only accepts an endpoint outside the trusted allowlist
|
|
949
|
+
> when the judge's 66-hex response-signing pubkey is supplied too, so every verdict can be
|
|
950
|
+
> verified. Set `ATBASH_JUDGE_VERIFY_PUBKEY` (or `--verify-pubkey` on `judge`) together with
|
|
951
|
+
> `--endpoint`; without it a non-default endpoint is refused.
|
|
565
952
|
| Inference provider | `--provider` | `ATBASH_PROVIDER` | `atbash set provider <name>` |
|
|
566
953
|
| Model | `--model` | `ATBASH_PROVIDER_MODEL` | `atbash set model <model>` |
|
|
567
954
|
|
package/dist/bin/atbash.js
CHANGED
|
@@ -19,20 +19,50 @@ const tier_1 = require("../commands/tier");
|
|
|
19
19
|
const tools_1 = require("../commands/tools");
|
|
20
20
|
const held_1 = require("../commands/held");
|
|
21
21
|
const connect_1 = require("../commands/connect");
|
|
22
|
+
const scan_1 = require("../commands/scan");
|
|
23
|
+
const setup_1 = require("../commands/setup");
|
|
24
|
+
const mcp_cmd_1 = require("../commands/mcp-cmd");
|
|
25
|
+
const github_scan_1 = require("../commands/github-scan");
|
|
22
26
|
// ── Autocomplete ────────────────────────────────────────────────
|
|
23
27
|
const commands = [
|
|
24
28
|
"judge", "whoami", "policy", "tier", "tools", "held",
|
|
25
29
|
"history", "stats", "status", "keygen", "set", "unset",
|
|
26
|
-
"wipe", "config", "connect", "help",
|
|
30
|
+
"wipe", "config", "connect", "scan", "setup", "mcp", "github-scan", "help",
|
|
27
31
|
];
|
|
28
32
|
const subcommands = {
|
|
29
|
-
judge: [
|
|
33
|
+
judge: [
|
|
34
|
+
"--context",
|
|
35
|
+
"--agent-key",
|
|
36
|
+
"--provider",
|
|
37
|
+
"--model",
|
|
38
|
+
"--org",
|
|
39
|
+
"--endpoint",
|
|
40
|
+
"--timeout",
|
|
41
|
+
"--json",
|
|
42
|
+
],
|
|
30
43
|
policy: ["show"],
|
|
31
44
|
tools: ["--agent", "--org", "--count", "--json", "inspect", "count"],
|
|
32
45
|
held: ["--org", "--count", "--json", "reviews"],
|
|
33
46
|
connect: ["--host", "--home"],
|
|
34
|
-
|
|
35
|
-
|
|
47
|
+
mcp: ["--key-file", "--endpoint"],
|
|
48
|
+
scan: ["--home", "--introspect", "--api-key", "--model", "--threats", "--policy", "--fail-on", "--json"],
|
|
49
|
+
setup: ["--key", "--key-file", "--keys-dir", "--host", "--runtime", "--dry-run", "--yes", "--no-install", "--skip-verify", "--home"],
|
|
50
|
+
"github-scan": [
|
|
51
|
+
"--owner",
|
|
52
|
+
"--repo",
|
|
53
|
+
"--branch",
|
|
54
|
+
"--since",
|
|
55
|
+
"--expect-repos",
|
|
56
|
+
"--max-repos",
|
|
57
|
+
"--max-branches",
|
|
58
|
+
"--max-prs",
|
|
59
|
+
"--max-commits",
|
|
60
|
+
"--max-files",
|
|
61
|
+
"--include-bots",
|
|
62
|
+
"--json",
|
|
63
|
+
],
|
|
64
|
+
set: ["agent-key", "org-name", "endpoint", "network", "provider", "model"],
|
|
65
|
+
unset: ["agent-key", "org-name", "endpoint", "network", "provider", "model"],
|
|
36
66
|
show: ["--agent-key", "--endpoint", "--json"],
|
|
37
67
|
inspect: ["--endpoint"],
|
|
38
68
|
reviews: ["--org", "--count", "--json"],
|
|
@@ -85,6 +115,11 @@ program
|
|
|
85
115
|
(0, config_cmd_1.registerConfigCommand)(program);
|
|
86
116
|
// Onboarding
|
|
87
117
|
(0, connect_1.registerConnectCommand)(program);
|
|
118
|
+
(0, scan_1.registerScanCommand)(program);
|
|
119
|
+
(0, setup_1.registerSetupCommand)(program);
|
|
120
|
+
(0, mcp_cmd_1.registerMcpCommand)(program);
|
|
121
|
+
// External scanning
|
|
122
|
+
(0, github_scan_1.registerGithubScanCommand)(program);
|
|
88
123
|
async function main() {
|
|
89
124
|
await program.parseAsync(process.argv);
|
|
90
125
|
await (0, sdk_1.shutdownTelemetry)();
|
package/dist/bin/atbash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atbash.js","sourceRoot":"","sources":["../../src/bin/atbash.ts"],"names":[],"mappings":";;;;;;AACA,yCAAoC;AACpC,wDAAgC;AAChC,qCAAgE;AAChE,6CAAyD;AACzD,+CAA2D;AAC3D,+CAA2D;AAC3D,iDAA6D;AAC7D,6CAAyD;AACzD,uDAA+D;AAC/D,+CAA2D;AAC3D,+CAA2D;AAC3D,2CAAuD;AACvD,6CAAyD;AACzD,2CAAuD;AACvD,iDAA6D;
|
|
1
|
+
{"version":3,"file":"atbash.js","sourceRoot":"","sources":["../../src/bin/atbash.ts"],"names":[],"mappings":";;;;;;AACA,yCAAoC;AACpC,wDAAgC;AAChC,qCAAgE;AAChE,6CAAyD;AACzD,+CAA2D;AAC3D,+CAA2D;AAC3D,iDAA6D;AAC7D,6CAAyD;AACzD,uDAA+D;AAC/D,+CAA2D;AAC3D,+CAA2D;AAC3D,2CAAuD;AACvD,6CAAyD;AACzD,2CAAuD;AACvD,iDAA6D;AAC7D,2CAAuD;AACvD,6CAAyD;AACzD,iDAAyD;AACzD,yDAAoE;AAEpE,mEAAmE;AACnE,MAAM,QAAQ,GAAG;IACf,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IACpD,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO;IACtD,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM;CAC3E,CAAC;AAEF,MAAM,WAAW,GAA6B;IAC5C,KAAK,EAAE;QACL,WAAW;QACX,aAAa;QACb,YAAY;QACZ,SAAS;QACT,OAAO;QACP,YAAY;QACZ,WAAW;QACX,QAAQ;KACT;IACD,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,KA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C/B,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC;AAC/B,IAAA,0BAAmB,EAAC,OAAO,CAAC,CAAC;AAE7B,aAAa;AACb,IAAA,4BAAoB,EAAC,OAAO,CAAC,CAAC;AAE9B,oBAAoB;AACpB,IAAA,0BAAmB,EAAC,OAAO,CAAC,CAAC;AAE7B,OAAO;AACP,IAAA,gCAAsB,EAAC,OAAO,CAAC,CAAC;AAChC,IAAA,4BAAoB,EAAC,OAAO,CAAC,CAAC;AAC9B,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC;AAE/B,QAAQ;AACR,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC;AAC/B,IAAA,kCAAqB,EAAC,OAAO,CAAC,CAAC;AAE/B,aAAa;AACb,IAAA,gCAAsB,EAAC,OAAO,CAAC,CAAC;AAChC,IAAA,0BAAmB,EAAC,OAAO,CAAC,CAAC;AAC7B,IAAA,4BAAoB,EAAC,OAAO,CAAC,CAAC;AAC9B,IAAA,4BAAkB,EAAC,OAAO,CAAC,CAAC;AAE5B,oBAAoB;AACpB,IAAA,uCAAyB,EAAC,OAAO,CAAC,CAAC;AAEnC,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,IAAA,uBAAiB,GAAE,CAAC;AAC5B,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -13,7 +13,7 @@ function registerConfigCommand(program) {
|
|
|
13
13
|
program
|
|
14
14
|
.command("set")
|
|
15
15
|
.description("Save a configuration value")
|
|
16
|
-
.argument("<key-type>", "What to set: agent-key, org-name, endpoint,
|
|
16
|
+
.argument("<key-type>", "What to set: agent-key, org-name, endpoint, network, provider, model")
|
|
17
17
|
.argument("<value>", "The value to save")
|
|
18
18
|
.action((keyType, value) => {
|
|
19
19
|
const config = (0, sdk_1.loadUserConfig)();
|
|
@@ -60,41 +60,41 @@ function registerConfigCommand(program) {
|
|
|
60
60
|
console.log(chalk_1.default.green(`Model saved: ${config.providerModel}`));
|
|
61
61
|
break;
|
|
62
62
|
}
|
|
63
|
-
case "
|
|
64
|
-
const clean = value.trim().
|
|
65
|
-
if (
|
|
66
|
-
console.error(chalk_1.default.red(
|
|
63
|
+
case "network": {
|
|
64
|
+
const clean = value.trim().toLowerCase();
|
|
65
|
+
if (clean !== "public" && clean !== "private") {
|
|
66
|
+
console.error(chalk_1.default.red('Invalid network — must be "public" or "private".'));
|
|
67
67
|
process.exit(1);
|
|
68
68
|
}
|
|
69
|
-
config.
|
|
69
|
+
config.defaultChainNetwork = clean;
|
|
70
70
|
(0, sdk_1.saveUserConfig)(config);
|
|
71
|
-
console.log(chalk_1.default.green(`
|
|
71
|
+
console.log(chalk_1.default.green(`Default chain network saved: ${clean}`));
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
default:
|
|
75
75
|
console.error(chalk_1.default.red(`Unknown key type: ${keyType}`));
|
|
76
|
-
console.error(chalk_1.default.dim("Valid: agent-key, org-name, endpoint,
|
|
76
|
+
console.error(chalk_1.default.dim("Valid: agent-key, org-name, endpoint, network, provider, model"));
|
|
77
77
|
process.exit(1);
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
program
|
|
81
81
|
.command("unset")
|
|
82
82
|
.description("Remove a single configuration value")
|
|
83
|
-
.argument("<key-type>", "What to unset: agent-key, org-name, endpoint,
|
|
83
|
+
.argument("<key-type>", "What to unset: agent-key, org-name, endpoint, network, provider, model")
|
|
84
84
|
.action((keyType) => {
|
|
85
85
|
const config = (0, sdk_1.loadUserConfig)();
|
|
86
86
|
const keyMap = {
|
|
87
87
|
"agent-key": "agentKey",
|
|
88
88
|
"org-name": "orgName",
|
|
89
89
|
endpoint: "judgeEndpoint",
|
|
90
|
-
|
|
90
|
+
network: "defaultChainNetwork",
|
|
91
91
|
provider: "provider",
|
|
92
92
|
model: "providerModel",
|
|
93
93
|
};
|
|
94
94
|
const configKey = keyMap[keyType];
|
|
95
95
|
if (!configKey) {
|
|
96
96
|
console.error(chalk_1.default.red(`Unknown key type: ${keyType}`));
|
|
97
|
-
console.error(chalk_1.default.dim("Valid: agent-key, org-name, endpoint,
|
|
97
|
+
console.error(chalk_1.default.dim("Valid: agent-key, org-name, endpoint, network, provider, model"));
|
|
98
98
|
process.exit(1);
|
|
99
99
|
}
|
|
100
100
|
if (config[configKey] === undefined) {
|
|
@@ -126,7 +126,7 @@ function registerConfigCommand(program) {
|
|
|
126
126
|
publicKey: config.agentKey ? (0, sdk_1.derivePublicKey)(config.agentKey) : null,
|
|
127
127
|
orgName: config.orgName || null,
|
|
128
128
|
endpoint: config.judgeEndpoint || sdk_1.DEFAULT_ENDPOINT,
|
|
129
|
-
|
|
129
|
+
defaultChainNetwork: config.defaultChainNetwork || "private",
|
|
130
130
|
provider: config.provider || null,
|
|
131
131
|
model: config.providerModel || null,
|
|
132
132
|
}, null, 2));
|
|
@@ -155,11 +155,11 @@ function registerConfigCommand(program) {
|
|
|
155
155
|
else {
|
|
156
156
|
console.log(` Endpoint: ${chalk_1.default.dim(`default (${sdk_1.DEFAULT_ENDPOINT})`)}`);
|
|
157
157
|
}
|
|
158
|
-
if (config.
|
|
159
|
-
console.log(`
|
|
158
|
+
if (config.defaultChainNetwork) {
|
|
159
|
+
console.log(` Chain network: ${chalk_1.default.white(config.defaultChainNetwork)}`);
|
|
160
160
|
}
|
|
161
161
|
else {
|
|
162
|
-
console.log(`
|
|
162
|
+
console.log(` Chain network: ${chalk_1.default.dim("default (private)")}`);
|
|
163
163
|
}
|
|
164
164
|
console.log();
|
|
165
165
|
console.log(chalk_1.default.bold(" Provider"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-cmd.js","sourceRoot":"","sources":["../../src/commands/config-cmd.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"config-cmd.js","sourceRoot":"","sources":["../../src/commands/config-cmd.ts"],"names":[],"mappings":";;;;;AAeA,sDAyMC;AA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