security-orchestrator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Security Ecosystem Orchestrator

安全生态系统编排器

Execute the two skills of the Security Ecosystem in the correct order, with the correct context. Detect the user's security needs, and decide which skill will be activated and when.
Core rule: Security is always enabled.
adaptive-guard
can never be fully disabled — only its sensitivity can be adjusted.

按正确的顺序并结合正确的上下文执行安全生态系统的两项技能。检测用户的安全需求,决定激活哪项技能以及何时激活。
核心规则: 安全始终处于启用状态。
adaptive-guard
永远不能完全禁用——只能调整其敏感度。

Orchestrator Decision Tree

编排器决策树

text
What is the trigger?
├── "I wrote a new skill / is it safe?"
│   └── PHASE 1 → PHASE 2 → PHASE 3
├── "Scan the Ecosystem"
│   └── PHASE 1 (all skills) → PHASE 2 → PHASE 3
├── "The skill will run in production"
│   └── PHASE 1 → PHASE 2 → PHASE 3 → PHASE 4 (activate guard)
├── Attack detection (from adaptive-guard)
│   └── PHASE 5 (incident response)
├── "Guard is too slow / blocks too often"
│   └── PHASE 6 (guard calibration)
└── Periodic check
    └── PHASE 7 (health report)

text
What is the trigger?
├── "I wrote a new skill / is it safe?"
│   └── PHASE 1 → PHASE 2 → PHASE 3
├── "Scan the Ecosystem"
│   └── PHASE 1 (all skills) → PHASE 2 → PHASE 3
├── "The skill will run in production"
│   └── PHASE 1 → PHASE 2 → PHASE 3 → PHASE 4 (activate guard)
├── Attack detection (from adaptive-guard)
│   └── PHASE 5 (incident response)
├── "Guard is too slow / blocks too often"
│   └── PHASE 6 (guard calibration)
└── Periodic check
    └── PHASE 7 (health report)

PHASE 1 — Discovery (First Step in Every Scenario)

阶段1 — 发现(所有场景的第一步)

Step 1.1 — Scope Detection

步骤1.1 — 范围检测

text
Ask (or extract from context):
□ Is it a single skill or the ecosystem being scanned?
□ Goal: audit / trust / guard setup / all?
□ Environment: dev / staging / production?
□ Is there an active attack? (is it urgent?)
text
Ask (or extract from context):
□ Is it a single skill or the ecosystem being scanned?
□ Goal: audit / trust / guard setup / all?
□ Environment: dev / staging / production?
□ Is there an active attack? (is it urgent?)

Step 1.2 — Urgency Check

步骤1.2 — 紧急程度检查

text
ACTIVE ATTACK?     → Skip to PHASE 5 (urgent response)
PROD DEPLOYMENT?   → Full flow (PHASES 1-4)
GENERAL CHECK?     → Fast flow (PHASES 1-3)

text
ACTIVE ATTACK?     → Skip to PHASE 5 (urgent response)
PROD DEPLOYMENT?   → Full flow (PHASES 1-4)
GENERAL CHECK?     → Fast flow (PHASES 1-3)

PHASE 2 — Run security-auditor

阶段2 — 运行security-auditor

Step 2.1 — Audit

步骤2.1 — 审计

security-auditor MODE 1 (Audit):
text
For the target skill(s):
1. Load SKILL.md
2. Scan the 7 threat categories
3. Extract concrete findings for each category
4. Generate security-report.md
Expected time: 2-5 minutes / skill
Evaluate results:
text
🔴 CRITICAL FINDING EXISTS →
  "This skill cannot be deployed. Pending fixes."
  Send the user the list of necessary fixes
  Do not move to PHASE 3 — fix first

🟡 MODERATE RISK EXISTS →
  "Appropriate for limited use. Suggested fixes."
  Proceed to PHASE 3

🟢 CLEAN →
  Proceed to PHASE 3
security-auditor MODE 1 (Audit):
text
For the target skill(s):
1. Load SKILL.md
2. Scan the 7 threat categories
3. Extract concrete findings for each category
4. Generate security-report.md
预期耗时: 每个skill 2-5分钟
结果评估:
text
🔴 存在严重问题 →
  "该skill无法部署,需先修复问题。"
  向用户发送需修复的问题列表
  不进入阶段3 — 先完成修复

🟡 存在中等风险 →
  "可限制使用,建议修复问题。"
  进入阶段3

🟢 无问题 →
  进入阶段3

Step 2.2 — Trust Scoring

步骤2.2 — 信任评分

security-auditor MODE 3 (Trust):
text
1. Fetch Audit results
2. Calculate Trust score (0-100)
3. Set trust level
4. Build permission map
5. Generate trust-score.md
Pass Trust result to adaptive-guard:
python
trust_context = {
    "skill_name": "...",
    "trust_score": N,
    "trust_level": "TRUSTED|NORMAL|RESTRICTED|QUARANTINED",
    "permitted_actions": [...],
    "denied_actions": [...],
    "requires_checkpoint": [...]
}

