@mokuyoaxis/agent-guard 0.2.3-rc2 → 0.2.3
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 +88 -47
- package/README.zh-CN.md +71 -39
- package/adapters/dsh/README.md +15 -10
- package/adapters/dsh/harness/README.md +68 -12
- package/adapters/dsh/harness/bootstrap.patch.yml +5 -0
- package/adapters/dsh/harness/bootstrap_init.mjs +48 -0
- package/adapters/dsh/harness/guard_lab.py +191 -29
- package/adapters/dsh/harness/native_session.py +41 -20
- package/adapters/dsh/harness/profiles.py +74 -22
- package/adapters/kimi-code/README.md +8 -7
- package/core/lab.py +24 -1
- package/core/redaction.py +157 -55
- package/docs/development-note-unguarded-deletion.md +6 -7
- package/docs/friction.md +68 -4
- package/docs/guard-lab-read-trial-task.md +7 -0
- package/docs/guard-lab.md +7 -0
- package/docs/harness-capabilities.md +1 -1
- package/docs/release-notes-0.2.0-rc1.md +2 -2
- package/docs/release-notes-0.2.0.md +2 -2
- package/docs/release-notes-0.2.2.md +7 -8
- package/docs/release-notes-0.2.3-rc1.md +4 -2
- package/docs/release-notes-0.2.3.md +51 -12
- package/docs/secret-guard-analysis.md +13 -12
- package/docs/secret-guard-architecture.md +5 -3
- package/docs/secret-guard-design.md +7 -3
- package/docs/test-report-codex-gpt-5.6-sol.md +10 -11
- package/docs/test-report-kimi-code-block.md +19 -20
- package/docs/test-report-release-readiness-0.2.3.md +78 -0
- package/docs/test-report-workbuddy-windows-core.md +53 -0
- package/docs/test-report-zcode-glm-flash.md +9 -9
- package/package.json +1 -1
- package/skills/delete-guard/SKILL.md +2 -3
- package/skills/exfil-guard/SKILL.md +37 -7
- package/skills/exfil-guard/references/rules.md +84 -16
- package/skills/exfil-guard/scripts/_payload.py +99 -0
- package/skills/exfil-guard/scripts/check_span.py +14 -81
- package/skills/exfil-guard/scripts/sanitize.py +113 -34
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@mokuyoaxis/agent-guard)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](https://www.python.org/)
|
|
7
|
-
[](docs/release-notes-0.2.3.md)
|
|
8
8
|
|
|
9
9
|
**Make destructive agent actions reversible by default.** · [简体中文](README.zh-CN.md)
|
|
10
10
|
|
|
@@ -50,21 +50,20 @@ the human or blocks the operation.
|
|
|
50
50
|
|
|
51
51
|
## Quick start with your coding agent
|
|
52
52
|
|
|
53
|
-
Use the scoped npm package
|
|
54
|
-
|
|
55
|
-
package.
|
|
53
|
+
Use the scoped npm package or a stable Git checkout. The unscoped
|
|
54
|
+
`agent-guard` package is unrelated to this project.
|
|
56
55
|
|
|
57
56
|
Pinned npm installation into a stable, user-owned prefix:
|
|
58
57
|
|
|
59
58
|
```sh
|
|
60
|
-
npm install --prefix /absolute/path/to/agent-guard-install @mokuyoaxis/agent-guard@0.2.
|
|
59
|
+
npm install --prefix /absolute/path/to/agent-guard-install @mokuyoaxis/agent-guard@0.2.3
|
|
61
60
|
```
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
**0.2.3** combines Windows/Core fixes, information-protection improvements
|
|
63
|
+
and the offline guard-lab MVP. See the [release notes](docs/release-notes-0.2.3.md)
|
|
64
|
+
for scope and evidence limits. The npm badge and
|
|
65
|
+
[GitHub Releases](https://github.com/mokuyoaxis/agent-guard/releases) show
|
|
66
|
+
which artifacts are available.
|
|
68
67
|
|
|
69
68
|
The package root is then
|
|
70
69
|
`/absolute/path/to/agent-guard-install/node_modules/@mokuyoaxis/agent-guard`.
|
|
@@ -81,8 +80,10 @@ the host's hook support. Then give your coding agent the following setup prompt
|
|
|
81
80
|
|
|
82
81
|
```text
|
|
83
82
|
Set up agent-guard for this workspace. Use either an existing Git checkout or
|
|
84
|
-
the exact scoped npm package @mokuyoaxis/agent-guard@0.2.
|
|
85
|
-
unscoped package named agent-guard.
|
|
83
|
+
the exact scoped npm package @mokuyoaxis/agent-guard@0.2.3;
|
|
84
|
+
never install the unscoped package named agent-guard. If 0.2.3 is unavailable,
|
|
85
|
+
report that and use the existing checkout or ask me to choose a published
|
|
86
|
+
version. Before installing, ask me to choose and
|
|
86
87
|
approve a stable user-owned prefix. Treat the checkout or installed package
|
|
87
88
|
root as /absolute/path/to/agent-guard below.
|
|
88
89
|
First identify the current harness and its actual hook/skill capabilities;
|
|
@@ -236,19 +237,27 @@ cannot rewrite what it did not write):
|
|
|
236
237
|
|
|
237
238
|
### What is detected
|
|
238
239
|
|
|
239
|
-
**T1 vendor credential patterns** (`secret
|
|
240
|
-
|
|
240
|
+
**T1 vendor credential patterns** (`secret/*`). These rules use known formats;
|
|
241
|
+
documented placeholders and negative examples constrain false positives.
|
|
242
|
+
Rule ids: `secret/openai-key`, `secret/github-token`,
|
|
241
243
|
`secret/aws-access-key-id`, `secret/gitlab-token`, `secret/slack-token`,
|
|
242
|
-
`secret/stripe-key` (live keys only — `sk_test_` is exempt),
|
|
243
|
-
(structural: the header must
|
|
244
|
+
`secret/stripe-key` (live keys only — `sk_test_` is exempt),
|
|
245
|
+
`secret/pypi-token`, `secret/jwt` (structural: the header must decode to JSON
|
|
246
|
+
with a nonempty ASCII string `alg`), and
|
|
244
247
|
`secret/private-key-block` (whole `-----BEGIN ... PRIVATE KEY-----` block,
|
|
245
248
|
redacted in one piece). See
|
|
246
249
|
[skills/exfil-guard/references/rules.md](skills/exfil-guard/references/rules.md)
|
|
247
|
-
for the
|
|
250
|
+
for the rule table and remaining ambiguities.
|
|
251
|
+
|
|
252
|
+
`secret/connection-password` also detects nonempty passwords in URI userinfo.
|
|
253
|
+
It redacts only the password, preserving the scheme, account and host for
|
|
254
|
+
diagnostics. Percent-encoded passwords and JSON-escaped scheme slashes are
|
|
255
|
+
supported; this does not hide network topology or scan every DSN format.
|
|
248
256
|
|
|
249
257
|
**Value-free secret references** (`secret/source-reference`). The guard
|
|
250
|
-
classifies an environment variable's *name* (
|
|
251
|
-
|
|
258
|
+
classifies complete components in an environment variable's *name* (such as
|
|
259
|
+
`KEY`, `TOKEN`, `SECRET`, `PASSWORD`, `PASSWD`, `CRED`, or `AUTH`) and a
|
|
260
|
+
secret-store *file name*
|
|
252
261
|
(`.env`, `*.pem`, `id_rsa*`, `.netrc`, `kubeconfig`, ...), and detects
|
|
253
262
|
whole-environment expansions (`printenv`, `env | ...`, `cat
|
|
254
263
|
/proc/self/environ`). This scanner **does not resolve the variable value**;
|
|
@@ -304,6 +313,28 @@ Exit code contract: `0` = ALLOW/SANITIZED · `2` = BLOCK · `3` = ASK ·
|
|
|
304
313
|
and placeholders only — **never the matched bytes**), and `--path` to enable
|
|
305
314
|
the repo-local exemption file for the file being written.
|
|
306
315
|
|
|
316
|
+
`sanitize.py` enforces the same exit codes: ASK/BLOCK and errors emit no
|
|
317
|
+
payload on stdout. It validates an external `--plan` against the current scan
|
|
318
|
+
and rescans the rewritten text before emitting. Both CLIs use the same default
|
|
319
|
+
workspace and host-side mode; stdin is bounded to the scan cap (4 MiB by default)
|
|
320
|
+
during reading, as is an external plan file. A checker plan produced with an
|
|
321
|
+
explicit mode or path exemption must still satisfy the sanitizer's current
|
|
322
|
+
policy; the plan itself does not authorize emission.
|
|
323
|
+
|
|
324
|
+
Credential detection covers classic and stateless `ghs_APPID_JWT` GitHub
|
|
325
|
+
installation tokens, including long signatures and credentials next to CJK
|
|
326
|
+
prose. Placeholder exemptions require whole shapes; incidental example words
|
|
327
|
+
inside a token do not exempt it. Secret variable references are classified by
|
|
328
|
+
complete name components, preserving ordinary identifiers such as `MONKEY`
|
|
329
|
+
and metadata such as `TOKEN_COUNT`. See the [rule reference](skills/exfil-guard/references/rules.md)
|
|
330
|
+
for supported forms and limitations.
|
|
331
|
+
|
|
332
|
+
PyPI publishing tokens are also detected with their documented prefix and
|
|
333
|
+
minimum body shape, with complete redaction of long tokens. AWS group/user/
|
|
334
|
+
role/policy IDs are kept distinct from access-key IDs; JWT headers require
|
|
335
|
+
the declared nonempty ASCII string `alg`. Public-key variable names and the
|
|
336
|
+
broad legacy `sk-` shape retain their documented conservative boundaries.
|
|
337
|
+
|
|
307
338
|
### Read a config without printing its values
|
|
308
339
|
|
|
309
340
|
Introduced in the `0.2.0` source; this CLI is **not** in the earlier
|
|
@@ -359,8 +390,8 @@ is a false security claim:
|
|
|
359
390
|
guard can see *on the way out*.
|
|
360
391
|
- **No history rewriting.** Detecting a secret already in Git history is a
|
|
361
392
|
report at most. Rewriting history is a human action with its own risks.
|
|
362
|
-
- **No T3 entropy detector in this release.**
|
|
363
|
-
|
|
393
|
+
- **No T3 entropy detector in this release.** Random-looking text alone is
|
|
394
|
+
insufficient evidence of a credential; ordinary identifiers stay readable.
|
|
364
395
|
|
|
365
396
|
## Manual, harness-neutral usage
|
|
366
397
|
|
|
@@ -413,12 +444,18 @@ quarantine full → BLOCK (never fall back to permanent delete)
|
|
|
413
444
|
|
|
414
445
|
## Integration and validation matrix
|
|
415
446
|
|
|
416
|
-
[](.github/workflows/ci.yml)
|
|
417
448
|
[](docs/test-report-codex-gpt-6-astra-high.md)
|
|
418
449
|
[](docs/test-report-dsh-0.1.5-rc.1.md)
|
|
419
450
|
[](docs/test-report-zcode-glm-flash.md)
|
|
420
451
|
[](docs/test-report-claude-code-harness.md)
|
|
421
|
-
[](docs/test-report-kimi-code-block.md)
|
|
453
|
+
[](docs/test-report-workbuddy-windows-core.md)
|
|
454
|
+
[](docs/release-notes-0.2.3-rc1.md#focused-windows-ci)
|
|
455
|
+
[](docs/test-report-release-readiness-0.2.3.md)
|
|
456
|
+
|
|
457
|
+
These badges link to scoped evidence; they do not certify every tool or model.
|
|
458
|
+
The DSH text-read feature is optional and off by default.
|
|
422
459
|
|
|
423
460
|
"The Core works", "a Skill-guided agent used it", and "the harness
|
|
424
461
|
intercepts every matching tool call" are separate claims. This table keeps
|
|
@@ -431,8 +468,9 @@ those evidence levels explicit:
|
|
|
431
468
|
| **DSH CLI rc.1 / tools and FS rc.2 / Node 22** | [Experimental text-read redaction](adapters/dsh/README.md#experimental-text-read-redaction), default off | [Zero-model native probe](docs/test-report-dsh-read-redaction.md): next request and durable JSONL. [Official Flash direct-read off/on](docs/test-report-dsh-real-followup.md): supported synthetic secrets redacted in tool content/meta/session, useful config preserved; no injection L2 claim. |
|
|
432
469
|
| **DSH 0.2.0-rc.2 / Node 22** | [Default deletion and optional text-read adapter](adapters/dsh/README.md) | [Fresh contract review](docs/test-report-release-readiness-0.2.3.md): native deletion blocking, read redaction on reviewed local/sandbox FS, next synthetic request and durable JSONL. Native v4 Lab support remains bounded; no new real-model L2 result. |
|
|
433
470
|
| **Codex CLI 0.154.0 (tested session)** | [Skill + production CLI](docs/test-report-codex-gpt-6-astra-high.md) | Older-source cooperative acceptance; no native hook claim. |
|
|
471
|
+
| **WorkBuddy (version not recorded; Windows 11)** | [Core / CLI](docs/test-report-workbuddy-windows-core.md) | Community feedback on 0.2.2 found two Core defects now covered by regressions and focused Windows CI; no WorkBuddy adapter or native-hook validation. |
|
|
434
472
|
| **ZCode (version unrecorded; win32)** | [Historical Skill/CLI + hook trial](docs/test-report-zcode-glm-flash.md) | Older hook observation includes a persistent-permission bypass; current version unverified. |
|
|
435
|
-
| **Kimi Code 0.42.0 / 2.1.1** | [Native `PreToolUse` for Bash](adapters/kimi-code/README.md) | [Bounded tests](docs/test-report-kimi-code-block.md): authenticated 2.1.1 root-Bash PASS on an OAuth official model and
|
|
473
|
+
| **Kimi Code 0.42.0 / 2.1.1** | [Native `PreToolUse` for Bash](adapters/kimi-code/README.md) | [Bounded tests](docs/test-report-kimi-code-block.md): authenticated 2.1.1 root-Bash PASS on an OAuth official model and a second configured model route; older 0.42.0 root/child BLOCK, ASK denial and Python-failure refusal. Hook absence/timeout remains fail-open. |
|
|
436
474
|
| **Other / unlisted hosts** | [Self-adaptation guide](adapters/INTEGRATION.md) | No native claim without a blocking pre-tool event and independent non-execution check. |
|
|
437
475
|
|
|
438
476
|
For agent-led setup: identify the actual host version and tool names, follow
|
|
@@ -501,7 +539,8 @@ compensation engine without restructuring.
|
|
|
501
539
|
| [docs/architecture.md](docs/architecture.md) | pillars ↔ components, data flow, design decisions |
|
|
502
540
|
| [docs/host-drift.md](docs/host-drift.md) | zero-token host/version drift states and privacy-minimal baselines |
|
|
503
541
|
| [docs/guard-lab.md](docs/guard-lab.md) | synthetic Lab workflow, evidence semantics, and unsupported channels |
|
|
504
|
-
| [docs/release-notes-0.2.3
|
|
542
|
+
| [docs/release-notes-0.2.3.md](docs/release-notes-0.2.3.md) | 0.2.3 stable-release scope and evidence limits |
|
|
543
|
+
| [docs/release-notes-0.2.3-rc2.md](docs/release-notes-0.2.3-rc2.md) | published prerelease: offline guard-lab and reviewed DSH contracts |
|
|
505
544
|
| [docs/release-notes-0.2.3-rc1.md](docs/release-notes-0.2.3-rc1.md) | Windows Core fail-closed candidate and prerelease channel |
|
|
506
545
|
| [docs/release-notes-0.2.2.md](docs/release-notes-0.2.2.md) | 0.2.2 host drift, live sentinel and DSH package acceptance |
|
|
507
546
|
| [docs/release-notes-0.2.1.md](docs/release-notes-0.2.1.md) | 0.2.1 adapter/doctor changes and bounded evidence |
|
|
@@ -511,7 +550,8 @@ compensation engine without restructuring.
|
|
|
511
550
|
| [docs/friction.md](docs/friction.md) | what real agents and host processes taught us (F1–F20) |
|
|
512
551
|
| [docs/development-note-unguarded-deletion.md](docs/development-note-unguarded-deletion.md) | de-identified incident exploration and the recovery-aware direction |
|
|
513
552
|
| [docs/test-report-codex-gpt-5.6-sol.md](docs/test-report-codex-gpt-5.6-sol.md) | v0.1.1 Codex evaluation (medium + high) |
|
|
514
|
-
| [docs/test-report-
|
|
553
|
+
| [docs/test-report-workbuddy-windows-core.md](docs/test-report-workbuddy-windows-core.md) | community Windows Core/CLI feedback and resulting regressions |
|
|
554
|
+
| [docs/test-report-dsh-0.1.5-rc.1.md](docs/test-report-dsh-0.1.5-rc.1.md) | DSH 0.1.5-rc.1 packaged-plugin and execution-level `bash` acceptance |
|
|
515
555
|
| [docs/test-report-dsh-guard-lab.md](docs/test-report-dsh-guard-lab.md) | bounded DSH real-model Lab baseline; no L2 claim |
|
|
516
556
|
| [docs/test-report-dsh-v0.1.1.md](docs/test-report-dsh-v0.1.1.md) | v0.1.1 DSH live test (DeepSeek V4 Pro high, minimal mode) |
|
|
517
557
|
| [skills/recovery-audit/SKILL.md](skills/recovery-audit/SKILL.md) | evidence hierarchy, deterministic replay, recovery and landing gates |
|
|
@@ -521,37 +561,38 @@ compensation engine without restructuring.
|
|
|
521
561
|
|
|
522
562
|
## Status & roadmap
|
|
523
563
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
[0.2.3
|
|
533
|
-
[
|
|
534
|
-
[
|
|
535
|
-
[
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
564
|
+
**v0.2.3** combines the Windows/Core
|
|
565
|
+
fixes and offline guard-lab MVP with validated text redaction, URI password
|
|
566
|
+
detection, PyPI and newer GitHub token support, and narrower false-positive
|
|
567
|
+
boundaries. Existing recovery tools, safe config inspection, Claude/Kimi
|
|
568
|
+
bridges, doctor, host-drift checks and live sentinel remain available.
|
|
569
|
+
The DSH bridge supports the reviewed `0.1.5-rc.1` and `0.2.0-rc.2` contracts;
|
|
570
|
+
its optional text-read protection remains off by default.
|
|
571
|
+
|
|
572
|
+
The [0.2.3 notes](docs/release-notes-0.2.3.md) describe this release's scope.
|
|
573
|
+
The [rc2](docs/release-notes-0.2.3-rc2.md),
|
|
574
|
+
[rc1](docs/release-notes-0.2.3-rc1.md), and
|
|
575
|
+
[0.2.2](docs/release-notes-0.2.2.md) notes retain their historical scope.
|
|
576
|
+
Check [GitHub Releases](https://github.com/mokuyoaxis/agent-guard/releases)
|
|
577
|
+
and npm for published artifacts.
|
|
578
|
+
|
|
579
|
+
The Core and Decision Protocol are shared across harnesses. DSH, Claude and
|
|
580
|
+
Kimi adapters, together with Codex/WorkBuddy/ZCode acceptance records, are documented in
|
|
581
|
+
one compatibility matrix.
|
|
541
582
|
The Kimi result includes sampled hook-compensation and execution-level BLOCK
|
|
542
583
|
paths, not proof that its host enforces every BLOCK or that arbitrary agent
|
|
543
584
|
actions are protected. A tested direct-Python hook startup failure was
|
|
544
585
|
fail-open. The optional shell bridge blocked a sampled Python startup failure
|
|
545
586
|
in a real Kimi host session, but only when the bridge itself ran; config
|
|
546
587
|
validation alone cannot prove that the hook is live.
|
|
547
|
-
The
|
|
588
|
+
The release adds a focused real-Windows Core gate for Issue #7, but native
|
|
548
589
|
cmd/PowerShell execution through every harness and general concurrent-subagent
|
|
549
590
|
safety remain explicit gaps. Later Guard branches (`git-guard`, `database-guard`,
|
|
550
591
|
`cloud-guard`) reuse the same protocol and compensation engine.
|
|
551
592
|
|
|
552
|
-
##
|
|
593
|
+
## guard-lab
|
|
553
594
|
|
|
554
|
-
The
|
|
595
|
+
The opt-in, offline honeytoken Lab uses disposable
|
|
555
596
|
projects and synthetic, non-secret markers. Its `clean`, `mock-positive`,
|
|
556
597
|
`mock-injection`, and `snapshot-positive` controls call no model and make no
|
|
557
598
|
external request. A bounded loopback observer records the fake Lab stub, bait
|
|
@@ -560,7 +601,7 @@ canary in selected output without retaining the raw value.
|
|
|
560
601
|
|
|
561
602
|
The user keeps the true controller and evidence outside the fixture shown to
|
|
562
603
|
the tested agent. Broken controls or changed evidence produce `INCONCLUSIVE`,
|
|
563
|
-
never an optimistic pass.
|
|
604
|
+
never an optimistic pass. The Lab cannot observe ordinary file
|
|
564
605
|
reads, prove remote transfer, universally block LLM calls, or resist a same-UID
|
|
565
606
|
adversary. Start with the zero-token controls and read the
|
|
566
607
|
[guard-lab guide](docs/guard-lab.md) before involving a real harness.
|
package/README.zh-CN.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@mokuyoaxis/agent-guard)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](https://www.python.org/)
|
|
7
|
-
[](docs/release-notes-0.2.3.md)
|
|
8
8
|
|
|
9
9
|
**让 AI Agent 的破坏性操作默认可逆。** · [English](README.md)
|
|
10
10
|
|
|
@@ -41,19 +41,19 @@ git push --force → BLOCK # 不自动改写远端历史
|
|
|
41
41
|
|
|
42
42
|
## 让编码 Agent 帮你接入
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
可以安装带作用域的 npm 包,也可以保留一个稳定的 Git checkout。
|
|
45
|
+
无作用域的同名 `agent-guard` 包与本项目无关。
|
|
46
46
|
|
|
47
47
|
把固定版本安装到用户选择的稳定路径:
|
|
48
48
|
|
|
49
49
|
```sh
|
|
50
|
-
npm install --prefix /absolute/path/to/agent-guard-install @mokuyoaxis/agent-guard@0.2.
|
|
50
|
+
npm install --prefix /absolute/path/to/agent-guard-install @mokuyoaxis/agent-guard@0.2.3
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
**0.2.3** 合并 Windows/Core 修复、信息保护增强和离线 guard-lab MVP。
|
|
54
|
+
本次范围与证据边界见 [发布说明](docs/release-notes-0.2.3.md);
|
|
55
|
+
npm 徽章和 [GitHub Releases](https://github.com/mokuyoaxis/agent-guard/releases)
|
|
56
|
+
展示实际可用的发布工件。
|
|
57
57
|
|
|
58
58
|
安装后的包根目录是
|
|
59
59
|
`/absolute/path/to/agent-guard-install/node_modules/@mokuyoaxis/agent-guard`。
|
|
@@ -69,7 +69,8 @@ Core 需要 Python 3.9+ 和 Git;是否能自动拦截取决于宿主是否提
|
|
|
69
69
|
|
|
70
70
|
```text
|
|
71
71
|
请为当前工作区接入 agent-guard。只使用现有 Git checkout,或精确的 scoped
|
|
72
|
-
npm 包 @mokuyoaxis/agent-guard@0.2.
|
|
72
|
+
npm 包 @mokuyoaxis/agent-guard@0.2.3;不要安装无作用域的同名
|
|
73
|
+
agent-guard。若 0.2.3 尚不可用,说明情况,使用现有 checkout 或让我选择已发布版本。
|
|
73
74
|
安装前先让我选择并批准一个稳定的用户目录,然后把 checkout 或 npm 安装后的
|
|
74
75
|
包根目录作为下文的 /absolute/path/to/agent-guard。
|
|
75
76
|
先识别当前 harness 实际支持的 hook 与 Skill,阅读本 README 和对应 adapter
|
|
@@ -203,16 +204,21 @@ DSH 另有[默认关闭的文本 `read` 脱敏原型](adapters/dsh/README.md#exp
|
|
|
203
204
|
|
|
204
205
|
### 检测什么
|
|
205
206
|
|
|
206
|
-
**T1
|
|
207
|
+
**T1 厂商凭据特征**(`secret/*`)。按已知格式识别,用文档化占位符和反例
|
|
208
|
+
约束误伤。rule id 包括:
|
|
207
209
|
`secret/openai-key`、`secret/github-token`、`secret/aws-access-key-id`、
|
|
208
210
|
`secret/gitlab-token`、`secret/slack-token`、`secret/stripe-key`
|
|
209
|
-
(仅 live key,`sk_test_` 豁免)、`secret/jwt
|
|
210
|
-
|
|
211
|
-
(整段 `-----BEGIN ... PRIVATE KEY-----` 一次性脱敏)
|
|
211
|
+
(仅 live key,`sk_test_` 豁免)、`secret/pypi-token`、`secret/jwt`(结构化:
|
|
212
|
+
头部须解码为 JSON,且 `alg` 是非空 ASCII 字符串),以及 `secret/private-key-block`
|
|
213
|
+
(整段 `-----BEGIN ... PRIVATE KEY-----` 一次性脱敏)。规则表与保留边界见
|
|
212
214
|
[skills/exfil-guard/references/rules.md](skills/exfil-guard/references/rules.md)。
|
|
213
215
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
+
`secret/connection-password` 另检测 URI 用户信息中的非空口令,只遮口令,
|
|
217
|
+
保留协议、账号与主机以便排错。支持百分号编码口令和 JSON 转义的协议斜杠;
|
|
218
|
+
这不等于隐藏网络拓扑,也不覆盖所有 DSN 格式。
|
|
219
|
+
|
|
220
|
+
**不读值的密钥引用**(`secret/source-reference`)。Guard 按变量名中的完整
|
|
221
|
+
组成部分(如 `KEY`、`TOKEN`、`SECRET`、`PASSWORD`、`PASSWD`、`CRED`、`AUTH`)与
|
|
216
222
|
密钥库**文件名**(`.env`、`*.pem`、`id_rsa*`、`.netrc`、`kubeconfig` 等)
|
|
217
223
|
分类,并识别整环境展开(`printenv`、`env | ...`、
|
|
218
224
|
`cat /proc/self/environ`)。这个扫描器**不解析变量的值**;这不代表其他
|
|
@@ -264,6 +270,21 @@ echo 'config: sk-proj-AbCdEf…' | python3 skills/exfil-guard/scripts/sanitize.p
|
|
|
264
270
|
`--json` 输出机器可读判决(仅偏移、rule id 与占位符——**绝不含匹配到的
|
|
265
271
|
字节**);`--path` 为即将写入的文件启用仓库本地豁免文件。
|
|
266
272
|
|
|
273
|
+
`sanitize.py` 同样落实上述退出码:ASK/BLOCK 和错误时 stdout 不输出正文。
|
|
274
|
+
外部 `--plan` 必须与当前扫描一致,改写后复扫通过才输出。两个 CLI 共用默认
|
|
275
|
+
工作区和宿主模式;stdin 在读取时即受到扫描上限限制(默认 4 MiB),外部计划文件
|
|
276
|
+
也受同一上限约束。checker 使用显式模式或路径豁免产生的计划,仍须满足 sanitizer
|
|
277
|
+
当前策略;计划本身不是发送授权。
|
|
278
|
+
|
|
279
|
+
凭据检测支持经典和 `ghs_APPID_JWT` GitHub 安装令牌,完整遮挡长签名,并能识别
|
|
280
|
+
紧贴中文的凭据。占位符豁免要求完整形状,token 内偶然出现示例词不会整段放行。
|
|
281
|
+
秘密变量引用按名称组成部分判断,保留 `MONKEY` 等普通标识符和 `TOKEN_COUNT`
|
|
282
|
+
等元数据名称。支持的形式和限制见[规则说明](skills/exfil-guard/references/rules.md)。
|
|
283
|
+
|
|
284
|
+
新增 PyPI 发布令牌识别,按官方前缀与最小 body 形状完整遮挡长令牌。AWS 组/
|
|
285
|
+
用户/角色/策略 ID 与访问密钥 ID 分开处理;JWT header 的 `alg` 须为非空
|
|
286
|
+
ASCII 字符串。公钥变量名称与通用 `sk-` 形状仍保留已说明的保守边界。
|
|
287
|
+
|
|
267
288
|
### 不打印值地查看配置
|
|
268
289
|
|
|
269
290
|
此 CLI 从 `0.2.0` 源码开始提供,**不属于**此前的 `0.2.0-rc2`
|
|
@@ -312,7 +333,8 @@ python3 skills/exfil-guard/scripts/view.py --workspace /path/to/workspace config
|
|
|
312
333
|
路径上**能看到的内容。
|
|
313
334
|
- **不改写历史。** 检测到已经进入 git 历史的密钥最多只是一份报告。
|
|
314
335
|
改写历史是需要人类执行、且自带风险的动作。
|
|
315
|
-
- **本版本不含 T3 熵检测器。**
|
|
336
|
+
- **本版本不含 T3 熵检测器。** 不把看起来随机的字符串直接当作凭据,减少
|
|
337
|
+
对普通标识符的干扰。
|
|
316
338
|
|
|
317
339
|
## 手动使用(不依赖特定 harness)
|
|
318
340
|
|
|
@@ -363,12 +385,18 @@ node_modules/(已 ignore) → ALLOW (可证明可再生)
|
|
|
363
385
|
|
|
364
386
|
## 接入与验证矩阵
|
|
365
387
|
|
|
366
|
-
[](.github/workflows/ci.yml)
|
|
367
389
|
[](docs/test-report-codex-gpt-6-astra-high.md)
|
|
368
390
|
[](docs/test-report-dsh-0.1.5-rc.1.md)
|
|
369
391
|
[](docs/test-report-zcode-glm-flash.md)
|
|
370
392
|
[](docs/test-report-claude-code-harness.md)
|
|
371
|
-
[](docs/test-report-kimi-code-block.md)
|
|
394
|
+
[](docs/test-report-workbuddy-windows-core.md)
|
|
395
|
+
[](docs/release-notes-0.2.3-rc1.md#focused-windows-ci)
|
|
396
|
+
[](docs/test-report-release-readiness-0.2.3.md)
|
|
397
|
+
|
|
398
|
+
徽章链接到各自范围内的证据,不代表所有工具和模型均已通过。
|
|
399
|
+
DSH 文本读取脱敏是可选功能,默认关闭。
|
|
372
400
|
|
|
373
401
|
“Core 可用”、“受 Skill 引导的 Agent 使用过”和“harness 会强制拦截每次匹配的
|
|
374
402
|
工具调用”是三种不同强度的结论:
|
|
@@ -380,8 +408,9 @@ node_modules/(已 ignore) → ALLOW (可证明可再生)
|
|
|
380
408
|
| **DSH CLI rc.1/工具与 FS rc.2/Node 22** | [实验性文本读取脱敏](adapters/dsh/README.md#experimental-text-read-redaction),默认关闭 | [零模型原生验证](docs/test-report-dsh-read-redaction.md):下一次请求和 JSONL 落盘。[官方 Flash 真实读取 off/on](docs/test-report-dsh-real-followup.md):支持规则的合成秘密在工具内容/元数据/会话中被脱敏,有用配置保留;无提示注入 L2 结论。 |
|
|
381
409
|
| **DSH 0.2.0-rc.2/Node 22** | [默认删除与可选文本读取 adapter](adapters/dsh/README.md) | [最新契约复核](docs/test-report-release-readiness-0.2.3.md):原生删除阻断、已审阅本地/沙箱 FS 的读取脱敏、下一次合成请求与 JSONL 落盘。原生 v4 Lab 支持仍有范围限制;没有新的真实模型 L2 结果。 |
|
|
382
410
|
| **Codex CLI 0.154.0(所测会话)** | [Skill + 生产 CLI](docs/test-report-codex-gpt-6-astra-high.md) | 较早源码的合作式验收;不声称原生 hook。 |
|
|
411
|
+
| **WorkBuddy(版本未记录;Windows 11)** | [Core/CLI](docs/test-report-workbuddy-windows-core.md) | 社区在 0.2.2 上发现两个 Core 缺陷,现有回归与聚焦 Windows CI 覆盖;没有 WorkBuddy adapter 或原生 hook 验证。 |
|
|
383
412
|
| **ZCode(版本未记录;win32)** | [历史 Skill/CLI+hook 试次](docs/test-report-zcode-glm-flash.md) | 旧报告记录了持久许可绕过 hook;当前版本未验证。 |
|
|
384
|
-
| **Kimi Code 0.42.0 / 2.1.1** | [Bash 原生 `PreToolUse`](adapters/kimi-code/README.md) | [有界实测](docs/test-report-kimi-code-block.md):2.1.1 在 OAuth
|
|
413
|
+
| **Kimi Code 0.42.0 / 2.1.1** | [Bash 原生 `PreToolUse`](adapters/kimi-code/README.md) | [有界实测](docs/test-report-kimi-code-block.md):2.1.1 在 OAuth 官方模型和另一条已配置模型路由上均取得根 Bash PASS;0.42.0 另有主/子代理 BLOCK、ASK 硬拒绝和 Python 故障拒绝。hook 缺席/超时仍可能放行。 |
|
|
385
414
|
| **其他/未列出宿主** | [自适配指南](adapters/INTEGRATION.md) | 未独立验证调用前阻断与目标未执行前,不作原生支持声明。 |
|
|
386
415
|
|
|
387
416
|
由 Agent 协助接入时,先识别真实宿主版本与工具名称,阅读上表对应指南,
|
|
@@ -442,7 +471,8 @@ Skill 负责 Agent 行为引导,约束全部下沉 Core。未来的 `git-guard`
|
|
|
442
471
|
| [docs/architecture.md](docs/architecture.md) | 四柱↔组件映射、数据流、关键设计决定 |
|
|
443
472
|
| [docs/host-drift.md](docs/host-drift.md) | 零 Token 宿主/版本漂移状态与最小化基线 |
|
|
444
473
|
| [docs/guard-lab.md](docs/guard-lab.md) | 合成 Lab 流程、证据语义与不支持的信道 |
|
|
445
|
-
| [docs/release-notes-0.2.3
|
|
474
|
+
| [docs/release-notes-0.2.3.md](docs/release-notes-0.2.3.md) | 0.2.3 正式版范围与证据边界 |
|
|
475
|
+
| [docs/release-notes-0.2.3-rc2.md](docs/release-notes-0.2.3-rc2.md) | 已发布预览版:离线 guard-lab 与已复核 DSH 契约 |
|
|
446
476
|
| [docs/release-notes-0.2.3-rc1.md](docs/release-notes-0.2.3-rc1.md) | Windows Core fail-closed 候选版与预发布通道 |
|
|
447
477
|
| [docs/release-notes-0.2.2.md](docs/release-notes-0.2.2.md) | 0.2.2 宿主漂移、实时哨兵与 DSH 打包验收 |
|
|
448
478
|
| [docs/release-notes-0.2.1.md](docs/release-notes-0.2.1.md) | 0.2.1 adapter/doctor 变更与证据边界 |
|
|
@@ -452,7 +482,8 @@ Skill 负责 Agent 行为引导,约束全部下沉 Core。未来的 `git-guard`
|
|
|
452
482
|
| [docs/friction.md](docs/friction.md) | 真实 Agent 与宿主进程撞出来的教训(F1–F20) |
|
|
453
483
|
| [docs/development-note-unguarded-deletion.md](docs/development-note-unguarded-deletion.md) | 去标识化事故探索与面向恢复的后续方向 |
|
|
454
484
|
| [docs/test-report-codex-gpt-5.6-sol.md](docs/test-report-codex-gpt-5.6-sol.md) | v0.1.1 Codex 评估(medium + high) |
|
|
455
|
-
| [docs/test-report-
|
|
485
|
+
| [docs/test-report-workbuddy-windows-core.md](docs/test-report-workbuddy-windows-core.md) | 社区 Windows Core/CLI 反馈与对应回归 |
|
|
486
|
+
| [docs/test-report-dsh-0.1.5-rc.1.md](docs/test-report-dsh-0.1.5-rc.1.md) | DSH 0.1.5-rc.1 打包插件与执行级 `bash` 验收 |
|
|
456
487
|
| [docs/test-report-dsh-guard-lab.md](docs/test-report-dsh-guard-lab.md) | DSH 真实模型有界 Lab 基线;无 L2 结论 |
|
|
457
488
|
| [docs/test-report-dsh-v0.1.1.md](docs/test-report-dsh-v0.1.1.md) | v0.1.1 DSH 真机测试(DeepSeek V4 Pro high,极简模式) |
|
|
458
489
|
| [skills/recovery-audit/SKILL.md](skills/recovery-audit/SKILL.md) | 证据优先级、确定性回放、恢复与落地门禁 |
|
|
@@ -462,38 +493,39 @@ Skill 负责 Agent 行为引导,约束全部下沉 Core。未来的 `git-guard`
|
|
|
462
493
|
|
|
463
494
|
## 状态与路线图
|
|
464
495
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
[0.2.3
|
|
473
|
-
[0.2.
|
|
474
|
-
[
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
496
|
+
**v0.2.3** 合并 Windows/Core 修复和离线 guard-lab
|
|
497
|
+
MVP,并增强文本脱敏执行与校验、URI 口令识别、PyPI/新版 GitHub 令牌保护,
|
|
498
|
+
收窄部分误伤边界。已有的恢复工具、配置安全视图、Claude/Kimi 接入桥、
|
|
499
|
+
doctor、宿主漂移检查与实时哨兵继续提供。
|
|
500
|
+
DSH 接入支持已复核的 `0.1.5-rc.1` 和 `0.2.0-rc.2` 契约;可选文本读取
|
|
501
|
+
保护仍默认关闭。
|
|
502
|
+
|
|
503
|
+
[0.2.3 说明](docs/release-notes-0.2.3.md)记录本次范围;
|
|
504
|
+
[rc2](docs/release-notes-0.2.3-rc2.md)、[rc1](docs/release-notes-0.2.3-rc1.md)
|
|
505
|
+
和 [0.2.2](docs/release-notes-0.2.2.md) 说明保留各自历史范围。
|
|
506
|
+
已发布工件以 [GitHub Releases](https://github.com/mokuyoaxis/agent-guard/releases)
|
|
507
|
+
和 npm 为准。
|
|
508
|
+
|
|
509
|
+
Core 和 Decision Protocol 由各 harness 共用。DSH、Claude、Kimi 的适配器
|
|
510
|
+
以及 Codex/WorkBuddy/ZCode 的验收记录,统一列在兼容矩阵中。
|
|
479
511
|
Kimi 结果包含所测调用的 hook 补偿与执行级 BLOCK 证据,不证明宿主强制执行
|
|
480
512
|
所有 `BLOCK`,也不意味着任意 Agent 操作都受保护。实测旧的直连 Python hook
|
|
481
513
|
启动故障会放行;可选 shell 桥在一次 Kimi 宿主故障注入中将其转为拒绝,
|
|
482
|
-
但前提是桥自身成功运行;单凭配置校验无法证明 hook
|
|
514
|
+
但前提是桥自身成功运行;单凭配置校验无法证明 hook 在线。本次版本为 Issue #7
|
|
483
515
|
新增了聚焦的真实 Windows Core 门,但各 harness 下的原生 cmd/PowerShell
|
|
484
516
|
执行与一般并发子代理安全仍是明确缺口。
|
|
485
517
|
后续 `git-guard`、`database-guard`、`cloud-guard` 继续复用同一协议与补偿引擎。
|
|
486
518
|
|
|
487
|
-
##
|
|
519
|
+
## guard-lab 合成蜜罐
|
|
488
520
|
|
|
489
|
-
|
|
521
|
+
可选的离线蜜罐 Lab 在一次性项目中放入不具备认证能力的合成
|
|
490
522
|
标记。`clean`、`mock-positive`、`mock-injection` 与 `snapshot-positive` 四组
|
|
491
523
|
对照不调用模型,也不访问外网;限时回环观察器记录假 Lab 工具、诱饵 URL 或
|
|
492
524
|
经验证的合成快照,用户还可在试次结束后显式扫描选定输出,只保留哈希、阶段与
|
|
493
525
|
命中的 bait id,不保存原值。
|
|
494
526
|
|
|
495
527
|
真控制器与证据由用户保管,和交给受测 Agent 的夹具分开。观察器、控制文件或
|
|
496
|
-
事件链有问题时只报 `INCONCLUSIVE
|
|
528
|
+
事件链有问题时只报 `INCONCLUSIVE`。Lab 不能看到普通文件读取,不能证明数据
|
|
497
529
|
已经外发,不能普遍封禁 LLM 调用,也不能抵抗同一系统用户权限下的对手。
|
|
498
530
|
涉及真实 harness 前,请先跑零 Token 对照并阅读
|
|
499
531
|
[guard-lab 指南](docs/guard-lab.md)。
|
package/adapters/dsh/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# agent-guard adapter for DeepSeek Harness
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
DSH integration shipped as a `dsh-plugin` bundle in the Agent Guard package.
|
|
4
|
+
This adapter maps the Decision Protocol onto DSH's native mechanisms and
|
|
5
|
+
delegates deletion verdicts to the shared Python core
|
|
6
|
+
(`skills/delete-guard/scripts/check.py`).
|
|
7
7
|
The opt-in text-read prototype reuses the existing Core exfil policy through
|
|
8
8
|
a bounded local worker. Both ship inside this package.
|
|
9
9
|
|
|
@@ -19,9 +19,14 @@ retains the earlier failures and correction history.
|
|
|
19
19
|
## Install
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
dsh plugin --profile <your-profile> add @mokuyoaxis/agent-guard
|
|
22
|
+
dsh plugin --profile <your-profile> add @mokuyoaxis/agent-guard@0.2.3
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
Use an exact package version whose host contract matches your DSH installation.
|
|
26
|
+
The package ships prebuilt JavaScript and its Python Core; Python 3.9+ and
|
|
27
|
+
Git must already be available. Installation does not enable the optional
|
|
28
|
+
text-read guard.
|
|
29
|
+
|
|
25
30
|
## What gets registered
|
|
26
31
|
|
|
27
32
|
| Contribution | Mechanism | Behavior |
|
|
@@ -101,8 +106,9 @@ preserved useful configuration and remains outside the Lab injection L2 protocol
|
|
|
101
106
|
Custom/later finalizers, unreviewed tool providers, PTC, other tool results,
|
|
102
107
|
early events, tool-call arguments and preexisting session data are outside
|
|
103
108
|
this prototype. Plugin composition is trusted; the binding check is not
|
|
104
|
-
authentication of arbitrary plugins.
|
|
105
|
-
|
|
109
|
+
authentication of arbitrary plugins. Lab pairs enable this flag only when
|
|
110
|
+
the explicit [`read-redaction-v1` profile](harness/README.md#explicit-native-read-redaction-profile)
|
|
111
|
+
is selected; the default profiles keep it off.
|
|
106
112
|
|
|
107
113
|
## Shell dialect
|
|
108
114
|
|
|
@@ -126,9 +132,8 @@ is forwarded verbatim rather than swapped for POSIX, so `check.py` returns
|
|
|
126
132
|
event contract, or failure before listener registration cannot deny a call
|
|
127
133
|
the adapter never receives.
|
|
128
134
|
- The Python core requires `python3` and `git` on PATH.
|
|
129
|
-
-
|
|
130
|
-
|
|
131
|
-
as available.
|
|
135
|
+
- The scoped npm package is published. Use an exact package version when
|
|
136
|
+
reproducing a test; a source checkout may contain later changes.
|
|
132
137
|
- DSH `0.1.5-rc.1` package loading and one harmless execution-level `bash`
|
|
133
138
|
block are independently verified in the
|
|
134
139
|
[bounded host report](../../docs/test-report-dsh-0.1.5-rc.1.md). Model,
|