Communitygithub.com

代理式零信任安全

為自主AI代理系統提供加密安全架構——零信任代理網路、簽名訊息封包(JWS/JWE)、基於能力的存取控制(ocaps)、Merkle樹審計軌跡、WASM沙箱執行以及形式驗證。涵蓋CLI開發工具安全、代理間mTLS、最小權限邊界,以及技能/外掛的供應鏈安全。

代理式零信任安全 是什麼?

此技能提供專為自主AI代理系統設計的全面加密安全架構。它解決了代理在規劃、持久化、委派和跨信任邊界執行時所面臨的獨特安全挑戰。核心原則是「永不信任,始終驗證」,並將其應用於每個代理間訊息、載入的技能、呼叫的工具以及返回的結果。支援的關鍵技術包括:代理間通訊的相互TLS(mTLS)、用於訊息完整性與來源驗證的JWS/JWE簽名封包、基於能力的安全模型(ocap)以實現精細權限控制、用於不可篡改審計的Merkle樹、以及安全的WASM沙箱執行環境。此技能還詳細說明了各種失敗模式(如權限提升、訊息重放攻擊、沙箱逃逸)及其緩解策略,並提供多個實作範例,涵蓋多代理訊息簽名管道和權限衰減委派等場景。本技能主要與「多代理協調」、「代理對話協定」和「安全審計員」技能搭配使用,但不適用於應用層級的SAST掃描、網路防火牆規則、合規性文件或提示注入防禦。

相容平台~Claude Code~Codex CLI~Cursor✓Antigravity
npx skills add https://github.com/curiositech/windags-skills/tree/HEAD/skills/agentic-zero-trust-security

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

代理式零信任安全 是做什麼的?

為自主AI代理系統設計的加密安全架構。此技能涵蓋傳統安全工程與代理在規劃、持久化、委派和跨信任邊界執行時所面臨獨特挑戰的交匯處。

核心原則:永不信任,始終驗證 — 應用於每個代理間訊息、每個載入的技能、每個呼叫的工具以及每個返回的結果。

決策點

1. 威脅等級 → 驗證策略

威脅等級評估:
├── 公開(網路代理、未知技能)
│   ├── 操作:完整 mTLS + JWS + 能力令牌 + WASM 沙箱
│   ├── 稽核:每個操作記錄並附加 Merkle 證明
│   └── TTL:能力最長 5 分鐘生命週期
├── 內部(可信代理叢集)
│   ├── 操作:mTLS + JWS + 能力(較長 TTL)
│   ├── 稽核:匯總日誌並每日發布根雜湊
│   └── TTL:能力最長 1 小時生命週期
└── 開發/測試(本地主機、開發環境)
    ├── 操作:可選 mTLS + 基本能力
    ├── 稽核:本地檔案日誌(無 Merkle 樹)
    └── TTL:能力最長 24 小時生命週期

2. 代理請求 → 能力檢查 → 授權/拒絕邏輯

傳入代理請求處理流程:
├── 1. 驗證 mTLS 憑證鏈
│   ├── 有效 CA 簽章? → 繼續
│   └── 無效/過期? → 立即拒絕
├── 2. 解析 JWS 訊息封包
│   ├── 簽章有效且未過期? → 繼續
│   ├── 偵測到重放(jti 快取)? → 拒絕
│   └── 簽章無效? → 拒絕 + 記錄安全事件
├── 3. 檢查所需能力
│   ├── 代理持有確切能力? → 授予
│   ├── 代理持有更廣泛能力? → 衰減 + 授予
│   ├── 能力已過期? → 拒絕 + 強制重新整理
│   └── 無匹配能力? → 拒絕 + 建議最小化授予
└── 4. 在沙箱限制下執行
    ├── WASM 技能:強制 CPU/記憶體限制
    ├── 檔案操作:根據能力驗證路徑
    └── 網路呼叫:根據能力驗證目的地

3. 委派鏈 → 信任深度決策