security-auditor MODE 3 (Trust):
text
1. Fetch Audit results
2. Calculate Trust score (0-100)
3. Set trust level
4. Build permission map
5. Generate trust-score.md
将信任结果传递给adaptive-guard:
python
trust_context = {
    "skill_name": "...",
    "trust_score": N,
    "trust_level": "TRUSTED|NORMAL|RESTRICTED|QUARANTINED",
    "permitted_actions": [...],
    "denied_actions": [...],
    "requires_checkpoint": [...]
}

PHASE 3 — Generate Guard Rules

阶段3 — 生成防护规则

security-auditor MODE 2 (Guard):
Construct the guard rule profile based on the Trust score:
text
RESTRICTED or QUARANTINED (0-59):
  → K4 Human approval mandatory for every execution
  → K1 threshold lowered (tighter scanning)
  → All external API calls blocked

NORMAL (60-79):
  → K3 LLM judge active for suspicious cases
  → Whitelisted APIs permitted
  → File write requires checkpoint

TRUSTED (80-100):
  → Standard K0-K2 sufficient
  → K3 only on anomalies
  → Human approval only for critical actions

security-auditor MODE 2 (Guard):
基于信任分数构建防护规则配置文件:
text
RESTRICTED or QUARANTINED (0-59):
  → 每次执行必须经过K4人工审批
  → 降低K1阈值(更严格的扫描)
  → 阻止所有外部API调用

NORMAL (60-79):
  → 针对可疑案例启用K3 LLM判断
  → 允许白名单内的API调用
  → 文件写入需经过检查点

TRUSTED (80-100):
  → 标准K0-K2防护已足够
  → 仅在出现异常时启用K3
  → 仅针对关键操作需人工审批

PHASE 4 — Activate adaptive-guard

阶段4 — 激活adaptive-guard

Production environments only:
仅适用于生产环境:

Step 4.1 — Guard Configuration

步骤4.1 — 防护配置

python
adaptive_guard_config = {
    "skill": skill_name,
    "trust_score": N,
    "fail_policy": "fail-open|fail-closed",  # Pick based on trust
    "k2_active": true|false,              # Does ML infra exist?
    "k4_timeout": 1800,                   # 30 minutes
    "learning_active": true,
    "cache_ttl": 86400,                   # 24 hours
    "anomaly_multiplier": 5
}
python
adaptive_guard_config = {
    "skill": skill_name,
    "trust_score": N,
    "fail_policy": "fail-open|fail-closed",  # Pick based on trust
    "k2_active": true|false,              # Does ML infra exist?
    "k4_timeout": 1800,                   # 30 minutes
    "learning_active": true,
    "cache_ttl": 86400,                   # 24 hours
    "anomaly_multiplier": 5
}

Step 4.2 — Establish Baseline

步骤4.2 — 建立基准线

On initial production deployment:
text
"Normal interaction baseline being established for adaptive-guard
on this skill. Monitoring mode active for the first 48 hours
(logging without blocking). Full protection follows thereafter."
首次部署到生产环境时:
text
"正在为该skill的adaptive-guard建立正常交互基准线。前48小时处于监控模式(仅记录日志不拦截),之后将启用完整防护。"

Step 4.3 — Activation Confirmation

步骤4.3 — 激活确认

text
📋 Guard Activation Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Skill         : [name]
Trust Score   : [N]/100 → [level]
Fail Policy   : [fail-open|fail-closed]
K2 ML Filter  : [active|disabled]
Learning Mode : active
Monitoring    : 48 hours (then full protection)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Proceed with activation?

text
📋 防护激活摘要
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Skill         : [name]
Trust Score   : [N]/100 → [level]
Fail Policy   : [fail-open|fail-closed]
K2 ML Filter  : [active|disabled]
Learning Mode : active
Monitoring    : 48 hours (then full protection)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
是否继续激活?

PHASE 5 — Incident Response (Urgent)

阶段5 — 事件响应(紧急)

Trigger: Active attack detected or adaptive-guard critical violation report.
text
STEP 1 — Isolate immediately
  → Suspend attacker's session
  → Temporarily disable the associated skill

STEP 2 — Analyze
  security-auditor → Re-audit the impacted skill
  adaptive-guard → Extract incident-report.md details

STEP 3 — Rule update
  → Detect attack class
  → Manually trigger learning engine
  → Append new rule (automatic if confidence >0.60)

STEP 4 — Report
  To the user:
  ┌─────────────────────────────────────────┐
  │ 🚨 Security Incident Detected          │
  │                                         │
  │ Type     : [attack class]               │
  │ Time     : [timestamp]                  │
  │ Skill    : [impacted skill]             │
  │ Action   : [what occurred]              │
  │ New Rule : [learned rule pattern]       │
  └─────────────────────────────────────────┘

