Skip to content

Releases: doffice/moonpermit

MoonPermit v0.1.1

Choose a tag to compare

@doffice doffice released this 11 Sep 08:30
5545c44

MoonPermit v0.1.1 adds a deterministic guarded Agent Host reference integration.

Highlights

  • Routes recognized typed tool calls through Runtime::check_with_proof before execution.
  • Retains the atomic Receipt and AuthorizationProof for later inspection.
  • Demonstrates allow-once execution with a deterministic in-memory fake executor.
  • Demonstrates zero executor side effects for scope denial, expiry, budget exhaustion, duplicate invocation, and unsupported tools.
  • Demonstrates NeedsApproval for requested authority expansion and deterministic offline receipt audit.
  • Adds the guarded-host smoke test to Ubuntu, macOS, and Windows CI.

Verification

  • 65 tests pass under --deny-warn.
  • Core coverage: 528/550 (96.0%).
  • All instrumented source: 639/890 (71.8%).
  • Release commit 5545c44 passed check, test, format, public API drift, build, CLI, examples, coverage, and benchmark jobs.

Security boundary

The guarded-host example uses an in-memory fake executor and performs no real filesystem, process, network, or secret operation. MoonPermit demonstrates application-level host mediation; it is not an operating-system sandbox or a cryptographic authorization credential.

MoonPermit v0.1.0

Choose a tag to compare

@doffice doffice released this 07 Sep 01:43
619328f

MoonPermit 的首个公开版本:面向 AI Agent 工具调用的纯 MoonBit 最小权限授权引擎。

MoonPermit 将结构化任务计划编译为可执行的最小权限 Permit,在每次真实工具调用前检查权限范围、有效期和剩余预算,并生成可解释、可审计的确定性决策证据。

Highlights

  • 支持文件读取、文件写入、文件删除、进程执行、网络发送和密钥读取等类型化效果。
  • 支持规范化路径、命令参数前缀、主机与子域名、HTTP 方法和数据敏感级别约束。
  • 将结构化计划确定性地编译为最小权限 Permit。
  • 支持调用次数、字节数和逻辑有效期预算。
  • 支持原子运行时授权判断和重复调用防护。
  • 新增 Runtime::check_with_proof,从一次原子判断同时返回 Receipt 与结构化 AuthorizationProof。
  • 授权证明逐项记录范围包含、有效期、调用额度、字节额度和调用标识唯一性检查。
  • 支持不可扩权的子 Permit 委托,并从父级剩余预算中事务性预留额度。
  • 支持权限扩张 Diff,仅对新增或扩大的权限要求重新批准。
  • 支持确定性 JSON Receipt 和离线重放审计。
  • 提供 compilecheckexplaindelegatediffaudit CLI 命令。
  • 提供无需 API Key、网络服务或付费依赖的完整演示与嵌入示例。

Quick start

运行内置端到端演示:

moon run cmd/main

生成一次机器可读的授权解释:

moon run cmd/main -- explain \
  --calls 2 \
  --bytes 10 \
  --expires 20 \
  --cost 4 \
  --now 5 \
  read-tree:docs \
  read:docs/guide.md

输出包含来自同一次运行时状态变更的 receiptproof,证明生成不会重复消耗预算。

Installation

发布至 Mooncakes 后,可以使用以下命令添加依赖:

moon add doffice/moonpermit@0.1.0

在 MoonBit 包配置中导入:

import {
  "doffice/moonpermit",
}

Verification

本版本已通过以下质量门禁:

  • 62/62 项测试通过。
  • 核心库覆盖率为 528/550,即 96.0%。
  • moon check --deny-warn 通过。
  • moon test --deny-warn 通过。
  • moon fmt --check 通过。
  • moon info 公共接口漂移检查通过。
  • Release 构建与基准测试通过。
  • CLI 综合演示和独立嵌入示例通过。
  • GitHub Actions 在 Ubuntu、macOS 和 Windows 上全部通过。

Security boundary

Authorization proofs are structured decision evidence, not cryptographic proofs or signatures.

MoonPermit is an application-level reference monitor. It does not execute tools and does not replace an operating-system sandbox. The embedding host must mediate every protected effect and provide truthful typed requests and logical time.

Proofs are tied to the runtime state used for their atomic decisions and must not be treated as reusable authorization credentials. Proof output does not reveal secret values beyond the same typed secret identifier already present in the checked request.

Compatibility

  • 保留原有 Runtime::check 公共 API。
  • 保留原有 Receipt JSON 格式和判断行为。
  • Runtime::check_with_proof 是新增接口,不会要求现有调用方迁移。
  • 版本遵循 Semantic Versioning 2.0.0。

Related work

感谢 MoonBit 社区及所有公开参考资料的维护者。