能力委派請求:
├── 父能力可委派 = true?
│   ├── 是 → 檢查剩餘深度
│   │   ├── 深度 > 0 → 允許,設定深度-1
│   │   └── 深度 = 0 → 拒絕(已達最大委派次數)
│   └── 否 → 拒絕(不可委派)
├── 請求的操作 ⊆ 父能力的操作?
│   ├── 是 → 允許子集
│   └── 否 → 拒絕(無法提升權限)
└── 是否跨越信任邊界?
    ├── 同一個編排器網域 → 允許
    └── 不同網域 → 需要明確的跨網域能力

失敗模式

1. 環境權限洩漏

偵測:grep -r "process.env" agent_code/ 顯示未經能力檢查就存取環境變數 症狀:代理存取不應具備權限的資源 修復:替換為明確的能力令牌,並將其範圍限定於所需的確切資源

2. 訊息重放攻擊

偵測:多個審計日誌條目具有相同的 jti(訊息 ID)或在重放時間窗內的時間戳 症狀:代理多次接收和處理相同的命令 修復:實作 jti 去重快取,其 TTL 與訊息過期時間匹配

3. 透過委派的能力提升

偵測:子能力擁有的操作多於父能力,或委派深度超過設定的最大值 症狀:子代理獲得比其父委派者意圖更多的權限 修復:在委派時強制執行衰減不變性:子能力 ⊆ 父能力

4. 透過資源耗盡的沙箱逃逸

偵測:代理 CPU 使用率 >95% 持續 >30 秒,或記憶體使用量接近沙箱限制 症狀:代理嘗試無限迴圈或過度記憶體分配以突破限制 修復:在資源限制處強制終止代理程序,實作基於燃料的執行計量

5. 首次使用信任(TOFU)憑證接受

偵測:代理在首次連線時接受未經 CA 驗證的憑證 症狀:中間人攻擊透過出示任何憑證即可成功 修復:預先配置所有代理憑證,維護明確的信任儲存庫,拒絕未知的 CA

實作範例

範例 1:多代理訊息簽名管道

場景:研究代理需要將分析結果傳遞給程式碼生成代理,然後傳遞給審查代理。

設定階段:

// 編排器鑄造能力
const researchCap = mint.mint('fs:/tmp/research/**', ['read','write'], 'agent-research-001');
const codegenCap = mint.mint('fs:/workspace/src/**', ['read','write'], 'agent-codegen-001'); 
const reviewCap = mint.mint('fs:/workspace/**', ['read'], 'agent-review-001');

訊息流程:

  1. 研究 → 程式碼生成:研究代理建立 JWS 簽名訊息:

    標頭:{alg: 'EdDSA', kid: 'agent-research-001/v1'}
    負載:{
      iss: 'agent-research-001',
      sub: 'agent-codegen-001', 
      dag_id: 'proj-alpha-v1',
      action: 'task',
      body: {analysis: "API needs OAuth2 flow", output_path: "/tmp/research/api_analysis.json"}
    }
    
  2. 程式碼生成驗證:程式碼生成代理接收訊息:

    • 根據研究代理的公鑰驗證 JWS 簽章
    • 檢查訊息 TTL(未過期)
    • 驗證 jti 不在重放快取中
    • 確認 dag_id 與當前執行上下文匹配
    • 專家級注意:驗證研究代理對 output_path 是否具有能力
  3. 程式碼生成 → 審查:程式碼生成建立簽名結果:

    {
      "iss": "agent-codegen-001",
      "sub": "agent-review-001",
      "action": "result", 
      "body": {"generated_files": ["/workspace/src/auth.ts"], "confidence": 0.87}
    }
    

新手疏漏:會跳過 jti 重放保護,導致重複處理。 專家見解:審計軌跡顯示完整的訊息鏈,並帶有加密監管證明。

範例 2:具有衰減功能的能力令牌發行

場景:主代理需要將檔案分析委派給專業的子代理,但限制對敏感目錄的存取。

初始授予:

// 編排器授予廣泛的檔案系統存取權限
const mainCap = mint.mint('fs:/project/**', ['read','write','execute'], 'agent-main', {
  delegatable: true,
  maxDepth: 2,
  ttlSeconds: 3600
});

衰減決策樹:

