@mokuyoaxis/agent-guard 0.2.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.
Files changed (77) hide show
  1. package/CONTRIBUTING.md +101 -0
  2. package/LICENSE +21 -0
  3. package/README.md +558 -0
  4. package/README.zh-CN.md +488 -0
  5. package/adapters/INTEGRATION.md +94 -0
  6. package/adapters/claude/README.md +141 -0
  7. package/adapters/claude/compatibility.json +17 -0
  8. package/adapters/claude/harness/README.md +59 -0
  9. package/adapters/claude/harness/mock_anthropic_api.mjs +47 -0
  10. package/adapters/claude/harness/run_scenario.sh +79 -0
  11. package/adapters/claude/harness/run_scenario_no_python3.sh +49 -0
  12. package/adapters/claude/hook_bridge.sh +33 -0
  13. package/adapters/claude/pre_tool_use.py +264 -0
  14. package/adapters/claude/settings.example.json +16 -0
  15. package/adapters/codex/harness/README.md +53 -0
  16. package/adapters/codex/harness/acceptance.py +226 -0
  17. package/adapters/dsh/README.md +62 -0
  18. package/adapters/dsh/cordis.patch.yml +30 -0
  19. package/adapters/dsh/lib/index.js +500 -0
  20. package/adapters/kimi-code/README.md +169 -0
  21. package/adapters/kimi-code/compatibility.json +17 -0
  22. package/adapters/kimi-code/config.example.toml +26 -0
  23. package/adapters/kimi-code/hook_bridge.sh +32 -0
  24. package/adapters/kimi-code/pre_tool_use.py +72 -0
  25. package/core/__init__.py +47 -0
  26. package/core/audit.py +86 -0
  27. package/core/classifier.py +1175 -0
  28. package/core/dialects.py +898 -0
  29. package/core/policy.py +817 -0
  30. package/core/recovery.py +700 -0
  31. package/core/redaction.py +1096 -0
  32. package/core/safe_view.py +212 -0
  33. package/docs/architecture.md +223 -0
  34. package/docs/compatibility.md +142 -0
  35. package/docs/development-note-unguarded-deletion.md +187 -0
  36. package/docs/friction.md +266 -0
  37. package/docs/harness-capabilities.md +72 -0
  38. package/docs/host-drift.md +142 -0
  39. package/docs/publishing-from-ephemeral-environments.md +104 -0
  40. package/docs/release-notes-0.2.0-rc1.md +46 -0
  41. package/docs/release-notes-0.2.0.md +72 -0
  42. package/docs/release-notes-0.2.1.md +78 -0
  43. package/docs/release-notes-0.2.2.md +120 -0
  44. package/docs/secret-guard-analysis.md +416 -0
  45. package/docs/secret-guard-architecture.md +93 -0
  46. package/docs/secret-guard-design.md +649 -0
  47. package/docs/test-report-claude-code-harness.md +462 -0
  48. package/docs/test-report-codex-gpt-5.6-sol.md +335 -0
  49. package/docs/test-report-codex-gpt-6-astra-high.md +129 -0
  50. package/docs/test-report-dsh-0.1.5-rc.1.md +84 -0
  51. package/docs/test-report-dsh-v0.1.1.md +126 -0
  52. package/docs/test-report-kimi-code-block.md +198 -0
  53. package/docs/test-report-zcode-glm-flash.md +241 -0
  54. package/docs/threat-model.md +44 -0
  55. package/doctor.py +756 -0
  56. package/live_sentinel.py +339 -0
  57. package/package.json +69 -0
  58. package/skills/delete-guard/SKILL.md +109 -0
  59. package/skills/delete-guard/agents/openai.yaml +4 -0
  60. package/skills/delete-guard/references/policy.md +161 -0
  61. package/skills/delete-guard/scripts/_bootstrap.py +8 -0
  62. package/skills/delete-guard/scripts/check.py +370 -0
  63. package/skills/delete-guard/scripts/gc.py +103 -0
  64. package/skills/delete-guard/scripts/restore.py +98 -0
  65. package/skills/delete-guard/scripts/safe_delete.py +256 -0
  66. package/skills/delete-guard/scripts/status.py +130 -0
  67. package/skills/exfil-guard/SKILL.md +143 -0
  68. package/skills/exfil-guard/agents/openai.yaml +4 -0
  69. package/skills/exfil-guard/references/channels.md +58 -0
  70. package/skills/exfil-guard/references/rules.md +194 -0
  71. package/skills/exfil-guard/scripts/_bootstrap.py +8 -0
  72. package/skills/exfil-guard/scripts/check_span.py +250 -0
  73. package/skills/exfil-guard/scripts/sanitize.py +155 -0
  74. package/skills/exfil-guard/scripts/view.py +44 -0
  75. package/skills/recovery-audit/SKILL.md +283 -0
  76. package/skills/recovery-audit/agents/openai.yaml +4 -0
  77. package/skills/recovery-audit/references/evidence-records.md +85 -0
