jehubba/daeanne-security-hardener
GitHub: jehubba/daeanne-security-hardener
Daeanne OS 生态中专用的安全审查 agent,依据 OWASP LLM Top 10 威胁模型对 agent spec 进行漏洞审查并生成加固建议。
Stars: 0 | Forks: 0
# daeanne-security-hardener
用于 Daeanne OS agent 生态系统的安全审查 agent。
根据 OWASP LLM Top 10 威胁模型(特别是研究报告 f703ee0a (2026-06-09) 中的 Daeanne OS 威胁模型)审查 agent spec 文件(`.agent.md` / `AGENT.md`)中的安全漏洞。生成一份按优先级排序的检查结果报告,并可选择生成该 spec 的加固版本。
## 何时使用
| 场景 | 调用 |
|-----------|--------|
| 刚由 Agent Builder 构建的新 agent | 是 — 标准工作流程步骤 |
| 现有 agent 的季度审查 | 是 |
| 发布了新的 OWASP LLM 咨询 | 是 |
| 临时审计请求 | 是 |
**标准工作流位置:** Agent Builder → **Security Hardener** → Code Gardener → Refactor Executor
## 调用方式
### 通过 Daeanne(推荐)
告诉 Daeanne 以下指令之一:
- `"security review [agent name]"`
- `"harden this agent: [path to .agent.md]"`
- `"check [agent] for injection risk"`
- `"audit [agent] security"`
Daeanne 将使用适当的上下文进行分发。
### 直接调度给 Dispatcher
```
$dispatchKey = Get-Content "$env:USERPROFILE\.daeanne\secrets\dispatcher-api-key.txt" -Raw
$dh = @{ "X-Daeanne-Key" = $dispatchKey.Trim() }
$body = @{
type = "Generic"
prompt = @"
task_type: SecurityHardener
spec_path: C:\Users\Jeffrey\.copilot\agents\my-new-agent.agent.md
agent_name: my-new-agent
agent_repo: jehubba/daeanne-my-new-agent
context: |
This agent processes inbound email. It is email-triggered.
It can invoke tools: read, shell.
"@
} | ConvertTo-Json
Invoke-RestMethod "http://127.0.0.1:47777/tasks" `
-Method Post -Body $body -ContentType "application/json" -Headers $dh
```
## 检查内容
| 检查项 | 严重程度 | 描述 |
|-------|----------|-------------|
| **P0.1 Prompt Injection** | P0 | 对所有不受信任的输入执行 D5 Sandwich + D1 Spotlighting |
| **P0.2 Sender Allowlisting** | P0 | 对不受信任的调用者实行默认拒绝 |
| **P1.3 Credential Handling** | P1 | DPAPI 存储,无明文 secrets,prompts/output 中无 secrets |
| **P2.4 API Auth Posture** | P2 | Dispatcher key header,经过身份验证的下游调用 |
| **P2.5 Rate Limiting** | P2 | 针对可被外部触发的 agent 的调用速率指南 |
**结论选项:**
- `BLOCKED` — 存在 P0 级别问题;在解决之前请勿激活
- `CONDITIONAL` — 存在 P1 级别问题;可在知情情况下激活,需尽快修复
- `CLEAR` — 无重大问题
## 输出
所有输出均写入 agent 的任务工作目录(`$env:output_path`):
| 文件 | 描述 |
|------|-------------|
| `security-findings--.md` | 包含结论、表格和每个问题详细信息的完整检查报告 |
| `-hardened.agent.md` | 应用了 P0/P1 缓解措施的加固版 spec(如果在机制上可行) |
针对每个 P0/P1 问题,在 agent 的 repo 中提交 GitHub issues(标签:`security`)。
## 威胁模型参考
权威来源:
`C:\Users\Jeffrey\.daeanne\tasks\complete\f703ee0a-11ef-4d87-a261-c7a6f9d77ee9\f703ee0a-11ef-4d87-a261-c7a6f9d77ee9-research.md`
该报告的关键发现:
- **IPI 是由邮件触发的 agent 的主要威胁** (OWASP LLM #1)
- **D5 + D1** 组合是影响力最高且低成本的防御措施(ASB benchmark,565 个案例)
- **CVE-2025-32711 (EchoLeak)**: 通过 Copilot 邮件上下文进行零点击 IPI — 直接适用
- **DPAPI** `ProtectedData.Protect(CurrentUser)` 是正确的 Windows secret 存储方式
- 实现“默认拒绝”态势需要使用 **Sender allowlist**(而不仅仅是 blocklist)
## 示例输出
```
# Security Review: my-new-agent
Date: 2026-06-10
Verdict: BLOCKED — resolve F1 (P0.1 prompt injection) before activation
## Findings
| ID | Finding | Severity | Check | Spec Location | Fix | Effort |
|----|---------|----------|-------|---------------|-----|--------|
| F1 | No D5/D1 wrapping on email body | P0 | P0.1 | § "Email processing" — absent | Add D5 Sandwich + D1 delimiters | S |
| F2 | No sender allowlist specified | P0 | P0.2 | § "Invocation" — absent | Specify trusted callers; deny-by-default | S |
| F3 | Token storage not specified | P1 | P1.3 | § "Auth" — absent | Add DPAPI instruction | S |
```
## 代码库
`jehubba/daeanne-security-hardener`
## 激活
有关注册步骤,请参阅 `docs/activation-instructions.md`。
标签:AI合规, AI安全, Chat Copilot, DLL 劫持, GitHub Advanced Security, OWASP LLM Top 10, 大语言模型, 安全加固