Token导航 LogoToken导航TokenDH.com
研究检索需要联网clawhub未标认证来源可访问clear审计通过

alfred-agent-governance阿尔弗雷德 Agent 治理

Agent Skill

alfred-agent-governance 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,424

周安装

101

GitHub Stars

公开资料未说明

下载量

808
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:alfred-agent-governance(阿尔弗雷德 Agent 治理)
来源仓库:https://github.com/lllljokerllll/alfred-agent-governance
安装命令:
openclaw skills install alfred-agent-governance
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install alfred-agent-governance

简介

强制执行基于 YAML 的运行时策略来拦截、审核、速率限制和停止 AI 代理工具调用,以实现 OpenClaw 中的安全治理。

SKILL.md

Agent Governance Skill

Runtime governance for AI agents in OpenClaw. Inspired by Microsoft Agent Governance Toolkit (MIT) and OWASP Agentic AI Top 10.

Features

1. Policy Engine (Phase 1)

Intercepts tool calls and applies YAML-based rules before execution.

Rule types:

  • deny_patterns: regex patterns blocked in tool params (SQL injection, privilege escalation)
  • deny_tools: specific tools blocked for specific agents
  • rate_limit: max calls per time window per agent
  • require_approval: tools that need human approval before execution
  • resource_limits: max tokens, max exec timeout per agent per session

2. Audit Logger (Phase 1)

Logs every tool call with agent identity, timestamp, params hash, result, and signature.

Output: Appends to memory/audit-log/YYYY-MM-DD.jsonl

Format:

{"ts":"2026-04-23T15:00:00Z","agent":"coder","tool":"exec","params_hash":"sha256:...","result":"success","duration_ms":120}

3. Kill Switch (Phase 1)

Provides commands to stop running agent sessions.

Usage:

# List active sessions
openclaw sessions --status active

# Kill a specific session
openclaw sessions kill <session-id>

# Emergency: kill all non-main sessions
openclaw sessions kill --all --exclude main

4. Permission Rings (Phase 2 - planned)

Three privilege levels inspired by CPU rings:

RingLevelAccess
Ring 3 (User)0Read-only, no tools
Ring 2 (Sandbox)1Limited tools, no exec, no network
Ring 1 (Restricted)2Most tools, exec with approval
Ring 0 (Full)3All tools, no restrictions

5. Trust Scoring (Phase 3 - planned)

Behavioral trust score per agent (0-1000). Decreases on denials, increases on success. Trust decay over time.

Configuration

Create config/governance-rules.yaml:

version: "1.0"
agents:
  coder:
    deny_patterns:
      - "DROP\\s+TABLE"
      - "rm\\s+-rf\\s+/"
      - "DELETE\\s+FROM\\s+users"
    rate_limit:
      exec: 50/hour
      write: 100/hour
    require_approval:
      - "exec.*sudo"
      - "exec.*systemctl"
  security:
    deny_tools:
      - "write"
      - "edit"
    rate_limit:
      web_search: 30/hour
  research:
    deny_tools:
      - "write"
      - "edit"
    rate_limit:
      web_fetch: 20/hour
  debug:
    deny_tools:
      - "write"
      - "edit"

Usage in Sessions

Before executing any tool call, check against rules:

import yaml, re, hashlib, json
from datetime import datetime

RULES_FILE = "config/governance-rules.yaml"
AUDIT_DIR = "memory/audit-log"

def check_policy(agent, tool, params_str):
    """Returns (allowed: bool, reason: str)"""
    rules = yaml.safe_load(open(RULES_FILE))
    agent_rules = rules.get("agents", {}).get(agent, {})
    
    # Check deny_tools
    for denied in agent_rules.get("deny_tools", []):
        if re.search(denied, tool):
            return False, f"Tool '{tool}' denied for agent '{agent}'"
    
    # Check deny_patterns
    for pattern in agent_rules.get("deny_patterns", []):
        if re.search(pattern, params_str, re.IGNORECASE):
            return False, f"Pattern matched: {pattern}"
    
    return True, "OK"

def log_audit(agent, tool, params_str, result, duration_ms):
    """Append to daily audit log"""
    from pathlib import Path
    Path(AUDIT_DIR).mkdir(parents=True, exist_ok=True)
    
    entry = {
        "ts": datetime.utcnow().isoformat() + "Z",
        "agent": agent,
        "tool": tool,
        "params_hash": "sha256:" + hashlib.sha256(params_str.encode()).hexdigest()[:16],
        "result": result,
        "duration_ms": duration_ms
    }
    
    log_file = f"{AUDIT_DIR}/{datetime.utcnow().strftime('%Y-%m-%d')}.jsonl"
    with open(log_file, "a") as f:
        f.write(json.dumps(entry) + "\
")

OWASP Agentic AI Mapping

OWASP RiskMitigation
ASI01 Goal HijackingSemantic intent classification (Phase 2)
ASI02 Tool Misusedeny_patterns + deny_tools
ASI03 Identity AbuseAudit logger + agent identity
ASI05 Code ExecutionPermission rings + resource limits
ASI06 Memory Poisoningdeny write patterns on memory files
ASI08 Cascading FailuresRate limiting + circuit breakers
ASI10 Rogue AgentsKill switch + trust scoring

Roadmap

  • [x] Phase 1: Policy Engine (YAML rules), Audit Logger, Kill Switch
  • [ ] Phase 2: Permission Rings, Semantic Intent Classifier
  • [ ] Phase 3: Trust Scoring, Circuit Breakers, Compliance Reports

Author

Alfred (Joker's CEO Agent) — Inspired by Microsoft Agent Governance Toolkit (MIT license)

License

MIT

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

92.34%
按下载量换算746

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills