Linux 软件免费装
Banner图

Belayline Agent Governance

开发者 stephen1204paul
更新时间 2026年10月14日 09:14
PHP版本: 8.1 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

security woocommerce ai mcp audit-log

下载

0.4.5

详情介绍:

Belayline Agent Governance governs other plugins' agent tool calls, not just its own. It sits between AI agents (through the WordPress Abilities API, and through MCP servers built on mcp-adapter, as WooCommerce's is) and the actions those agents can take on your site. Every governed call is classified by tier, checked against a capability pack bound to the calling identity, and written to a tamper-evident, hash-chained audit log, before it runs. The plugin is WordPress-general. It ships a core/* module that runs on every site, and a WooCommerce module that wires in automatically when WooCommerce is active. Neither one trusts a tool's own "read-only" or "safe" label; classification comes from the plugin's own policy map. Capability packs and tiers Every governed ability maps to a tier: reversible (read), side-effecting (write), or irreversible (delete, refund, cancel). A capability pack is a named, scoped view of the verb catalog for one identity — a WordPress application password, a user or role, or a WooCommerce REST API key — with an allow list, a hard-denied tier class, a per-tier approval requirement, and optional rate and spend limits. A credential with no explicit binding falls back to a safe default pack rather than inheriting full access. Human approval When a pack requires approval for a tier (the starter packs do for irreversible calls), a call at that tier doesn't execute. It is queued under Tools → Pending Agent Actions for a human to approve or reject. When an Approval is requested, Belayline Agent Governance captures a fingerprint of the target's current state; when the approval is claimed, it re-checks that fingerprint. A mismatch means the target changed between request and claim, so the old approval is marked stale and a fresh request is filed. This narrows the gap between a human's approval and the write — it does not close it, because the short window between claiming an approval and executing the call still exists. Self-service approval status An agent can call belayline/check-approval with an approval_id to poll its own request without a human in the loop. It reports a reduced, public status (pending, approved, rejected, expired, used, or superseded) and a plain-English next_action, and never returns the approver's identity, the original arguments, or any token. Hash-chained audit log Every gate decision and executed action is appended to an append-only, hash-chained log under Tools → Agent Audit Log, with a tamper-evidence check that re-verifies the chain on load. Core coverage Governs the three abilities WordPress core registers today. Any other core/* ability is denied until Belayline Agent Governance maps it, so future core write abilities fail closed rather than run ungoverned. WooCommerce coverage When WooCommerce is active, Belayline Agent Governance governs exactly these 16 abilities: Everything else under woocommerce/ is refused as an unknown verb. Deleting a product with force: true is classed irreversible; a plain delete (trash) is side-effecting. Which MCP endpoint to use WooCommerce's own MCP endpoint (/wp-json/woocommerce/mcp) is deprecated by WooCommerce itself, which points clients at the shared mcp-adapter server instead. Belayline Agent Governance governs both the same way, through the ability permission check, but the two endpoints don't expose the same information to an agent: We recommend running agents against the shared mcp-adapter server. WooCommerce's own endpoint is supported for as long as WooCommerce ships it, with the limitation above. Environment awareness Belayline Agent Governance notices when a site's address changes (a migration, a staging clone) and treats it as a new environment: shadow-mode windows, active grants, and approved-but-unclaimed approvals are all voided rather than carried over silently, and an admin notice stays up until someone rebinds the site from the settings page. Production sites (wp_get_environment_type() === 'production', WordPress's own default) never default to shadow mode and cap any shadow window at 24 hours. Multisite WordPress multisite is not supported. Activation is refused on a multisite install, network-wide or per site.

安装:

  1. Upload the plugin to /wp-content/plugins/belayline-agent-governance, or install it through the Plugins screen.
  2. Activate Belayline Agent Governance.
  3. Visit Tools → Agent Capability Packs to bind identities (application passwords, users or roles, WooCommerce REST API keys) to a pack. Unbound credentials get a safe default pack.
  4. Review pending actions under Tools → Pending Agent Actions and the log under Tools → Agent Audit Log.
WooCommerce support activates automatically when WooCommerce is active; there is nothing else to configure for it to be safe by default.

升级注意事项:

0.4.5 Renamed to Belayline Agent Governance, with a new slug, text domain and belayline_ prefix for hooks, options and tables. Deactivate and delete the old plugin folder, then install this one. 0.4.4 Security fix: order status values with WooCommerce's wc- prefix (for example wc-completed) now get the same approval tier as unprefixed ones. Update right away. 0.4.3 Renamed (new folder and main file). If you installed an earlier build from GitHub, deactivate and delete the old plugin folder, then install this one. Tables and settings carry over. 0.4.2 Fixes a critical error on sites without mcp-adapter the first time a pack allowed an ability call. Update right away. 0.4.1 Renamed for the WordPress.org directory; no behaviour change. If you installed 0.4.0 from GitHub, deactivate and delete the old agent-safety folder, then install this one. Tables and settings carry over. 0.4.0 Schema change: the grants table is renamed and the approvals table gains new columns. Back up your database before upgrading. There is no downgrade path back to a pre-0.4.0 build once this runs.

常见问题:

Does this require WooCommerce?

No. The plugin is WordPress-general and governs the core Abilities API on any site. WooCommerce support is a self-contained module that loads only when WooCommerce is active.

Does it work on multisite?

No. Activation is refused on a multisite install, both network-wide and per site.

What about WooCommerce's own MCP endpoint?

It's governed the same way as the shared mcp-adapter server, but WooCommerce's bundled mcp-adapter version doesn't forward the structured approval_required error data to the client, so an agent on that endpoint can see the approval message but not the approval_id, and can't reach belayline/check-approval. See the Description for details. We recommend the shared mcp-adapter server; WooCommerce's own endpoint is supported while WooCommerce continues to ship it.

What happens to my data on uninstall?

Nothing, by default. Deleting the plugin from the Plugins screen leaves the audit log, approval tables, and plugin options in place, because the audit log is a tamper-evident security record. To have uninstall remove everything (all three tables, every option, every scheduled cron event), define BELAYLINE_REMOVE_DATA as true (for example in wp-config.php) before deleting the plugin.

How are AI agents identified?

By whichever credential authenticated the request: a WordPress application password, a logged-in user or their role, or — when WooCommerce is active — the WooCommerce REST API key used to authenticate the request. Each is bound to a capability pack independently under Tools → Agent Capability Packs.

更新日志:

0.4.5 0.4.4 0.4.3 0.4.2 0.4.1 0.4.0