权
权限有门禁生成器
作者:注册老炮@MedXpert I SynomosAIv5
生成 LGD-III「有门禁」权限策略(policy-as-code),给 agent 划清可调用/需评审/禁止的工具边界与四道门禁,防越权、误删误发、失控循环。 适用场景:当需要权限有门禁生成器能力时使用本技能;触发词:gate-policy-generator。
下载量
272
点赞
68
价格
免费
技能文档
---
name: gate-policy-generator
title: 权限有门禁生成器
description: 生成 LGD-III「有门禁」权限策略(policy-as-code),给 agent 划清可调用/需评审/禁止的工具边界与四道门禁,防越权、误删误发、失控循环。 适用场景:当需要权限有门禁生成器能力时使用本技能;触发词:gate-policy-generator。
description_zh: 生成 LGD-III 有门禁权限策略
description_en: Generate LGD-III gated permission policy
slug: gate-policy-generator
version: 1.0.1
display_name: 权限有门禁生成器
display_name_en: Gate Policy Generator
category: AI 治理
author: 诺声(Logos)@SynomosAI
license: MIT
license_scope: 代码(.py 文件)MIT;本 SKILL.md 与其中理论文本不在 MIT 覆盖范围内(见文末「License & attribution」)
allowed-tools: Read, Glob, Grep, Bash, Write, WebFetch
platforms: [windows, macos, linux]
agent_created: true
copyright: SynomosAI
classification:
skillhub: ["ai-governance"]
iso_25010: ["Security", "Maintainability"]
risk_tier: medium
risk_rationale: "门禁批量补丁默认 medium(按默认策略设计为中等风险):调用 API/读写文件/本地执行,最小权限,密钥走 Secret;若实际涉对外代执行(push/发布/发送/上架)须人工复评,改 high 并走人工批准。"
tags: [gate-policy-generator, AI 治理, 权限策略, policy-as-code, 有门禁]
read_when:
- Agent 要访问外部敏感工具或执行高危操作前,需划权限边界与四道门禁
- 项目涉及代码变更/数据导出/文件操作,要自动防越权与误删误发
- 检测到安全风险模式或失控循环迹象,要快速生成阻断性政策
- 新环境部署隔离/审计/审批等权限层级的初始化
ai_protocol: true
spec: usk/1.0
interface:
type: cli
entry_point: scripts/gate_policy.py
runtime: python3
call_pattern: args
input_schema:
args:
type: string
description: "命令行参数透传给主脚本,具体取值见各包 --help"
required: false
output_schema:
stdout:
type: string
description: "标准输出为 JSON 结果,含逐项检查与总体结论"
exit_code:
type: integer
description: "0=PASS/完成;1=FAIL/有警告或待补强;2=用法或参数错误"
capabilities:
- cli_tool
permissions:
network: false
filesystem: false
subprocess: false
requirements:
python_packages: []
min_python: "3.8"
changelog: "1.0.1: Bilingual rewrite (full EN+ZH, English first), added read_when; 1.0.0: initial upload (USK v3)"
---
> 凡自治之物 · LGD 治理学 · 创造术家族 | 评测协议:见平台质量门禁规范
## English
### When to use
1. Before an agent accesses external sensitive tools or performs high-risk operations, when permission boundaries and four-gate rules must be drawn.
2. When a project involves code changes, data export or file operations, for automatic anti-overreach and accidental-deletion/accidental-sending checks.
3. When potential security-risk patterns or runaway-loop signs are detected, to quickly generate a blocking policy config.
4. During the initial setup of new permission tiers in an environment (e.g. isolation, auditing, approval).
### Usage
Run `python gate_policy.py` to invoke the skill's generation logic; it reads `gate_policy.py` directly. Key parameters: `--scenario` (business scenario), `--tool-list` (callable / forbidden tool set), `--review-mode` (review level). The system auto-detects context from the `__pycache__` cache environment and outputs a standard `policy-as-code` YAML file for configuration.
### Workflow
1. Analyze permission needs; pin down the agent's callable tool range and the off-limits zones.
2. Load `gate_policy.py` and pass in the business-scenario parameters to pre-draft the policy.
3. Generate the four gate rules (anti-overreach, anti-accidental-deletion, anti-runaway, anti-violation).
4. Run internal safety checks to confirm the policy introduces no logic loops or permission conflicts.
5. Emit the final `LGD-III_policy.yaml`.
6. Deploy the policy to the runtime environment and verify the permissions take effect.
### Evidence & safety statement
- Evidence: TBD (no evaluation / badge link yet; update here once it is produced)
- Version: 1.0.1
- Security: no independent security scan has been performed (TBD); the conclusion is pending and no endorsement is given until it is completed.
## 中文
### 何时用
1. 当 Agent 计划访问外部敏感工具或执行高危操作前,需划定权限边界与四道门禁规则;
2. 在项目涉及代码变更、数据导出或文件操作时,用于自动防越权与误删/误发校验;
3. 检测到潜在的安全风险模式或失控循环迹象时,快速生成阻断性政策配置;
4. 在环境部署新权限层级(如隔离、审计、审批)的初始化设置阶段。
### 用法
通过执行 `python gate_policy.py` 命令调用技能生成逻辑,直接读取文件 `gate_policy.py`;
关键参数包括:`--scenario` (定义业务场景)、`--tool-list` (可调用/禁止工具集合)、`--review-mode` (评审级别);
系统将基于 `__pycache__` 缓存环境自动识别上下文,输出标准 `policy-as-code` YAML 格式文件供配置使用。
### 流程
1. 分析权限需求,明确 Agent 可调用的工具范围及不可触碰的禁区;
2. 加载 `gate_policy.py` 脚本并传入业务场景参数进行政策预演;
3. 生成四道门禁规则(防越权、防误删、防失控、防违规);
4. 执行内部安全校验,确认策略未引发逻辑死循环或权限冲突;
5. 输出最终生成的 `LGD-III_policy.yaml` 文件;
6. 将策略部署到运行环境并完成权限生效验证。
### 证据与安全声明
- 证据:TBD(暂无评测/徽章链接;产生后在此更新实际链接)
- 版本:1.0.1
- 安全:未做独立安全扫描(TBD),结论待补;补全前不作推荐背书。使用说明
# 权限有门禁生成器 / Gate Policy Generator