主代理評估委派請求:
├── 子代理請求:fs:/project/src/** [read]
│   ├── /project/src/** ⊆ /project/** ? 是
│   ├── [read] ⊆ [read,write,execute] ? 是  
│   ├── 委派深度 2 > 0 ? 是
│   └── 授予:建立衰減後的能力
├── 子代理請求:fs:/project/secrets/** [read]  
│   ├── 路徑包含 "secrets" → 安全策略違規
│   └── 拒絕:敏感路徑排除
└── 子代理請求:fs:/etc/passwd [read]
    ├── /etc/passwd ⊆ /project/** ? 否
    └── 拒絕:超出授權範圍

產生的衰減能力:

const subCap = mint.attenuate(mainCap, 'agent-analyzer-001', ['read']);
// 結果:fs:/project/src/** [read] delegatable=true maxDepth=1 ttl=3600s

新手疏漏:會授予完整的父能力而不加限制。 專家見解:衰減在加密層級強制執行「永不提升權限」。

範例 3:沙箱策略違規偵測與權衡分析

場景:程式碼生成代理在執行期間嘗試存取網路,違反了沙箱策略。

沙箱配置:

const codegenSandbox = {
  fileRead: ['/workspace/src/**', '/workspace/package.json'],
  fileWrite: ['/workspace/src/**'], 
  netConnect: false,  // 不允許網路存取
  maxExecutionMs: 300000,
  maxMemoryMb: 512
};

違規偵測流程:

  1. 代理操作:程式碼生成嘗試 fetch('https://api.github.com/repos/...')

  2. 沙箱攔截:WASM 執行時期捕獲網路 socket 的系統呼叫

  3. 策略檢查:netConnect: false → 偵測到違規

  4. 權衡分析:

    安全與功能的權衡:
    ├── 嚴格(當前):封鎖網路,終止代理
    │   ├── 優點:零網路攻擊面
    │   ├── 缺點:無法擷取外部依賴/文件
    │   └── 決策:執行(安全優先環境)
    ├── 中等:允許特定白名單網域
    │   ├── 優點:對已知良好的 API 功能正常
    │   ├── 缺點:DNS 污染、子網域接管風險
    │   └── 決策:僅考慮用於開發環境
    └── 寬鬆:記錄但允許
        ├── 優點:保持完整功能
        ├── 缺點:代理可以外洩資料、下載惡意軟體
        └── 決策:拒絕(違反零信任模型)
    
  5. 回應:終止代理,記錄安全事件:

    {
      "event": "sandbox_violation",
      "agent_id": "agent-codegen-001", 
      "violation_type": "unauthorized_network_access",
      "attempted_url": "api.github.com",
      "policy_matched": "netConnect: false",
      "action_taken": "terminate_agent"
    }
    

新手疏漏:會允許網路存取「就這一次」,或者根本無法偵測到違規。 專家見解:沙箱違規表明可能存在妥協或模型漂移——始終嚴格執行。

品質閘門

  • 每個代理都有唯一的加密身分(Ed25519 金鑰對 + 憑證)
  • 所有代理間通道使用帶憑證驗證的相互 TLS
  • 所有訊息攜帶 JWS 簽章,TTL 小於 5 分鐘,並具有 jti 重放保護
  • 能力令牌遵循 ocap 模型(任何地方都沒有環境權限)
  • 能力委派保持衰減不變性(子 ⊆ 父權限)
  • 審計軌跡使用僅附加的 Merkle 樹,並包含已發布的根雜湊
  • 所有技能執行發生在 WASM 或容器沙箱中
  • 強制執行資源限制(CPU、記憶體、執行時間、網路)
  • 技能套件包是內容尋址的,並經過作者簽名
  • 沒有代理接受未簽名或未經驗證的技能/輸入
  • 憑證輪換自動化,憑證生命週期小於 24 小時
  • 重放偵測快取已啟用,其 TTL 與訊息過期時間匹配
  • 所有安全違規都記錄了時間戳、代理身分和採取的行動

非適用範圍邊界

此技能不應用於:

  • 應用層級漏洞掃描 → 改用 security-auditor
  • 網路防火牆/WAF 配置 → 改用 infrastructure-engineer
  • SOC2/HIPAA 合規文件 → 使用組織性合規流程
  • 提示注入防禦 → 改用 prompt-engineer 技能
  • 速率限制或 DDoS 保護 → 使用 API 閘道器配置
  • 容器編排安全 → 改用 devops-automator 技能

委派邊界:

  • 程式碼層級安全問題 → security-auditor
  • 基礎設施強化 → infrastructure-engineer
  • 安全編碼實踐 → software-engineer
  • 事件回應 → security-incident-response

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

curiositech/windags-skills

Expert in 2000s-era music visualization (Milkdrop, AVS, Geiss) and modern WebGL implementations. Specializes in Butterchurn integration, Web Audio API AnalyserNode FFT data, GLSL shaders for audio-reactive visuals, and psychedelic generative art. Activate on "Milkdrop", "music visualization", "WebGL visualizer", "Butterchurn", "audio reactive", "FFT visualization", "spectrum analyzer". NOT for simple bar charts/waveforms (use basic canvas), video editing, or non-audio visuals.

curiositech/windags-skills

Expert legal research agent for finding and scraping expungement data state by state. Knows authoritative sources, URL patterns, Firecrawl configuration, and 2026 legal landscape.

curiositech/windags-skills

Expert in 3D computer vision labeling tools, workflows, and AI-assisted annotation for LiDAR, point clouds, and sensor fusion. Covers SAM4D/Point-SAM, human-in-the-loop architectures, and vertical-specific training strategies. Activate on '3D labeling', 'point cloud annotation', 'LiDAR labeling', 'SAM 3D', 'SAM4D', 'sensor fusion annotation', '3D bounding box', 'semantic segmentation point cloud'. NOT for 2D image labeling (use clip-aware-embeddings), general ML training (use ml-engineer), video annotation without 3D (use computer-vision-pipeline), or VLM prompt engineering (use prompt-engineer).

curiositech/windags-skills

Implement WCAG 2.2 AA/AAA compliance with automated testing, keyboard navigation, screen reader support, and focus management. Activate on: accessibility audit, WCAG compliance, keyboard navigation, screen reader, aria attributes, axe-core, focus trap. NOT for: design-level accessibility review (use design-accessibility-auditor), color contrast only (use css-in-js-architect).

curiositech/windags-skills

Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task design, and building systems that actually work for neurodivergent minds.

curiositech/windags-skills

Designs digital experiences for ADHD brains using neuroscience research and UX principles. Expert in reducing cognitive load, time blindness solutions, dopamine-driven engagement, and compassionate design patterns. Activate on 'ADHD design', 'cognitive load', 'accessibility', 'neurodivergent UX', 'time blindness', 'dopamine-driven', 'executive function'. NOT for general accessibility (WCAG only), neurotypical UX design, or simple UI styling without ADHD context.

curiositech/windags-skills

>- Apply crisis decision-making research to agent routing, uncertainty triage, and coordination failure analysis in time-pressured systems. Use when diagnosing handoff failures, analytical paralysis, or expert judgment under incomplete information. NOT for routine coding, simple CRUD design, or static single-agent tasks with complete information.

curiositech/windags-skills

Extend and modify the admin dashboard, developer portal, and operations console. Use when adding new admin tabs, metrics, monitoring features, or internal tools. Activates for dashboard development, analytics, user management, and internal tooling.

curiositech/windags-skills

Conversation patterns and interaction protocols for multi-agent systems. Covers request/response, pub/sub, blackboard, delegation chains, debate, critique, consensus, fan-out/fan-in, supervisor-worker, and peer negotiation. Deep analysis of AutoGen conversation patterns, CrewAI delegation, LangGraph state passing, and FIPA-ACL performatives. Teaches how to design what agents say to each other and in what order. Activate on: "agent conversation", "agent protocol", "multi-agent debate", "agent delegation", "supervisor worker pattern", "agent voting", "consensus protocol", "fan-out fan-in", "agent negotiation", "blackboard pattern", "agent dialogue", "conversation topology", "agent handoff". NOT for: wire format or serialization (use agent-interchange-formats), orchestration infrastructure (use agentic-infrastructure-2026), single agent behavior (use agentic-patterns).

curiositech/windags-skills

Meta-agent for creating new custom agents, skills, and MCP integrations. Expert in agent design, MCP development, skill architecture, and rapid prototyping. Activate on 'create agent', 'new skill', 'MCP server', 'custom tool', 'agent design'. NOT for using existing agents (invoke them directly), general coding (use language-specific skills), or infrastructure setup (use deployment-engineer).

curiositech/windags-skills

AI-powered calendar management and agent-based scheduling coordination. Covers calendar APIs (Google Calendar, CalDAV/iCal), AI scheduling assistants (Reclaim, Clockwise, Motion, Cal.com), building custom calendar agents with MCP, multi-calendar merging, timezone management, focus block protection, meeting fatigue detection, and agent-to-agent meeting negotiation protocols. Activate on: "calendar agent", "AI scheduling", "calendar coordination", "meeting scheduling", "calendar API", "focus time protection", "calendar optimization", "Google Calendar MCP", "Reclaim", "Clockwise", "Motion", "Cal.com", "smart scheduling", "calendar-aware agent", "timezone scheduling", "agent negotiation meetings". NOT for: manual calendar UI component design (use form-validation-architect), project management scheduling or Gantt charts (use project-management-guru-adhd), general time-tracking or pomodoro apps (use adhd-daily-planner for time-awareness), building the agent itself from scratch (use agent-creator).

curiositech/windags-skills

Build and adopt production AI agent infrastructure in 2026. Covers framework selection (LangGraph, CrewAI, AutoGen, MCP), orchestration patterns, evaluation, observability, memory systems, and tool use. Also covers the SOCIAL dimension: how to sell agent infrastructure internally, change management, measuring ROI, building trust in autonomous systems, and scaling adoption across teams. Activate on: "agent infrastructure", "agent framework comparison", "which agent framework", "sell AI tools internally", "agent adoption", "agent observability", "agent evaluation", "MCP architecture", "agentic mesh", "enterprise AI agents", "AI change management", "agent ROI". NOT for: building specific agents (use ai-engineer), designing agent behavior patterns (use agentic-patterns), prompt tuning (use prompt-engineer).

curiositech/windags-skills

Fundamental patterns for effective agentic behavior. Teaches decomposition, tool orchestration, error recovery, context management, quality self-assessment, and knowing when to stop. Model-agnostic principles that make any agent more effective regardless of domain. Activate on: "how should I structure this agent", "agentic workflow", "agent patterns", "multi-step task", "tool orchestration", "/agentic-patterns", "decompose this", "agent best practices", "chain of actions", "when should the agent stop", "agent loop design". NOT for: creating agent infrastructure (use agent-creator), building DAGs (use windags-architect), specific tool implementation.

curiositech/windags-skills

Automated discovery and matching of agent skills for dynamic task routing and capability assessment

curiositech/windags-skills

Data structures and serialization formats for agent-to-agent communication. Covers message envelopes, structured output schemas, capability declarations, task handoff payloads, error/retry signaling, and context windows as data structures. Deep comparison of A2A protocol, MCP, OpenAI function calling, and LangChain message types. Teaches when to use rigid schemas vs free-form with validation, typed vs untyped, streaming vs batch. Activate on: "agent message format", "agent communication schema", "agent-to-agent protocol", "A2A protocol", "MCP message format", "structured output for agents", "agent interop", "interchange format", "agent serialization", "task handoff format", "capability declaration". NOT for: what agents say to each other (use agent-conversation-protocols), orchestration topology (use multi-agent-coordination), building agent infrastructure (use agentic-infrastructure-2026).

curiositech/windags-skills

Logic-based agent programming language implementing BDI architecture for practical autonomous agent development

curiositech/windags-skills

>- Design AgentSpeak(L)-style BDI agents with context-guarded plans, selection functions, and intention stacks. Use for interruptible autonomy, agent policy, and multi-agent orchestration in dynamic environments. NOT for simple rule engines, static planners, or centralized workflows.

curiositech/windags-skills

Foundational concurrent computation model where actors communicate exclusively through asynchronous message passing

curiositech/windags-skills

Build production-ready LLM applications, advanced RAG systems, and intelligent agents. Implements vector search, multimodal AI, agent orchestration, and enterprise AI integrations. Use PROACTIVELY for LLM features, chatbots, AI agents, or AI-powered applications.

curiositech/windags-skills

license: Apache-2.0 NOT for unrelated tasks outside this domain.

相關技能