consensus-permission-escalation-guard
INLINECODE0 is the final safety gate before privilege elevation is applied.
What this skill does
- - validates escalation requests against a strict input schema (reject unknown fields)
- evaluates hard-block and rewrite policy flags for IAM risk patterns
- runs persona-weighted voting (or aggregates external votes)
- returns one of: INLINECODE1
- writes decision artifacts for replay/audit
Decision policy shape
Hard-block examples:
- - wildcard permissions (
*, : *, broad owner/admin jumps) - missing ticket reference when required
- break-glass escalation without incident reference
- separation-of-duties conflicts (e.g., create + approve authority)
Rewrite examples:
- - weak or non-actionable justification
- temporary duration exceeds policy limit
- production escalation requires explicit human confirmation gate
Runtime and safety model
- - runtime binaries:
node, INLINECODE5 - network behavior: none in deterministic guard logic
- environment config read by this package:
CONSENSUS_STATE_FILE, INLINECODE7 - filesystem writes: consensus board/state artifacts under configured state path
Invoke contract
Modes:
- -
mode="persona" (default): uses local deterministic persona defaults for internal voting - INLINECODE10 : consume
external_votes[], then aggregate and enforce policy deterministically
Install
CODEBLOCK0
Quick start
CODEBLOCK1
Tests
CODEBLOCK2
Test coverage includes schema rejection, hard-block paths, rewrite paths, allow paths, idempotent retries, and external-agent aggregation behavior.
Note: this skill depends on consensus-guard-core for aggregation/state helpers; review that package alongside this one for full runtime auditability.
See also: SECURITY-ASSURANCE.md for threat model, runtime boundaries, and deployment hardening guidance.
consensus-permission-escalation-guard
consensus-permission-escalation-guard 是权限提升应用前的最终安全门控。
该技能的功能
- - 根据严格的输入模式验证权限提升请求(拒绝未知字段)
- 评估IAM风险模式的硬阻断和重写策略标志
- 运行角色加权投票(或聚合外部投票)
- 返回以下结果之一:ALLOW | BLOCK | REQUIRE_REWRITE
- 写入决策工件用于回放/审计
决策策略形态
硬阻断示例:
- - 通配符权限(、: 、宽泛的owner/admin跳转)
- 需要时缺少工单引用
- 无事件引用的紧急提升
- 职责分离冲突(例如,创建+审批权限)
重写示例:
- - 薄弱或不可执行的正当理由
- 临时持续时间超过策略限制
- 生产环境提升需要明确的人工确认门控
运行时和安全模型
- - 运行时二进制文件:node、tsx
- 网络行为:确定性门控逻辑中无网络行为
- 此包读取的环境配置:CONSENSUSSTATEFILE、CONSENSUSSTATEROOT
- 文件系统写入:在配置的状态路径下写入共识板/状态工件
调用合约
- - invoke(input, opts?) -> Promise
模式:
- - mode=persona(默认):使用本地确定性角色默认值进行内部投票
- mode=externalagent:消费externalvotes[],然后聚合并确定性执行策略
安装
bash
npm i consensus-permission-escalation-guard
快速开始
bash
node --import tsx run.js --input ./examples/input.json
测试
bash
npm test
测试覆盖范围包括模式拒绝、硬阻断路径、重写路径、允许路径、幂等重试和外部代理聚合行为。
注意:此技能依赖consensus-guard-core进行聚合/状态辅助;请将此包与该包一起审查以实现完整的运行时可审计性。
另请参阅:SECURITY-ASSURANCE.md了解威胁模型、运行时边界和部署加固指南。