> The executor of **LGD-III GATED** — "凡自治之物:有籍 · 有证 · 有门禁"
## English
Turn an agent capability list into a mountable **permission gate policy (policy-as-code)**, drawing the line between what it can / must review / must not do, with four built-in gates against overreach, accidental deletion/sending and runaway loops.
### Pain → three-laws mapping
| Industry pain | LGD law | This skill |
|---|---|---|
| Agent overreach | LGD-III gated | three tiers: tool_allow / tool_review / tool_deny |
| Accidental deletion/sending | LGD-III gated | release gate with double confirmation |
| Runaway loops | LGD-III gated | budget caps (max_loop / max_tokens) |
| No unified permission vocabulary | LGD standard definition power | the four-gate terms become the industry's ruler |
### Quick start
```bash
# Example policy (no manifest needed)
python scripts/gate_policy.py --preset default --json
# Generate from a manifest
python scripts/gate_policy.py --manifest agent_manifest.json --out policy.json
# Verify it meets the LGD-III four gates
python scripts/gate_policy.py --check policy.json
```
### Three presets
- `default` (balanced): high-risk/sensitive → deny, medium → review, low → allow
- `paranoid` (strict): medium also denied, loop cap 5, token cap 50k
- `open` (loose): only sensitive denied, rest allowed, loop cap 50
### Output structure
```json
{
"law": "LGD-III GATED",
"tool_allow": [...], "tool_review": [...], "tool_deny": [...],
"gates": {"trigger":..., "review":..., "release":..., "retro":...},
"budget": {"max_loop_iterations": 20, "max_tokens": 200000}
}
```
### Sibling skills
- `tool-call-guard` = runtime single-call gate
- this skill = policy generation layer (governance config)
### Red lines
Only generates policy config; does not replace licensed filings / contracts / human release; contains no secrets or internal codenames.
## 中文
> **LGD-III 有门禁(GATED)** 的执行器 ——「凡自治之物:有籍 · 有证 · 有门禁」
把一份 agent 能力清单,落成可挂载的**权限门禁策略(policy-as-code)**,划清它能 / 需评审 / 不能做的事,并内置四道门禁防越权、误删误发、失控循环。
### 痛点 → 三律映射
| 行业痛点 | LGD 三律 | 本技能做法 |
|---|---|---|
| agent 越权 | LGD-III 有门禁 | tool_allow / tool_review / tool_deny 三档边界 |
| 误删误发 | LGD-III 有门禁 | 放行门禁(release)二次确认 |
| 失控循环 | LGD-III 有门禁 | budget 上限(max_loop / max_tokens) |
| 无统一权限词汇 | LGD 标准定义权 | 四道门禁术语即行业评判尺 |
### 快速开始
```bash
# 示例策略(无需 manifest)
python scripts/gate_policy.py --preset default --json
# 从清单生成
python scripts/gate_policy.py --manifest agent_manifest.json --out policy.json
# 校验是否满足 LGD-III 四道门禁
python scripts/gate_policy.py --check policy.json
```
### 三档预设
- `default`(平衡):高危/敏感 → deny,中危 → review,低危 → allow
- `paranoid`(严苛):中危也 deny,循环上限 5、token 上限 5 万
- `open`(宽松):仅敏感 deny,其余 allow,循环上限 50
### 输出结构
```json
{
"law": "LGD-III 有门禁 (GATED)",
"tool_allow": [...], "tool_review": [...], "tool_deny": [...],
"gates": {"trigger":..., "review":..., "release":..., "retro":...},
"budget": {"max_loop_iterations": 20, "max_tokens": 200000}
}
```
### 与兄弟技能
- `tool-call-guard` = 运行时单次调用闸门
- 本技能 = 策略生成层(治理配置)
### 红线
只生成策略配置,不替代持证申报 / 合同 / 人工放行;不含密钥与内部代号。
---
© SynomosAI (LGD initiative) · LGD-Powered · 凡自治之物:有籍 · 有证 · 有门禁
---
## License & attribution
**分层许可(务必并读;代码许可不覆盖文档与理论文本)**
- **代码**(本包 `.py` 文件):**MIT**
- **本 `README.md` / `SKILL.md` 及其中的理论文本、方法论与一切理论表述**:**不在 MIT 覆盖范围内**,保留所有权利(All rights reserved)
```
© 2026 SynomosAI · China. All rights reserved.
理论署名 (attribution) : LGD(Lifecycle Governance Doctrine / 全程治理论)— SynomosAI initiative
名称状态 (name status) : "SynomosAI" — 未申请实体注册、未申请商标注册
(not a registered legal entity; no trademark registered)
生产参考部署 (production reference, self-reported) : 无(未声明外部生产参考部署)
← 非认证、非背书、非监管认可(not a certification or endorsement)
代码许可 (code license) : 本包未附 LICENSE 文件(许可待定)
本文本与理论表述不在任何代码许可覆盖范围内
引用格式 (cite as) : 本资产无 DOI
```
(上列为《LGD 对外表述规范》§3.2 统一块,**整体复制、未删改**;发布/重提前须照最新版本复核。)支持平台:Qoder · QoderWork · Claude · Codex 等 AI 编程助手