STEP 5 — De-isolate / Re-open
  If patched → reactivate skill
  If unpatched → keep quarantined

触发条件: 检测到活跃攻击或adaptive-guard报告严重违规。
text
步骤1 — 立即隔离
  → 暂停攻击者会话
  → 临时禁用相关skill

步骤2 — 分析
  security-auditor → 重新审计受影响的skill
  adaptive-guard → 提取incident-report.md中的详细信息

步骤3 — 更新规则
  → 识别攻击类型
  → 手动触发学习引擎
  → 添加新规则(置信度>0.60时自动添加)

步骤4 — 报告
  向用户发送:
  ┌─────────────────────────────────────────┐
  │ 🚨 检测到安全事件                      │
  │                                         │
  │ 类型     : [attack class]               │
  │ 时间     : [timestamp]                  │
  │ 受影响Skill: [impacted skill]             │
  │ 事件内容 : [what occurred]              │
  │ 新增规则 : [learned rule pattern]       │
  └─────────────────────────────────────────┘

步骤5 — 解除隔离/恢复服务
  若已修复 → 重新激活skill
  若未修复 → 保持隔离状态

PHASE 6 — Guard Calibration

阶段6 — 防护校准

Trigger: "Too many false alarms" or "Running too slow"
触发条件: "误报过多"或"运行速度过慢"

High False Alarms (False Positive >1%)

高误报率(误报率>1%)

text
1. Inspect the last 100 blocks
2. Identify unjustified blocks
3. Loosen or drop the exact K1 rule responsible
4. Add to Whitelist (if necessary)
5. Monitor for 24 hours, recalculate rates
text
1. 检查最近100次拦截记录
2. 识别不合理的拦截
3. 放宽或移除对应的K1规则
4. 必要时加入白名单
5. 监控24小时,重新计算误报率

High Latency (>100ms average)

高延迟(平均延迟>100ms)

text
K0 cache hit rate < 60% → Increase Cache TTL
K2 traffic > 20%        → Strengthen K1 rules (send fewer to K2)
K3 traffic > 5%         → Fine-tune the K2 model

text
K0缓存命中率 < 60% → 增加缓存TTL
K2流量占比 > 20%  → 强化K1规则(减少发送到K2的请求)
K3流量占比 > 5%   → 微调K2模型

PHASE 7 — Periodic Health Report

阶段7 — 定期健康报告

Trigger: Weekly automated snapshot or "give me a security report"
markdown
undefined
触发条件: 每周自动快照或用户请求"生成安全报告"
markdown
undefined

Weekly Security Ecosystem Report

每周安全生态系统报告

Ecosystem Health: 🟢 / 🟡 / 🔴

生态系统健康状态: 🟢 / 🟡 / 🔴

security-auditor

security-auditor

Last Audit : [date] Scanned : N skills Critical finding: N Pending fixes : N
上次审计时间 : [date] 扫描Skill数量 : N 严重问题数量 : N 待修复问题数量 : N

adaptive-guard

adaptive-guard

Total messages : N Blocked : N (X%) False positive : N (X%) Rules learned : N Average latency : Xms
总消息量 : N 拦截数量 : N (X%) 误报数量 : N (X%) 新增规则数量 : N 平均延迟 : Xms

Highlight of the Week

本周重点事件

  • [key event 1]
  • [key event 2]
  • [关键事件1]
  • [关键事件2]

Recommended Actions

建议操作

  1. [high priority step]
  2. [...]

---
  1. [高优先级步骤]
  2. [...]

---

Orchestrator Rules of Operation

编排器运行规则

text
1. adaptive-guard is never fully turned off
   → Only sensitivities (K1/K2/K3) can be manually bypassed

2. If security-auditor audit FAILED
   → Skill cannot go to production
   → Enforced strictly by Orchestrator

3. If Trust score < 40
   → Orchestrator clearly alerts the user
   → Asks: "This skill is quarantined, still want to use it?"

4. The Guard displays every learned rule
   → Principle: "No implicit rule is applied without notification"

5. Incident sequence: isolate → analyze → learn → report → re-open
   → Steps cannot be skipped

6. Every orchestrator decision is logged
   → Appended to security-audit-trail.log
   → Traceability of exactly who/what made the decision
text
1. adaptive-guard永远不会完全关闭
   → 仅可手动绕过敏感度设置(K1/K2/K3)

2. 若security-auditor审计失败
   → Skill无法部署到生产环境
   → 由编排器严格执行该规则

3. 若信任分数 < 40
   → 编排器向用户发出明确警报
   → 询问:"该Skill已被隔离,是否仍要使用?"

4. 防护系统会展示所有新增规则
   → 原则:"未通知用户的规则不会被隐式应用"

5. 事件处理流程:隔离 → 分析 → 学习 → 报告 → 恢复
   → 步骤不可跳过

6. 编排器的每一项决策都会被记录
   → 追加到security-audit-trail.log
   → 可追溯具体由谁/什么做出了该决策