@@ -0,0 +1,101 @@
1
+ # Contributing to Agent Guard / 为 Agent Guard 做贡献
2
+
3
+ Agent Guard welcomes bug reports, design discussions, compatibility evidence,
4
+ documentation improvements, and focused code contributions.
5
+
6
+ Agent Guard 欢迎缺陷报告、设计讨论、兼容性证据、文档改进与范围明确的代码贡献。
7
+
8
+ ## English
9
+
10
+ ### Start with an Issue
11
+
12
+ Please search the existing [Issues](https://github.com/mokuyoaxis/agent-guard/issues)
13
+ before opening a new one. An Issue is especially useful before work that changes
14
+ a public interface, security policy, package layout, dependency, harness
15
+ adapter, or release process.
16
+
17
+ A useful report includes:
18
+
19
+ - the Agent Guard version or commit;
20
+ - operating system, Python/Node version, harness version, and relevant tool;
21
+ - a minimal, non-destructive reproduction;
22
+ - expected and observed behavior;
23
+ - whether the evidence comes from Core/CLI, a mock host, a real hook, or an
24
+ execution-level sentinel.
25
+
26
+ Do not post credentials, authentication files, private provider configuration,
27
+ raw incident archives, identifying absolute paths, or unredacted model/session
28
+ logs. If a problem cannot be described safely in public, open only a minimal
29
+ redacted Issue requesting private coordination.
30
+
31
+ ### Send a Pull Request
32
+
33
+ Focused [Pull Requests](https://github.com/mokuyoaxis/agent-guard/pulls) are
34
+ welcome. For a non-trivial change, link the Issue that established its scope.
35
+
36
+ Before opening a PR:
37
+
38
+ 1. Keep Core and the Decision Protocol harness-neutral; put host-specific
39
+ normalization and result mapping in the adapter.
40
+ 2. Add regression tests for behavior changes and update the relevant public
41
+ documentation and evidence boundary.
42
+ 3. Run `npm test`. Also run any narrower adapter or packaging check affected by
43
+ the change.
44
+ 4. Use only isolated fixtures and synthetic data. Never validate a guard by
45
+ deleting real user data, rewriting a real remote, or exposing a real secret.
46
+ 5. Do not add production dependencies or change public APIs, versions, release
47
+ automation, or security policy without prior maintainer agreement.
48
+ 6. Preserve existing authorship and unrelated work. Keep the PR focused enough
49
+ to review and revert independently.
50
+
51
+ In the PR description, state what changed, what was tested, what remains
52
+ unverified, and whether the result is a local Core/CLI check, a mock-host check,
53
+ or real-host evidence. A passing mock must not be described as universal host
54
+ enforcement.
55
+
56
+ Review, merge, tagging, GitHub Release, and npm publication are separate
57
+ maintainer decisions. Acceptance of a contribution does not promise a specific
58
+ release date.
59
+
60
+ ## 中文
61
+
62
+ ### 先发 Issue
63
+
64
+ 提交前请先搜索现有 [Issues](https://github.com/mokuyoaxis/agent-guard/issues)。
65
+ 如果改动涉及公开接口、安全策略、包结构、生产依赖、harness 适配器或发布流程,
66
+ 建议先通过 Issue 确认范围。
67
+
68
+ 一份便于复现的报告应包括:
69
+
70
+ - Agent Guard 版本或提交;
71
+ - 操作系统、Python/Node 版本、harness 版本与相关工具;
72
+ - 最小、无破坏性的复现步骤;
73
+ - 预期行为与实际行为;
74
+ - 证据来自 Core/CLI、模拟宿主、真实 hook,还是执行级哨兵。
75
+
76
+ 不要公开凭据、认证文件、私有 provider 配置、事故原始归档、带身份信息的绝对
77
+ 路径,或未经去敏的模型/会话日志。若问题无法安全地公开描述,只提交最小化、
78
+ 已去敏的 Issue,请求维护者另行协调私下沟通。
79
+
80
+ ### 提交 Pull Request
81
+
82
+ 欢迎范围清晰的 [Pull Requests](https://github.com/mokuyoaxis/agent-guard/pulls)。
83
+ 非小型改动应关联已经确认范围的 Issue。
84
+
85
+ 发起 PR 前:
86
+
87
+ 1. 保持 Core 与 Decision Protocol 宿主中立;宿主输入归一化和结果映射留在
88
+ adapter。
89
+ 2. 行为变更应增加回归测试,并同步相关公开文档与证据边界。
90
+ 3. 运行 `npm test`,以及本次改动涉及的适配器或打包专项检查。
91
+ 4. 只使用隔离夹具和合成数据;不得通过删除真实用户数据、改写真实远端或暴露
92
+ 真实秘密来证明防护有效。
93
+ 5. 未经维护者事先认可,不新增生产依赖,也不改变公开 API、版本号、发布自动化
94
+ 或安全策略。
95
+ 6. 保留既有署名与无关改动,让 PR 可以独立审阅和回退。
96
+
97
+ PR 描述请写明改了什么、验证了什么、哪些路径仍未验证,以及证据属于本地
98
+ Core/CLI、模拟宿主还是真实宿主。模拟测试通过不能写成所有宿主都已强制拦截。
99
+
100
+ 审阅、合并、标签、GitHub Release 与 npm 发布是维护者分别作出的决定;贡献被
101
+ 接受不代表承诺在某个版本或日期发布。
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 agent-guard contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.